diff --git a/.rubocop.yml b/.rubocop.yml index 1fb18275..50e86afa 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -24,6 +24,9 @@ AllCops: Naming/AccessorMethodName: Enabled: false +Naming/UncommunicativeMethodParamName: + Enabled: false + Style/TrivialAccessors: Enabled: false diff --git a/lib/generators/logidze/install/install_generator.rb b/lib/generators/logidze/install/install_generator.rb index a823ce31..321e9ff0 100644 --- a/lib/generators/logidze/install/install_generator.rb +++ b/lib/generators/logidze/install/install_generator.rb @@ -7,7 +7,7 @@ module Generators class InstallGenerator < ::Rails::Generators::Base # :nodoc: include Rails::Generators::Migration - source_root File.expand_path('../templates', __FILE__) + source_root File.expand_path('templates', __dir__) class_option :update, type: :boolean, optional: true, desc: "Define whether this is an update migration" diff --git a/lib/generators/logidze/model/model_generator.rb b/lib/generators/logidze/model/model_generator.rb index 58564b3f..b4085c3f 100644 --- a/lib/generators/logidze/model/model_generator.rb +++ b/lib/generators/logidze/model/model_generator.rb @@ -6,7 +6,7 @@ module Logidze module Generators class ModelGenerator < ::ActiveRecord::Generators::Base # :nodoc: - source_root File.expand_path('../templates', __FILE__) + source_root File.expand_path('templates', __dir__) class_option :limit, type: :numeric, optional: true, desc: "Specify history size limit" diff --git a/spec/generators/install_generator_spec.rb b/spec/generators/install_generator_spec.rb index 342d82f0..e7b6561b 100644 --- a/spec/generators/install_generator_spec.rb +++ b/spec/generators/install_generator_spec.rb @@ -3,7 +3,7 @@ require 'generators/logidze/install/install_generator' describe Logidze::Generators::InstallGenerator, type: :generator do - destination File.expand_path("../../../tmp", __FILE__) + destination File.expand_path('../../tmp', __dir__) let(:args) { [] } diff --git a/spec/generators/model_generator_spec.rb b/spec/generators/model_generator_spec.rb index 48ba0e64..945caf38 100644 --- a/spec/generators/model_generator_spec.rb +++ b/spec/generators/model_generator_spec.rb @@ -3,7 +3,7 @@ require 'generators/logidze/model/model_generator' describe Logidze::Generators::ModelGenerator, type: :generator do - destination File.expand_path("../../../tmp", __FILE__) + destination File.expand_path('../../tmp', __dir__) before do prepare_destination diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7a6c0065..3ee24010 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,7 +13,7 @@ SimpleCov.start end -require File.expand_path("../dummy/config/environment", __FILE__) +require File.expand_path('dummy/config/environment', __dir__) Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }