diff --git a/config_defaults.yml b/config_defaults.yml index be0bd1fa..f7ac8fac 100644 --- a/config_defaults.yml +++ b/config_defaults.yml @@ -34,13 +34,18 @@ Gemfile: - gem: puppet-lint-variable_contains_upcase - gem: metadata-json-lint - gem: puppet-blacksmith - git: https://github.com/voxpupuli/puppet-blacksmith.git - gem: voxpupuli-release git: https://github.com/voxpupuli/voxpupuli-release-gem.git - gem: puppet-strings git: https://github.com/puppetlabs/puppetlabs-strings.git - gem: rubocop-rspec version: '~> 1.5' + ruby-operator: '>=' + ruby-version: '2.0.0' + - gem: json_pure + version: '<= 2.0.1' + ruby-operator: '<' + ruby-version: '2.0.0' ':development': - gem: travis - gem: travis-lint diff --git a/moduleroot/Gemfile b/moduleroot/Gemfile index f158b60c..ddcb81fe 100644 --- a/moduleroot/Gemfile +++ b/moduleroot/Gemfile @@ -20,13 +20,15 @@ group <%= group %> do <% maxlen = gems.map! do |gem| -%> <% gem['platforms'].map!{|a| a.to_sym} unless gem['platforms'].nil? -%> <% { -%> -<% 'gem' => gem['gem'], -%> -<% 'version' => gem['version'], -%> -<% 'platforms' => gem['platforms'], -%> -<% 'require' => gem['require'], -%> -<% 'git' => gem['git'], -%> -<% 'branch' => gem['branch'], -%> -<% 'length' => gem['gem'].length + (("', '".length if gem['version']) || 0) + gem['version'].to_s.length -%> +<% 'gem' => gem['gem'], -%> +<% 'version' => gem['version'], -%> +<% 'platforms' => gem['platforms'], -%> +<% 'require' => gem['require'], -%> +<% 'git' => gem['git'], -%> +<% 'branch' => gem['branch'], -%> +<% 'ruby-version' => gem['ruby-version'], -%> +<% 'ruby-operator' => gem['ruby-operator'], -%> +<% 'length' => gem['gem'].length + (("', '".length if gem['version']) || 0) + gem['version'].to_s.length -%> <% } -%> <% end.map do |gem| -%> <% gem['length'] -%> @@ -42,7 +44,7 @@ group <%= group %> do 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'] %><%= ", :platforms => #{gem['platforms']}" if gem['platforms'] %> + 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'] %><%= ", :platforms => #{gem['platforms']}" if gem['platforms'] %><%= " if RUBY_VERSION #{gem['ruby-operator']} #{gem['ruby-version']}" if (gem['ruby-operator'] && gem['ruby-version']) %> <% end -%> <% end -%> end diff --git a/moduleroot/Rakefile b/moduleroot/Rakefile index 979cb8ae..40bb83f9 100644 --- a/moduleroot/Rakefile +++ b/moduleroot/Rakefile @@ -1,12 +1,15 @@ require 'puppetlabs_spec_helper/rake_tasks' require 'puppet_blacksmith/rake_tasks' require 'voxpupuli/release/rake_tasks' -require 'rubocop/rake_task' require 'puppet-strings/rake_tasks' -RuboCop::RakeTask.new(:rubocop) do |task| - # These make the rubocop experience maybe slightly less terrible - task.options = ['-D', '-S', '-E'] +if RUBY_VERSION >= '2.0.0' + require 'rubocop/rake_task' + + RuboCop::RakeTask.new(:rubocop) do |task| + # These make the rubocop experience maybe slightly less terrible + task.options = ['-D', '-S', '-E'] + end end PuppetLint.configuration.log_format = '%{path}:%{linenumber}:%{check}:%{KIND}:%{message}'