-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from jyaworski/add_extra_gem_capability
Add the capability to add extra gems to the module gemfile
- Loading branch information
Showing
2 changed files
with
88 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,61 @@ | ||
source 'https://rubygems.org' | ||
source ENV['GEM_SOURCE'] || 'https://rubygems.org' | ||
|
||
group :test do | ||
gem 'rake' | ||
gem 'puppet', ENV['PUPPET_VERSION'] || '~> 3.8.0' | ||
gem 'rspec-puppet', git: 'https://github.com/rodjek/rspec-puppet.git' | ||
gem 'rspec-puppet-augeas' | ||
gem 'ruby-augeas' | ||
gem 'puppetlabs_spec_helper' | ||
gem 'metadata-json-lint' | ||
gem 'rspec-puppet-facts' | ||
gem 'rspec' | ||
gem 'puppet-blacksmith' | ||
gem 'rubocop' | ||
gem 'puppet-lint-absolute_classname-check' | ||
gem 'puppet-lint-leading_zero-check' | ||
gem 'puppet-lint-trailing_comma-check' | ||
gem 'puppet-lint-version_comparison-check' | ||
gem 'puppet-lint-classes_and_types_beginning_with_digits-check' | ||
gem 'puppet-lint-unquoted_string-check' | ||
gem 'puppet-lint-variable_contains_upcase' | ||
def location_for(place, fake_version = nil) | ||
if place =~ /^(git[:@][^#]*)#(.*)/ | ||
[fake_version, { :git => $1, :branch => $2, :require => false }].compact | ||
elsif place =~ /^file:\/\/(.*)/ | ||
['>= 0', { :path => File.expand_path($1), :require => false }] | ||
else | ||
[place, { :require => false }] | ||
end | ||
end | ||
|
||
group :development do | ||
gem 'travis' | ||
gem 'travis-lint' | ||
gem 'guard-rake' | ||
<% groups = {} -%> | ||
<% (@configs['required'].keys + ((@configs['optional'] || {}).keys)).uniq.each do |key| -%> | ||
<% groups[key] = (@configs['required'][key] || []) + ((@configs['optional'] || {})[key] || []) -%> | ||
<% end -%> | ||
<% -%> | ||
<% groups.each do |group, gems| -%> | ||
group <%= group %> do | ||
<% maxlen = gems.map! do |gem| -%> | ||
<% { -%> | ||
<% 'gem' => gem['gem'], -%> | ||
<% 'version' => gem['version'], -%> | ||
<% 'git' => gem['git'], -%> | ||
<% 'branch' => gem['branch'], -%> | ||
<% 'length' => gem['gem'].length + (("', '".length if gem['version']) || 0) + gem['version'].to_s.length -%> | ||
<% } -%> | ||
<% end.map do |gem| -%> | ||
<% gem['length'] -%> | ||
<% end.max -%> | ||
<% gems.each do |gem| -%> | ||
<% if gem['gem'] == 'beaker-rspec' -%> | ||
if beaker_version = ENV['BEAKER_VERSION'] | ||
gem 'beaker', *location_for(beaker_version) | ||
end | ||
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION'] | ||
gem 'beaker-rspec', *location_for(beaker_rspec_version) | ||
else | ||
gem 'beaker-rspec', :require => false | ||
end | ||
<% else -%> | ||
gem '<%= gem['gem'] %>'<%= ", '#{gem['version']}'" if gem['version'] %>, <%= ' ' * (maxlen - gem['length']) %> :require => false<%= ", :git => '#{gem['git']}'" if gem['git'] %><%= ", :branch => '#{gem['branch']}'" if gem['branch'] %> | ||
<% end -%> | ||
<% end -%> | ||
end | ||
group :system_tests do | ||
gem 'beaker' | ||
gem 'beaker-rspec' | ||
<% end -%> | ||
if facterversion = ENV['FACTER_GEM_VERSION'] | ||
gem 'facter', facterversion, :require => false | ||
else | ||
gem 'facter', :require => false | ||
end | ||
if puppetversion = ENV['PUPPET_GEM_VERSION'] | ||
gem 'puppet', puppetversion, :require => false | ||
else | ||
gem 'puppet', 3.8.0, :require => false | ||
end | ||
# vim:ft=ruby |