File: Rakefile

package info (click to toggle)
ruby-default-value-for 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 156 kB
  • sloc: ruby: 534; makefile: 2
file content (47 lines) | stat: -rw-r--r-- 890 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
40
41
42
43
44
45
46
47
task :default => :test

require "bundler/gem_tasks"

desc "Run unit tests."
task :test do
  ruby "test.rb"
end

rails_versions = %w(
  6.1
  7.0
  7.1
  7.2
  8.0
)

rails_versions.each do |version|
  dotless = version.delete('.')

  namespace :bundle do
    desc "Bundle with Rails #{version}.x"
    task :"rails#{dotless}" do
      ENV['BUNDLE_GEMFILE'] = "gemfiles/rails_#{dotless}.gemfile"
      sh "bundle"
    end
  end

  namespace :test do
    desc "Test with Rails #{version}.x"
    task :"rails#{dotless}" do
      ENV['BUNDLE_GEMFILE'] = "gemfiles/rails_#{dotless}.gemfile"
      ruby "test.rb"
    end
  end
end

namespace :test do
  desc "Test with all supported Rails versions"
  task :railsall do
    rails_versions.each do |version|
      dotless = version.delete('.')
      ENV['BUNDLE_GEMFILE'] = "gemfiles/rails_#{dotless}.gemfile"
      ruby "test.rb"
    end
  end
end