forked from transloadit/rails-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
62 lines (51 loc) · 1.53 KB
/
Rakefile
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
require 'rake/gempackagetask'
require 'rake/testtask'
RUBIES = %w{ 1.9.2 1.8.7 1.8.6 rbx-1.2.0 }
GEMSPEC = 'transloadit-rails.gemspec'
spec = eval open(GEMSPEC).read
Rake::GemPackageTask.new(spec) do |gem|
gem.need_tar = true
end
Rake::TestTask.new do |test|
test.libs << 'test'
test.pattern = 'test/**/test_*.rb'
end
namespace :test do
begin
`rvm -v` # raise an exception if RVM isn't installed
desc 'Run tests against all supported Rubies'
task :multiruby do
system "rvm #{RUBIES.join(',')} ruby bundle exec rake -s test"
# clean up after Rubinius
require 'pathname'
Pathname.glob('**/*.rbc').each {|path| path.unlink }
end
namespace :multiruby do
desc 'Prepare supported rubiesfor testing'
task :setup do
warn 'Preparing multiruby. This may take awhile...'
# create gemsets, install bundler, bundle
RUBIES.each {|ruby| system "rvm #{ruby} gemset create transloadit" }
system "rvm #{RUBIES.join(',')} gem install bundler --no-ri --no-rdoc"
system "rvm #{RUBIES.join(',')} ruby bundle install"
end
end
rescue Errno::ENOENT
desc 'You need `rvm` installed to test against multiple Rubies'
task :multiruby
end
end
begin
require 'yard'
require 'yard/rake/yardoc_task'
YARD::Rake::YardocTask.new :doc do |yard|
yard.options = %w{
--title Transloadit Rails
--readme README.md
--markup rdoc
}
end
rescue
desc 'You need the `yard` gem to generate documentation'
task :doc
end