diff --git a/Appraisals b/Appraisals index d14caa7..3356f9a 100644 --- a/Appraisals +++ b/Appraisals @@ -1,13 +1,17 @@ -appraise 'rubocop-0.41' do - gem 'rubocop', '~> 0.41.0' +appraise 'rubocop-1.0' do + gem 'rubocop', '~> 1.0.0' end -appraise 'rubocop-0.42' do - gem 'rubocop', '~> 0.42.0' +appraise 'rubocop-1.1' do + gem 'rubocop', '~> 1.1.0' end -appraise 'rubocop-0.43' do - gem 'rubocop', '~> 0.43.0' +appraise 'rubocop-1.2' do + gem 'rubocop', '~> 1.2.0' +end + +appraise 'rubocop-1.3' do + gem 'rubocop', '~> 1.2.0' end appraise 'latest-rubocop' do diff --git a/bin/appraisal b/bin/appraisal new file mode 100755 index 0000000..0e7ba65 --- /dev/null +++ b/bin/appraisal @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'appraisal' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("appraisal", "appraisal") diff --git a/gemfiles/.bundle/config b/gemfiles/.bundle/config index 9c61b5c..891c1ef 100644 --- a/gemfiles/.bundle/config +++ b/gemfiles/.bundle/config @@ -1,2 +1,3 @@ --- BUNDLE_DISABLE_SHARED_GEMS: "true" +BUNDLE_RETRY: "1" diff --git a/gemfiles/latest_rubocop.gemfile b/gemfiles/latest_rubocop.gemfile index b996387..02e3c70 100644 --- a/gemfiles/latest_rubocop.gemfile +++ b/gemfiles/latest_rubocop.gemfile @@ -4,4 +4,4 @@ source "https://rubygems.org" gem "rubocop" -gemspec :path => "../" +gemspec path: "../" diff --git a/gemfiles/rubocop_0.41.gemfile b/gemfiles/rubocop_1.0.gemfile similarity index 59% rename from gemfiles/rubocop_0.41.gemfile rename to gemfiles/rubocop_1.0.gemfile index 53a3500..9329801 100644 --- a/gemfiles/rubocop_0.41.gemfile +++ b/gemfiles/rubocop_1.0.gemfile @@ -2,6 +2,6 @@ source "https://rubygems.org" -gem "rubocop", "~> 0.41.0" +gem "rubocop", "~> 1.0.0" -gemspec :path => "../" +gemspec path: "../" diff --git a/gemfiles/rubocop_0.42.gemfile b/gemfiles/rubocop_1.1.gemfile similarity index 59% rename from gemfiles/rubocop_0.42.gemfile rename to gemfiles/rubocop_1.1.gemfile index d3dec7d..dff68b2 100644 --- a/gemfiles/rubocop_0.42.gemfile +++ b/gemfiles/rubocop_1.1.gemfile @@ -2,6 +2,6 @@ source "https://rubygems.org" -gem "rubocop", "~> 0.42.0" +gem "rubocop", "~> 1.1.0" -gemspec :path => "../" +gemspec path: "../" diff --git a/gemfiles/rubocop_0.43.gemfile b/gemfiles/rubocop_1.2.gemfile similarity index 59% rename from gemfiles/rubocop_0.43.gemfile rename to gemfiles/rubocop_1.2.gemfile index 7f72ce4..094927a 100644 --- a/gemfiles/rubocop_0.43.gemfile +++ b/gemfiles/rubocop_1.2.gemfile @@ -2,6 +2,6 @@ source "https://rubygems.org" -gem "rubocop", "~> 0.43.0" +gem "rubocop", "~> 1.2.0" -gemspec :path => "../" +gemspec path: "../" diff --git a/gemfiles/rubocop_1.3.gemfile b/gemfiles/rubocop_1.3.gemfile new file mode 100644 index 0000000..094927a --- /dev/null +++ b/gemfiles/rubocop_1.3.gemfile @@ -0,0 +1,7 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rubocop", "~> 1.2.0" + +gemspec path: "../" diff --git a/lib/rubocop/cop/migrations/remove_index.rb b/lib/rubocop/cop/migrations/remove_index.rb index 84d54d0..58443c0 100644 --- a/lib/rubocop/cop/migrations/remove_index.rb +++ b/lib/rubocop/cop/migrations/remove_index.rb @@ -19,7 +19,7 @@ def on_send(node) node.each_ancestor do |a| next unless a.def_type? if a.to_s =~ /def :up/ || a.to_s =~ /def :change/ - add_offense(node, :selector, MSG) + add_offense(node, location: :selector, message: MSG) end end end diff --git a/rubocop-migrations.gemspec b/rubocop-migrations.gemspec index 21449cf..801d8d9 100644 --- a/rubocop-migrations.gemspec +++ b/rubocop-migrations.gemspec @@ -20,10 +20,10 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.add_runtime_dependency 'rubocop', '~> 0.41' + spec.add_runtime_dependency 'rubocop', '~> 1.0' - spec.add_development_dependency 'bundler', '~> 1.11' + spec.add_development_dependency 'bundler', '~> 2.1.4' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rspec', '~> 3.5' - spec.add_development_dependency 'appraisal' + spec.add_development_dependency 'appraisal', '~> 2.3.0' end diff --git a/spec/support/shared_examples.rb b/spec/support/shared_examples.rb index 6f534c1..7f2fe42 100644 --- a/spec/support/shared_examples.rb +++ b/spec/support/shared_examples.rb @@ -21,12 +21,12 @@ module SharedExamples end def expect_no_offenses(cop, source) - inspect_source(cop, source) + inspect_source(source) expect(cop.offenses).to be_empty end def expect_reported_offenses(cop, source, expected_offenses) - inspect_source(cop, source) + inspect_source(source) expect(cop.offenses.size).to eq(expected_offenses.size) expected_offenses.zip(cop.offenses).each do |expected, actual| expect_offense(expected, actual)