|
2 | 2 |
|
3 | 3 | source ENV['GEM_SOURCE'] || 'https://rubygems.org' |
4 | 4 |
|
5 | | -def location_for(place_or_version, fake_version = nil) |
6 | | - git_url_regex = %r{\A(?<url>(?:https?|git)[:@][^#]*)(?:#(?<branch>.*))?} |
7 | | - file_url_regex = %r{\Afile://(?<path>.*)} |
8 | | - |
9 | | - if place_or_version && (git_url = place_or_version.match(git_url_regex)) |
10 | | - [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact |
11 | | - elsif place_or_version && (file_url = place_or_version.match(file_url_regex)) |
12 | | - ['>= 0', { path: File.expand_path(file_url[:path]), require: false }] |
13 | | - else |
14 | | - [place_or_version, { require: false }] |
15 | | - end |
16 | | -end |
17 | | - |
18 | | -# Specify the global dependencies in puppetlabs_spec_helper.gemspec |
19 | | -# Note that only ruby 1.9 compatible dependencies may go there, everything else needs to be documented and pulled in manually, and optionally by everyone who wants to use the extended features. |
20 | 5 | gemspec |
21 | 6 |
|
22 | | -def infer_puppet_version |
23 | | - # Infer the Puppet Gem version based on the Ruby Version |
24 | | - ruby_ver = Gem::Version.new(RUBY_VERSION.dup) |
25 | | - return '~> 7.0' if ruby_ver >= Gem::Version.new('2.7.0') |
26 | | - return '~> 6.0' if ruby_ver >= Gem::Version.new('2.5.0') |
27 | | - '~> 5.0' |
| 7 | +if ENV['PUPPET_GEM_VERSION'] |
| 8 | + gem 'puppet', ENV['PUPPET_GEM_VERSION'], :require => false |
| 9 | +else |
| 10 | + gem 'puppet', :require => false |
28 | 11 | end |
29 | 12 |
|
30 | 13 | group :development do |
31 | 14 | gem 'codecov' |
32 | | - gem 'github_changelog_generator' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.0') |
33 | | - gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'] || ENV['PUPPET_VERSION'] || infer_puppet_version) |
34 | | - gem 'simplecov', '~> 0' |
| 15 | + gem 'simplecov' |
35 | 16 | gem 'simplecov-console' |
36 | | - if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.4') |
37 | | - gem 'rubocop', '0.57.2' |
38 | | - gem 'rubocop-rspec' |
39 | | - end |
| 17 | + |
| 18 | + gem 'pry', require: false |
| 19 | + gem 'pry-byebug', require: false |
| 20 | + gem 'pry-stack_explorer', require: false |
| 21 | + |
| 22 | + gem 'rake' |
| 23 | + gem 'rspec', '~> 3.1' |
| 24 | + gem 'rspec-its', '~> 1.0' |
| 25 | + gem 'rubocop', '~> 1.6.1', require: false |
| 26 | + gem 'rubocop-rspec', '~> 2.0.1', require: false |
| 27 | + gem 'rubocop-performance', '~> 1.9.1', require: false |
| 28 | + |
| 29 | + gem 'fakefs' |
| 30 | + gem 'yard' |
40 | 31 | end |
41 | 32 |
|
42 | | -# vim:filetype=ruby |
| 33 | + |
| 34 | +# Evaluate Gemfile.local if it exists |
| 35 | +if File.exists? "#{__FILE__}.local" |
| 36 | + eval(File.read("#{__FILE__}.local"), binding) |
| 37 | +end |
| 38 | + |
| 39 | +# Evaluate ~/.gemfile if it exists |
| 40 | +if File.exists?(File.join(Dir.home, '.gemfile')) |
| 41 | + eval(File.read(File.join(Dir.home, '.gemfile')), binding) |
| 42 | +end |
0 commit comments