Skip to content

Commit

Permalink
Added gen_travis rake task, updated .travis.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
hurricup committed Sep 20, 2021
1 parent 7dfebf9 commit 799cb90
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 31 deletions.
60 changes: 29 additions & 31 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
language: ruby
dist: trusty
os:
- linux
- osx

rvm:
- 1.8.7
- 1.9.3
- 2.0.0
- 2.1.10
- 2.2.8
- 2.3.8
- 2.4.6
- 2.5.5
- 2.6.3
- ruby-head

matrix:
fast_finish: true
allow_failures:
- rvm: ruby-head

exclude:
include:
- os: linux
rvm: 3.0.1
- os: osx
rvm: 1.9.3
rvm: 3.0.1
- os: linux
rvm: 2.7.3
- os: osx
rvm: 2.0.0

rvm: 2.7.3
- os: linux
rvm: 2.6.7
- os: osx
rvm: 2.6.7
- os: linux
rvm: 2.5.9
- os: osx
rvm: 2.5.9
- os: linux
rvm: 2.4.10
- os: osx
rvm: 2.4.10
- os: linux
rvm: 2.3.8
- os: linux
rvm: 2.2.10
- os: linux
rvm: 2.1.10
- os: linux
rvm: 2.0.0
- os: linux
rvm: 1.9.3
- os: linux
rvm: 1.8.7

# include:
# - os: osx
# rvm: 1.9.3
# before_script: rvm install ruby-1.9.3 # not binary
# - os: osx
# rvm: 2.0.0
# before_script: rvm install ruby-2.0.0 # not binary
51 changes: 51 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,55 @@ task :changelog, :since_c, :until_c do |t,args|
end

puts changelog_content
end

desc "Generates travis.yaml"
task :gen_travis do
versions = []

def versions.add(major:, minor:, include_macos: true)
self << { major: major, minor: [minor], include_macos: include_macos }
end

versions.add major: '3.0', minor: 1
versions.add major: '2.7', minor: 3
versions.add major: '2.6', minor: 7
versions.add major: '2.5', minor: 9
versions.add major: '2.4', minor: 10
versions.add major: '2.3', minor: 8, include_macos: false
versions.add major: '2.2', minor: 10, include_macos: false
versions.add major: '2.1', minor: 10, include_macos: false
versions.add major: '2.0', minor: 0, include_macos: false
versions.add major: '1.9', minor: 3, include_macos: false
versions.add major: '1.8', minor: 7, include_macos: false

puts <<EOM
language: ruby
dist: trusty
matrix:
fast_finish: true
include:
EOM

loop do
found_some = false

versions.each do |version|
minor = version[:minor].pop
if minor
found_some = true
full_version = "#{version[:major]}.#{minor}"
puts <<EOM
- os: linux
rvm: #{full_version}
EOM
puts <<EOM if version[:include_macos]
- os: osx
rvm: #{full_version}
EOM
end
end

break unless found_some
end
end

0 comments on commit 799cb90

Please sign in to comment.