diff --git a/Gemfile b/Gemfile index 2ea2f6f..06f6b81 100644 --- a/Gemfile +++ b/Gemfile @@ -11,7 +11,7 @@ group :development, :test do gem "byebug", "~> 10.0.0", platforms: %i[mri mingw x64_mingw] gem "kaminari", "~> 1.1.1" gem "puma", "~> 3.11.2" - gem "rubocop", "~> 0.52.1", require: false + gem "rubocop", "~> 0.55.0", require: false gem "sqlite3", "~> 1.3.13" end diff --git a/comfy_blog.gemspec b/comfy_blog.gemspec index 15d624b..05fad3a 100644 --- a/comfy_blog.gemspec +++ b/comfy_blog.gemspec @@ -1,6 +1,6 @@ # frozen_string_literal: true -$LOAD_PATH.push File.expand_path("../lib", __FILE__) +$LOAD_PATH.push File.expand_path("lib", __dir__) require "comfy_blog/version" diff --git a/config/boot.rb b/config/boot.rb index 64124af..1c1a70f 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Set up gems listed in the Gemfile. -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__) +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"]) File.exist?(ENV["BUNDLE_GEMFILE"]) diff --git a/config/environment.rb b/config/environment.rb index 83f7a99..ae94282 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Load the rails application -require File.expand_path("../application", __FILE__) +require File.expand_path("application", __dir__) # Initialize the rails application ComfyBlog::Application.initialize! diff --git a/lib/generators/comfy/blog/blog_generator.rb b/lib/generators/comfy/blog/blog_generator.rb index 692f7af..b5f1a89 100644 --- a/lib/generators/comfy/blog/blog_generator.rb +++ b/lib/generators/comfy/blog/blog_generator.rb @@ -9,7 +9,7 @@ class BlogGenerator < Rails::Generators::Base include Rails::Generators::Migration include Thor::Actions - source_root File.expand_path("../../../../..", __FILE__) + source_root File.expand_path("../../../..", __dir__) def self.next_migration_number(dirname) ActiveRecord::Generators::Base.next_migration_number(dirname) diff --git a/test/gemfiles/5.2.gemfile b/test/gemfiles/5.2.gemfile index caa276d..e784560 100644 --- a/test/gemfiles/5.2.gemfile +++ b/test/gemfiles/5.2.gemfile @@ -1,4 +1,6 @@ -source 'http://rubygems.org' +# frozen_string_literal: true + +source "http://rubygems.org" gemspec path: "../../" @@ -9,7 +11,7 @@ group :development, :test do gem "byebug", "~> 10.0.0", platforms: %i[mri mingw x64_mingw] gem "kaminari", "~> 1.1.1" gem "puma", "~> 3.11.2" - gem "rubocop", "~> 0.52.1", require: false + gem "rubocop", "~> 0.55.0", require: false gem "sqlite3", "~> 1.3.13" end diff --git a/test/integration/i18n_test.rb b/test/integration/i18n_test.rb index fa48b2d..d230827 100644 --- a/test/integration/i18n_test.rb +++ b/test/integration/i18n_test.rb @@ -4,16 +4,16 @@ class I18nIntegrationTest < ActionDispatch::IntegrationTest - def collect_combined_keys(hash, ns = nil) + def collect_combined_keys(hash, namespace = nil) hash.collect do |k, v| keys = [] - keys << collect_combined_keys(v, "#{ns}.#{k}") if v.is_a?(Hash) - keys << "#{ns}.#{k}" + keys << collect_combined_keys(v, "#{namespace}.#{k}") if v.is_a?(Hash) + keys << "#{namespace}.#{k}" end.flatten end def test_translations - locales_path = File.expand_path("../../../config/locales", __FILE__) + locales_path = File.expand_path("../../config/locales", __dir__) locales = Dir.glob("#{locales_path}/*.yml").collect do |file_path| File.basename(file_path, ".yml") end