|
1 | | -require 'rake/rdoctask' |
2 | | -require 'rspec/core/rake_task' |
| 1 | +begin |
| 2 | + require 'rspec/core/rake_task' |
| 3 | +rescue LoadError |
| 4 | + # no spec tasks |
| 5 | +else |
| 6 | + task :default => :spec |
3 | 7 |
|
4 | | -task :default => :spec |
5 | | - |
6 | | -desc 'Run ALL OF the specs' |
7 | | -RSpec::Core::RakeTask.new(:spec) do |t| |
8 | | - # t.ruby_opts = '-w' |
9 | | -end |
10 | | - |
11 | | -namespace :spec do |
12 | | - desc "Run Rails specs" |
13 | | - RSpec::Core::RakeTask.new(:rails) do |t| |
14 | | - t.pattern = %w'spec/finders/active_record_spec.rb spec/view_helpers/action_view_spec.rb' |
| 8 | + desc 'Run ALL OF the specs' |
| 9 | + RSpec::Core::RakeTask.new(:spec) do |t| |
| 10 | + # t.ruby_opts = '-w' |
| 11 | + t.pattern = 'spec/finders/active_record_spec.rb' if ENV['DB'] and ENV['DB'] != 'sqlite3' |
15 | 12 | end |
16 | | -end |
17 | 13 |
|
18 | | -desc 'Generate RDoc documentation for the will_paginate plugin.' |
19 | | -Rake::RDocTask.new(:rdoc) do |rdoc| |
20 | | - rdoc.rdoc_files.include('README.rdoc', 'LICENSE', 'CHANGELOG.rdoc'). |
21 | | - include('lib/**/*.rb'). |
22 | | - exclude('lib/will_paginate/finders/active_record/named_scope*'). |
23 | | - exclude('lib/will_paginate/finders/sequel.rb'). |
24 | | - exclude('lib/will_paginate/view_helpers/merb.rb'). |
25 | | - exclude('lib/will_paginate/deprecation.rb'). |
26 | | - exclude('lib/will_paginate/core_ext.rb'). |
27 | | - exclude('lib/will_paginate/version.rb') |
28 | | - |
29 | | - rdoc.main = "README.rdoc" # page to start on |
30 | | - rdoc.title = "will_paginate documentation" |
31 | | - |
32 | | - rdoc.rdoc_dir = 'doc' # rdoc output folder |
33 | | - rdoc.options << '--inline-source' << '--charset=UTF-8' |
34 | | - rdoc.options << '--webcvs=http://github.com/mislav/will_paginate/tree/master/' |
| 14 | + namespace :spec do |
| 15 | + desc "Run Rails specs" |
| 16 | + RSpec::Core::RakeTask.new(:rails) do |t| |
| 17 | + t.pattern = %w'spec/finders/active_record_spec.rb spec/view_helpers/action_view_spec.rb' |
| 18 | + end |
| 19 | + end |
35 | 20 | end |
36 | 21 |
|
37 | | -task :website do |
38 | | - Dir.chdir('website') do |
39 | | - %x(haml index.haml index.html) |
40 | | - %x(sass pagination.sass pagination.css) |
41 | | - end |
| 22 | +desc 'Run specs against both Rails 3.1 and Rails 3.0' |
| 23 | +task :rails3 do |variable| |
| 24 | + system 'bundle exec rake spec && BUNDLE_GEMFILE=Gemfile.rails3.0 bundle exec rake spec:rails' |
42 | 25 | end |
0 commit comments