Skip to content
Newer
Older
100644 117 lines (107 sloc) 3.37 KB
3b68b25 @bmabey added jeweler
bmabey authored May 25, 2009
1 require 'rubygems'
9e70852 @timcharper Use bundler to manage dependencies
timcharper authored Jul 9, 2010
2 require 'bundler'
3 Bundler.setup
3b68b25 @bmabey added jeweler
bmabey authored May 26, 2009
4 require 'rake'
5
5aecd06 @timcharper fixes rake spec task
timcharper authored May 27, 2011
6 require 'rspec/core/rake_task'
7 RSpec::Core::RakeTask.new(:spec)
3b68b25 @bmabey added jeweler
bmabey authored May 26, 2009
8 begin
9 require 'cucumber/rake/task'
10 Cucumber::Rake::Task.new(:features)
11 rescue LoadError
12 task :features do
13 abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
14 end
15 end
16
17 task :default => :spec
18
19 require 'rake/rdoctask'
20 Rake::RDocTask.new do |rdoc|
21 if File.exist?('VERSION.yml')
0bdc6fc @aslakhellesoy Require yaml explicitly. Needed for Ruby1.9. Features are not running…
aslakhellesoy authored Aug 13, 2009
22 require 'yaml'
3b68b25 @bmabey added jeweler
bmabey authored May 26, 2009
23 config = YAML.load(File.read('VERSION.yml'))
24 version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
25 else
26 version = ""
27 end
28
29 rdoc.rdoc_dir = 'rdoc'
30 rdoc.title = "Spork #{version}"
31 rdoc.rdoc_files.include('README*')
32 rdoc.rdoc_files.include('lib/**/*.rb')
33 end
34
9e70852 @timcharper Use bundler to manage dependencies
timcharper authored Jul 9, 2010
35
36 desc "Install gem bundles used for tests"
37 task :install_bundles do
38 load File.expand_path("features/support/bundler_helpers.rb", File.dirname(__FILE__))
39 Dir["features/gemfiles/*"].each do |gemfile_dir|
40 BundlerHelpers.install_bundle(gemfile_dir)
41 puts "done."
08ad863 @timcharper tested and verified working against rails 2.3.2, 2.2.2, 2.1.2, 2.1.1,…
timcharper authored Jun 6, 2009
42 end
43 end
9e70852 @timcharper Use bundler to manage dependencies
timcharper authored Jul 9, 2010
44
d8a9a42 @tenderlove adding a task to generate gems, and a conditional to the gemspec for …
tenderlove authored May 26, 2011
45 namespace :gem do
46 desc "build gems for deployment to rubygems.org"
47 task :build do
48 sh "rm -f spork-*.gem"
49 sh "gem build spork.gemspec"
50 sh "env PLATFORM=x86-mingw32 gem build spork.gemspec"
51 sh "env PLATFORM=x86-mswin32 gem build spork.gemspec"
52 end
53
54 task :push do
55 Dir["spork-*.gem"].each do |g|
56 sh "gem push #{g}"
57 end
58 end
59 end
60
9e70852 @timcharper Use bundler to manage dependencies
timcharper authored Jul 9, 2010
61 # PENDING: Get this to work with gem bundler
62 # desc "Test all supported versions of rails"
63 # task :test_rails do
64 # FAIL_MSG = "!! FAIL !!"
65 # OK_MSG = "OK"
66 # UNSUPPORTED_MSG = "Unsupported"
67 # rails_gems = `gem list rails`.grep(/^rails\b/).first
68 # versions = rails_gems.scan(/\((.+)\)/).flatten.first.split(", ")
69 # versions_2_x_gems = versions.grep(/^2/)
70 # results = {}
71 # versions_2_x_gems.each do |version|
72 # if version < '2.0.5'
73 # puts "-----------------------------------------------------"
74 # puts "Rails #{version} is not officially supported by Spork"
75 # puts "Why? http://www.nabble.com/rspec-rails-fails-to-find-a-controller-name-td23223425.html"
76 # puts "-----------------------------------------------------"
77 # results[version] = UNSUPPORTED_MSG
78 # next
79 # end
80 #
81 #
82 # puts "Testing version #{version}"
83 # pid = Kernel.fork do
84 # test_files = %w[features/rspec_rails_integration.feature features/rails_delayed_loading_workarounds.feature]
85 #
86 # unless version < '2.1'
87 # # pending a fix, the following error happens with rails 2.0:
88 # # /opt/local/lib/ruby/gems/1.8/gems/cucumber-0.3.11/lib/cucumber/rails/world.rb:41:in `use_transactional_fixtures': undefined method `configuration' for Rails:Module (NoMethodError)
89 # test_files << "features/cucumber_rails_integration.feature "
90 # end
91 # exec("env RAILS_VERSION=#{version} cucumber #{test_files * ' '}; echo $? > result")
92 # end
93 # Process.waitpid(pid)
94 # result = File.read('result').chomp
95 # FileUtils.rm('result')
96 # if result=='0'
97 # results[version] = OK_MSG
98 # else
99 # results[version] = FAIL_MSG
100 # end
101 # end
102 #
103 # puts "Results:"
104 # File.open("TESTED_RAILS_VERSIONS.txt", 'wb') do |f|
105 # results.keys.sort.each do |version|
106 # s = "#{version}:\t#{results[version]}"
107 # f.puts(s)
108 # puts(s)
109 # end
110 # end
111 # if results.values.any? { |r| r == FAIL_MSG }
112 # exit 1
113 # else
114 # exit 0
115 # end
116 # end
Something went wrong with that request. Please try again.