annotate modules/translate/Gemfile @ 333:8d8dd5c4ec0e

Check sender access earlier to allow whitelisting This is important for some hosts who send from a domain that doesn't have DNS, but that we want to allow
author IBBoard <dev@ibboard.co.uk>
date Sun, 15 Mar 2020 16:51:56 +0000
parents b0f8b88fea5c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
245
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 source ENV['GEM_SOURCE'] || 'https://rubygems.org'
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 def location_for(place_or_version, fake_version = nil)
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4 git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 file_url_regex = %r{\Afile:\/\/(?<path>.*)}
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 if place_or_version && (git_url = place_or_version.match(git_url_regex))
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 elsif place_or_version && (file_url = place_or_version.match(file_url_regex))
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 ['>= 0', { path: File.expand_path(file_url[:path]), require: false }]
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 else
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 [place_or_version, { require: false }]
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 end
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 end
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 minor_version = ruby_version_segments[0..1].join('.')
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 group :development do
b0f8b88fea5c Add "translate" module used by MySQL module
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')
b0f8b88fea5c Add "translate" module used by MySQL module
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')
b0f8b88fea5c Add "translate" module used by MySQL module
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')
b0f8b88fea5c Add "translate" module used by MySQL module
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')
b0f8b88fea5c Add "translate" module used by MySQL module
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))
b0f8b88fea5c Add "translate" module used by MySQL module
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))
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
26 gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
27 gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
28 gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
b0f8b88fea5c Add "translate" module used by MySQL module
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]
b0f8b88fea5c Add "translate" module used by MySQL module
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]
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
31 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')
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
32 end
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
34 puppet_version = ENV['PUPPET_GEM_VERSION']
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
35 facter_version = ENV['FACTER_GEM_VERSION']
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
36 hiera_version = ENV['HIERA_GEM_VERSION']
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
37
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
38 gems = {}
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
39
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
40 gems['puppet'] = location_for(puppet_version)
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
41
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
42 # If facter or hiera versions have been specified via the environment
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
43 # variables
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
44
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
45 gems['facter'] = location_for(facter_version) if facter_version
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
46 gems['hiera'] = location_for(hiera_version) if hiera_version
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
47
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
48 if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
49 # If we're using a Puppet gem on Windows which handles its own win32-xxx gem
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
50 # dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
51 gems['win32-dir'] = ['<= 0.4.9', require: false]
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
52 gems['win32-eventlog'] = ['<= 0.6.5', require: false]
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
53 gems['win32-process'] = ['<= 0.7.5', require: false]
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
54 gems['win32-security'] = ['<= 0.2.5', require: false]
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
55 gems['win32-service'] = ['0.8.8', require: false]
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
56 end
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
57
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
58 gems.each do |gem_name, gem_params|
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
59 gem gem_name, *gem_params
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
60 end
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
61
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
62 # Evaluate Gemfile.local and ~/.gemfile if they exist
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
63 extra_gemfiles = [
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
64 "#{__FILE__}.local",
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
65 File.join(Dir.home, '.gemfile'),
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
66 ]
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
67
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
68 extra_gemfiles.each do |gemfile|
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
69 if File.file?(gemfile) && File.readable?(gemfile)
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
70 eval(File.read(gemfile), binding)
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
71 end
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
72 end
b0f8b88fea5c Add "translate" module used by MySQL module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
73 # vim: syntax=ruby