File: Rakefile

package info (click to toggle)
ruby-unindent 1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 100 kB
  • ctags: 6
  • sloc: ruby: 42; makefile: 3
file content (39 lines) | stat: -rw-r--r-- 1,030 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
def gem_opt
  defined?(Gem) ? "-rubygems" : ""
end

# --------------------------------------------------
# Tests
# --------------------------------------------------
task(:default => :'test:all')

namespace(:test) do
  desc "Run tests"
  task(:all) do
    exit system("ruby #{gem_opt} -I.:lib test/test_unindent.rb")
  end

  desc "Run tests on multiple ruby versions (requires rvm)"
  task(:portability) do
    versions = %w( 1.8.6  1.8.7  1.9  1.9.2 )
    versions.each do |version|
      system <<-BASH
        bash -c 'source ~/.rvm/scripts/rvm;
                 rvm use #{version};
                 echo "--------- #{version} ----------";
                 rake -s test:all'
      BASH
    end
  end
end

# --------------------------------------------------
# Docs
# --------------------------------------------------
desc "Generate YARD Documentation"
task(:yardoc) do
  require 'yard'
  files   = %w( lib/**/*.rb )
  options = %w( -o doc/yard --readme README --files LICENSE )
  YARD::CLI::Yardoc.run *(options + files)
end