From 92ac626eedc53646e7295bfd786255049fc12ec5 Mon Sep 17 00:00:00 2001 From: Jacky Leung Date: Fri, 29 Jul 2016 23:27:58 +1200 Subject: [PATCH 1/3] Fix: Pin Rubocop version to 2.0.0+ --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 90188fee6..323024a9e 100644 --- a/Gemfile +++ b/Gemfile @@ -26,7 +26,7 @@ group :test do gem 'puppet-blacksmith', :require => false, :git => 'https://github.com/voxpupuli/puppet-blacksmith.git' gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem.git' gem 'puppet-strings', :require => false, :git => 'https://github.com/puppetlabs/puppetlabs-strings.git' - gem 'rubocop-rspec', '~> 1.5', :require => false + gem 'rubocop-rspec', '~> 1.5', :require => false if RUBY_VERSION >= '2.0.0' end group :development do From 7e2e6344372cd7e79541194d994af494146a6a1b Mon Sep 17 00:00:00 2001 From: Jacky Leung Date: Fri, 29 Jul 2016 23:40:01 +1200 Subject: [PATCH 2/3] Pin: json_pure version for 1.9.3 compatibility --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index 323024a9e..aef7a80b8 100644 --- a/Gemfile +++ b/Gemfile @@ -26,6 +26,7 @@ group :test do gem 'puppet-blacksmith', :require => false, :git => 'https://github.com/voxpupuli/puppet-blacksmith.git' gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem.git' gem 'puppet-strings', :require => false, :git => 'https://github.com/puppetlabs/puppetlabs-strings.git' + gem 'json_pure', '<= 2.0.1', :require => false gem 'rubocop-rspec', '~> 1.5', :require => false if RUBY_VERSION >= '2.0.0' end From b25357f80ee393844155082fff2c1fdcea91b547 Mon Sep 17 00:00:00 2001 From: Jacky Leung Date: Fri, 29 Jul 2016 23:46:37 +1200 Subject: [PATCH 3/3] Update: pin json_pure for ruby < 2.0.0 and only enable Rubocop for >= 2.0.0 in Rakefile --- Gemfile | 2 +- Rakefile | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index aef7a80b8..5e7701248 100644 --- a/Gemfile +++ b/Gemfile @@ -26,7 +26,7 @@ group :test do gem 'puppet-blacksmith', :require => false, :git => 'https://github.com/voxpupuli/puppet-blacksmith.git' gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem.git' gem 'puppet-strings', :require => false, :git => 'https://github.com/puppetlabs/puppetlabs-strings.git' - gem 'json_pure', '<= 2.0.1', :require => false + gem 'json_pure', '<= 2.0.1', :require => false if RUBY_VERSION < '2.0.0' gem 'rubocop-rspec', '~> 1.5', :require => false if RUBY_VERSION >= '2.0.0' end diff --git a/Rakefile b/Rakefile index 56ffc74ac..f741443d4 100644 --- a/Rakefile +++ b/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}'