5dfff2dbd663201f9a054a190da28059c44a7300
[mirror/dsa-puppet.git] / 3rdparty / modules / concat / Gemfile
1 #This file is generated by ModuleSync, do not edit.
2
3 source ENV['GEM_SOURCE'] || "https://rubygems.org"
4
5 # Determines what type of gem is requested based on place_or_version.
6 def gem_type(place_or_version)
7   if place_or_version =~ /^git:/
8     :git
9   elsif place_or_version =~ /^file:/
10     :file
11   else
12     :gem
13   end
14 end
15
16 # Find a location or specific version for a gem. place_or_version can be a
17 # version, which is most often used. It can also be git, which is specified as
18 # `git://somewhere.git#branch`. You can also use a file source location, which
19 # is specified as `file://some/location/on/disk`.
20 def location_for(place_or_version, fake_version = nil)
21   if place_or_version =~ /^(git[:@][^#]*)#(.*)/
22     [fake_version, { :git => $1, :branch => $2, :require => false }].compact
23   elsif place_or_version =~ /^file:\/\/(.*)/
24     ['>= 0', { :path => File.expand_path($1), :require => false }]
25   else
26     [place_or_version, { :require => false }]
27   end
28 end
29
30 # Used for gem conditionals
31 supports_windows = true
32 ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
33 minor_version = "#{ruby_version_segments[0]}.#{ruby_version_segments[1]}"
34
35 # The following gems are not included by default as they require DevKit on Windows.
36 # You should probably include them in a Gemfile.local or a ~/.gemfile
37 #gem 'pry' #this may already be included in the gemfile
38 #gem 'pry-stack_explorer', :require => false
39 #if RUBY_VERSION =~ /^2/
40 #  gem 'pry-byebug'
41 #else
42 #  gem 'pry-debugger'
43 #end
44
45 group :development do
46   gem "puppet-module-posix-default-r#{minor_version}", :require => false, :platforms => "ruby"
47   gem "puppet-module-win-default-r#{minor_version}",   :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
48   gem "puppet-module-posix-dev-r#{minor_version}",     :require => false, :platforms => "ruby"
49   gem "puppet-module-win-dev-r#{minor_version}",       :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
50   gem "json_pure", '<= 2.0.1',                         :require => false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
51   gem "fast_gettext", '1.1.0',                         :require => false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
52   gem "fast_gettext",                                  :require => false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
53 end
54
55 group :system_tests do
56   gem "puppet-module-posix-system-r#{minor_version}",                            :require => false, :platforms => "ruby"
57   gem "puppet-module-win-system-r#{minor_version}",                              :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
58   gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '>= 3')                  
59   gem "beaker-pe",                                                               :require => false
60   gem "beaker-rspec", *location_for(ENV['BEAKER_RSPEC_VERSION'])                
61   gem "beaker-hostgenerator", *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION'])
62   gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')        
63 end
64
65 gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'])
66
67 # Only explicitly specify Facter/Hiera if a version has been specified.
68 # Otherwise it can lead to strange bundler behavior. If you are seeing weird
69 # gem resolution behavior, try setting `DEBUG_RESOLVER` environment variable
70 # to `1` and then run bundle install.
71 gem 'facter', *location_for(ENV['FACTER_GEM_VERSION']) if ENV['FACTER_GEM_VERSION']
72 gem 'hiera', *location_for(ENV['HIERA_GEM_VERSION']) if ENV['HIERA_GEM_VERSION']
73
74 # For Windows dependencies, these could be required based on the version of
75 # Puppet you are requiring. Anything greater than v3.5.0 is going to have
76 # Windows-specific dependencies dictated by the gem itself. The other scenario
77 # is when you are faking out Puppet to use a local file path / git path.
78 explicitly_require_windows_gems = false
79 puppet_gem_location = gem_type(ENV['PUPPET_GEM_VERSION'])
80 # This is not a perfect answer to the version check
81 if puppet_gem_location != :gem || (ENV['PUPPET_GEM_VERSION'] && Gem::Version.correct?(ENV['PUPPET_GEM_VERSION']) && Gem::Requirement.new('< 3.5.0').satisfied_by?(Gem::Version.new(ENV['PUPPET_GEM_VERSION'].dup)))
82   if Gem::Platform.local.os == 'mingw32'
83     explicitly_require_windows_gems = true
84   end
85   if puppet_gem_location == :gem
86     # If facterversion hasn't been specified and we are
87     # looking for a Puppet Gem version less than 3.5.0, we
88     # need to ensure we get a good Facter for specs.
89     gem "facter",">= 1.6.11","<= 1.7.5",:require => false unless ENV['FACTER_GEM_VERSION']
90     # If hieraversion hasn't been specified and we are
91     # looking for a Puppet Gem version less than 3.5.0, we
92     # need to ensure we get a good Hiera for specs.
93     gem "hiera",">= 1.0.0","<= 1.3.0",:require => false unless ENV['HIERA_GEM_VERSION']
94   end
95 end
96
97 if explicitly_require_windows_gems
98   # This also means Puppet Gem less than 3.5.0 - this has been tested back
99   # to 3.0.0. Any further back is likely not supported.
100   if puppet_gem_location == :gem
101     gem "ffi", "1.9.0",                          :require => false
102     gem "win32-eventlog", "0.5.3","<= 0.6.5",    :require => false
103     gem "win32-process", "0.6.5","<= 0.7.5",     :require => false
104     gem "win32-security", "~> 0.1.2","<= 0.2.5", :require => false
105     gem "win32-service", "0.7.2","<= 0.8.8",     :require => false
106     gem "minitar", "0.5.4",                      :require => false
107   else
108     gem "ffi", "~> 1.9.0",                       :require => false
109     gem "win32-eventlog", "~> 0.5","<= 0.6.5",   :require => false
110     gem "win32-process", "~> 0.6","<= 0.7.5",    :require => false
111     gem "win32-security", "~> 0.1","<= 0.2.5",   :require => false
112     gem "win32-service", "~> 0.7","<= 0.8.8",    :require => false
113     gem "minitar", "~> 0.5.4",                   :require => false
114   end
115
116   gem "win32-dir", "~> 0.3","<= 0.4.9", :require => false
117   gem "win32console", "1.3.2",          :require => false if RUBY_VERSION =~ /^1\./
118
119   # sys-admin was removed in Puppet 3.7.0+, and doesn't compile
120   # under Ruby 2.3 - so restrict it to Ruby 1.x
121   gem "sys-admin", "1.5.6",             :require => false if RUBY_VERSION =~ /^1\./
122
123   # Puppet less than 3.7.0 requires these.
124   # Puppet 3.5.0+ will control the actual requirements.
125   # These are listed in formats that work with all versions of
126   # Puppet from 3.0.0 to 3.6.x. After that, these were no longer used.
127   # We do not want to allow newer versions than what came out after
128   # 3.6.x to be used as they constitute some risk in breaking older
129   # functionality. So we set these to exact versions.
130   gem "win32-api", "1.4.8",             :require => false
131   gem "win32-taskscheduler", "0.2.2",   :require => false
132   gem "windows-api", "0.4.3",           :require => false
133   gem "windows-pr",  "1.2.3",           :require => false
134 else
135   if Gem::Platform.local.os == 'mingw32'
136     # If we're using a Puppet gem on windows, which handles its own win32-xxx gem dependencies (Pup 3.5.0 and above), set maximum versions
137     # Required due to PUP-6445
138     gem "win32-dir", "<= 0.4.9",        :require => false
139     gem "win32-eventlog", "<= 0.6.5",   :require => false
140     gem "win32-process", "<= 0.7.5",    :require => false
141     gem "win32-security", "<= 0.2.5",   :require => false
142     gem "win32-service", "<= 0.8.8",    :require => false
143   end
144 end
145
146 # Evaluate Gemfile.local if it exists
147 if File.exists? "#{__FILE__}.local"
148   eval(File.read("#{__FILE__}.local"), binding)
149 end
150
151 # Evaluate ~/.gemfile if it exists
152 if File.exists?(File.join(Dir.home, '.gemfile'))
153   eval(File.read(File.join(Dir.home, '.gemfile')), binding)
154 end
155
156 # vim:ft=ruby