annotate modules/sshkeys_core/Gemfile @ 471:65290cb0cec2

Tidy up SSH firewall handling We can be generic while referencing private values for specific ports
author IBBoard <dev@ibboard.co.uk>
date Sun, 12 May 2024 19:51:53 +0100
parents 750d36241580
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
388
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 source ENV['GEM_SOURCE'] || 'https://rubygems.org'
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 def location_for(place_or_version, fake_version = nil)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4 git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 file_url_regex = %r{\Afile:\/\/(?<path>.*)}
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 if place_or_version && (git_url = place_or_version.match(git_url_regex))
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 elsif place_or_version && (file_url = place_or_version.match(file_url_regex))
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 ['>= 0', { path: File.expand_path(file_url[:path]), require: false }]
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 else
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 [place_or_version, { require: false }]
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 end
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 end
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 minor_version = ruby_version_segments[0..1].join('.')
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 group :development do
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21 gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
22 gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23 gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
24 gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25 gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
26 gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
27 gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
28 gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
29 gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
30 gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
31 gem "puppet-strings", require: false
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
32 gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33 end
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
34 group :system_tests do
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
35 gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
36 gem "puppet-module-win-system-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
37 gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 3.13')
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
38 gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
39 gem "beaker-pe", require: false
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
40 gem "beaker-hostgenerator"
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
41 gem "beaker-rspec"
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
42 end
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
43
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
44 puppet_version = ENV['PUPPET_GEM_VERSION']
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
45 facter_version = ENV['FACTER_GEM_VERSION']
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
46 hiera_version = ENV['HIERA_GEM_VERSION']
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
47
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
48 gems = {}
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
49
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
50 gems['puppet'] = location_for(puppet_version)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
51
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
52 # If facter or hiera versions have been specified via the environment
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
53 # variables
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
54
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
55 gems['facter'] = location_for(facter_version) if facter_version
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
56 gems['hiera'] = location_for(hiera_version) if hiera_version
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
57
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
58 if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
59 # If we're using a Puppet gem on Windows which handles its own win32-xxx gem
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
60 # dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
61 gems['win32-dir'] = ['<= 0.4.9', require: false]
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
62 gems['win32-eventlog'] = ['<= 0.6.5', require: false]
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
63 gems['win32-process'] = ['<= 0.7.5', require: false]
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
64 gems['win32-security'] = ['<= 0.2.5', require: false]
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
65 gems['win32-service'] = ['0.8.8', require: false]
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
66 end
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
67
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
68 gems.each do |gem_name, gem_params|
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
69 gem gem_name, *gem_params
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
70 end
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
71
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
72 # Evaluate Gemfile.local and ~/.gemfile if they exist
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
73 extra_gemfiles = [
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
74 "#{__FILE__}.local",
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
75 File.join(Dir.home, '.gemfile'),
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
76 ]
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
77
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
78 extra_gemfiles.each do |gemfile|
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
79 if File.file?(gemfile) && File.readable?(gemfile)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
80 eval(File.read(gemfile), binding)
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
81 end
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
82 end
750d36241580 Add missing dependency modules
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
83 # vim: syntax=ruby