diff --git a/Gemfile.lock b/Gemfile.lock index f893412..2a1c958 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -25,7 +25,7 @@ GEM method_source (0.9.0) minitest (5.11.3) parallel (1.12.1) - parser (2.5.0.2) + parser (2.5.0.3) ast (~> 2.4.0) powerpack (0.1.1) pry (0.11.3) @@ -46,15 +46,15 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.7.0) rspec-support (3.7.1) - rubocop (0.52.1) + rubocop (0.53.0) parallel (~> 1.10) - parser (>= 2.4.0.2, < 3.0) + parser (>= 2.5) powerpack (~> 0.1) rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) - rubocop-rspec (1.23.0) - rubocop (>= 0.52.1) + rubocop-rspec (1.24.0) + rubocop (>= 0.53.0) ruby-progressbar (1.9.0) thor (0.20.0) thread_safe (0.3.6) diff --git a/enumerate_it.gemspec b/enumerate_it.gemspec index f4ba9b2..3c90d5e 100644 --- a/enumerate_it.gemspec +++ b/enumerate_it.gemspec @@ -1,4 +1,4 @@ -require File.expand_path('../lib/enumerate_it/version', __FILE__) +require File.expand_path('lib/enumerate_it/version', __dir__) Gem::Specification.new do |gem| gem.authors = ['Cássio Marques', 'Lucas Caton'] diff --git a/gemfiles/rails_3.0.gemfile b/gemfiles/rails_3.0.gemfile index cc01ba6..effab6a 100644 --- a/gemfiles/rails_3.0.gemfile +++ b/gemfiles/rails_3.0.gemfile @@ -1,8 +1,8 @@ # This file was generated by Appraisal -source "https://rubygems.org" +source 'https://rubygems.org' -gem "activesupport", "~> 3.0.20" -gem "activerecord", "~> 3.0.20" +gem 'activerecord', '~> 3.0.20' +gem 'activesupport', '~> 3.0.20' -gemspec path: "../" +gemspec path: '../' diff --git a/gemfiles/rails_3.1.gemfile b/gemfiles/rails_3.1.gemfile index 7630ef4..fd7a746 100644 --- a/gemfiles/rails_3.1.gemfile +++ b/gemfiles/rails_3.1.gemfile @@ -1,8 +1,8 @@ # This file was generated by Appraisal -source "https://rubygems.org" +source 'https://rubygems.org' -gem "activesupport", "~> 3.1.12" -gem "activerecord", "~> 3.1.12" +gem 'activerecord', '~> 3.1.12' +gem 'activesupport', '~> 3.1.12' -gemspec path: "../" +gemspec path: '../' diff --git a/gemfiles/rails_3.2.gemfile b/gemfiles/rails_3.2.gemfile index eda22f4..d3e249b 100644 --- a/gemfiles/rails_3.2.gemfile +++ b/gemfiles/rails_3.2.gemfile @@ -1,8 +1,8 @@ # This file was generated by Appraisal -source "https://rubygems.org" +source 'https://rubygems.org' -gem "activesupport", "~> 3.2.22.5" -gem "activerecord", "~> 3.2.22.5" +gem 'activerecord', '~> 3.2.22.5' +gem 'activesupport', '~> 3.2.22.5' -gemspec path: "../" +gemspec path: '../' diff --git a/gemfiles/rails_4.0.gemfile b/gemfiles/rails_4.0.gemfile index 77c40da..9c20e8f 100644 --- a/gemfiles/rails_4.0.gemfile +++ b/gemfiles/rails_4.0.gemfile @@ -1,8 +1,8 @@ # This file was generated by Appraisal -source "https://rubygems.org" +source 'https://rubygems.org' -gem "activesupport", "~> 4.0.13" -gem "activerecord", "~> 4.0.13" +gem 'activerecord', '~> 4.0.13' +gem 'activesupport', '~> 4.0.13' -gemspec path: "../" +gemspec path: '../' diff --git a/gemfiles/rails_4.1.gemfile b/gemfiles/rails_4.1.gemfile index 9a08162..34971e0 100644 --- a/gemfiles/rails_4.1.gemfile +++ b/gemfiles/rails_4.1.gemfile @@ -1,8 +1,8 @@ # This file was generated by Appraisal -source "https://rubygems.org" +source 'https://rubygems.org' -gem "activesupport", "~> 4.1.16" -gem "activerecord", "~> 4.1.16" +gem 'activerecord', '~> 4.1.16' +gem 'activesupport', '~> 4.1.16' -gemspec path: "../" +gemspec path: '../' diff --git a/gemfiles/rails_4.2.gemfile b/gemfiles/rails_4.2.gemfile index 0d52d79..da8f342 100644 --- a/gemfiles/rails_4.2.gemfile +++ b/gemfiles/rails_4.2.gemfile @@ -1,8 +1,8 @@ # This file was generated by Appraisal -source "https://rubygems.org" +source 'https://rubygems.org' -gem "activesupport", "~> 4.2.10" -gem "activerecord", "~> 4.2.10" +gem 'activerecord', '~> 4.2.10' +gem 'activesupport', '~> 4.2.10' -gemspec path: "../" +gemspec path: '../' diff --git a/gemfiles/rails_5.0.gemfile b/gemfiles/rails_5.0.gemfile index 50f4038..1fee370 100644 --- a/gemfiles/rails_5.0.gemfile +++ b/gemfiles/rails_5.0.gemfile @@ -1,8 +1,8 @@ # This file was generated by Appraisal -source "https://rubygems.org" +source 'https://rubygems.org' -gem "activesupport", "~> 5.0.6" -gem "activerecord", "~> 5.0.6" +gem 'activerecord', '~> 5.0.6' +gem 'activesupport', '~> 5.0.6' -gemspec path: "../" +gemspec path: '../' diff --git a/gemfiles/rails_5.1.gemfile b/gemfiles/rails_5.1.gemfile index e9dd3e1..13e5a96 100644 --- a/gemfiles/rails_5.1.gemfile +++ b/gemfiles/rails_5.1.gemfile @@ -1,8 +1,8 @@ # This file was generated by Appraisal -source "https://rubygems.org" +source 'https://rubygems.org' -gem "activesupport", "~> 5.1.5" -gem "activerecord", "~> 5.1.5" +gem 'activerecord', '~> 5.1.5' +gem 'activesupport', '~> 5.1.5' -gemspec path: "../" +gemspec path: '../' diff --git a/lib/generators/enumerate_it/enum/enum_generator.rb b/lib/generators/enumerate_it/enum/enum_generator.rb index 947ea93..67f6910 100644 --- a/lib/generators/enumerate_it/enum/enum_generator.rb +++ b/lib/generators/enumerate_it/enum/enum_generator.rb @@ -1,7 +1,7 @@ module EnumerateIt module Generators class EnumGenerator < Rails::Generators::NamedBase - source_root File.expand_path('../templates', __FILE__) + source_root File.expand_path('templates', __dir__) argument :attributes, type: 'array' diff --git a/spec/enumerate_it/base_spec.rb b/spec/enumerate_it/base_spec.rb index 51f7f1b..624b4a1 100644 --- a/spec/enumerate_it/base_spec.rb +++ b/spec/enumerate_it/base_spec.rb @@ -251,7 +251,7 @@ class ActiveRecordStub attr_accessor :bla class << self - def validates_inclusion_of(_) + def validates_inclusion_of(_attribute) true end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6c2b8b6..75d8b97 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,4 @@ -$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) +$LOAD_PATH.unshift File.expand_path('../lib', __dir__) require 'enumerate_it'