Skip to content

Commit 4b31229

Browse files
authored
Merge pull request #275 from DavidS/cleanup-Gemfile-codecov
(maint) Cleanup gemfile and fix codecov dependency
2 parents 4804420 + 1cece80 commit 4b31229

File tree

1 file changed

+35
-20
lines changed

1 file changed

+35
-20
lines changed

Gemfile

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,60 @@
1-
source "https://rubygems.org"
1+
source 'https://rubygems.org'
22

3-
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
3+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
44

55
# Specify your gem's dependencies in puppet-resource_api.gemspec
66
gemspec
77

88
group :tests do
9-
gem 'codecov'
9+
gem 'CFPropertyList'
1010
gem 'rspec', '~> 3.0'
11-
# rubocop 0.58 throws when testing against ruby 2.1, so pin to the latest,
12-
# unless we're dealing with jruby...
11+
gem 'simplecov-console'
12+
13+
# the test gems required for module testing
14+
gem 'puppetlabs_spec_helper', '~> 2.7'
15+
gem 'rspec-puppet'
16+
17+
# since the Resource API runs inside the puppetserver, test against the JRuby versions we ship
18+
# these require special dependencies to have everything load properly
19+
20+
# `codecov` 0.1.17 introduced usage of %i[] which is not recognised by JRuby 1.7
21+
if RUBY_PLATFORM == 'java' && Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('2.3.0')
22+
gem 'codecov', '= 0.1.16'
23+
else
24+
gem 'codecov'
25+
end
26+
27+
# `rake` dropped support for older versions of ruby a while back
1328
if RUBY_PLATFORM == 'java'
14-
# load a rake version that works on java
1529
gem 'rake', '~> 10.0'
30+
else
31+
gem 'rake', '~> 12.3'
32+
end
33+
34+
# rubocop is special, as usual
35+
if RUBY_PLATFORM == 'java'
1636
# load a rubocop version that works on java for the Rakefile
1737
gem 'parser', '2.3.3.1'
1838
gem 'rubocop', '0.41.2'
19-
# JRuby 1.7 does not like json 2.3.0, jruby 9.1.9.0 has RUBY_VERSION == '2.3.3'
20-
gem 'json', '2.2.0' if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('2.3.0')
2139
elsif Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2.0')
40+
# rubocop 0.58 throws when testing against ruby 2.1, so pin to the latest version that works
2241
gem 'rubocop', '0.57.2'
23-
# the last version of parallel to support ruby 2.1
24-
gem 'parallel', '1.13.0'
2542
gem 'rubocop-rspec'
2643
else
27-
# the rake everyone else should be using
28-
gem 'rake', '~> 12.3'
2944
# 2.1-compatible analysis was dropped after version 0.58
3045
# This needs to be removed once we drop puppet4 support.
3146
gem 'rubocop', '~> 0.57.0'
3247
gem 'rubocop-rspec'
33-
# license_finder does not install on windows using older versions of rubygems.
34-
# ruby 2.4 is confirmed working on appveyor.
35-
gem 'license_finder' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4.0')
3648
end
37-
gem 'simplecov-console'
38-
# the test gems required for module testing
39-
gem 'puppetlabs_spec_helper', '~> 2.7'
40-
gem 'rspec-puppet'
4149

42-
gem 'CFPropertyList'
50+
# JRuby 1.7 does not like json 2.3.0, jruby 9.1.9.0 has RUBY_VERSION == '2.3.3'
51+
gem 'json', '2.2.0' if RUBY_PLATFORM == 'java' && Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('2.3.0')
52+
# the last version of parallel to support ruby 2.1
53+
gem 'parallel', '1.13.0' if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('2.2.0')
54+
55+
# license_finder does not install on windows using older versions of rubygems.
56+
# ruby 2.4 is confirmed working on appveyor and we only need to run it on the newest gemset anyways
57+
gem 'license_finder' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4.0')
4358
end
4459

4560
group :development do

0 commit comments

Comments
 (0)