From f0f6b53a633b77b8d7efbae3ca4fa507ee734a94 Mon Sep 17 00:00:00 2001 From: Andy Duong Date: Wed, 15 Feb 2023 17:54:07 +0700 Subject: [PATCH] [gh383] Fix rubocop --- .template/addons/phrase_app/spec/codebase/codebase_spec.rb | 2 +- spec/codebase/codebase_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.template/addons/phrase_app/spec/codebase/codebase_spec.rb b/.template/addons/phrase_app/spec/codebase/codebase_spec.rb index e463639d..59b267fc 100644 --- a/.template/addons/phrase_app/spec/codebase/codebase_spec.rb +++ b/.template/addons/phrase_app/spec/codebase/codebase_spec.rb @@ -5,7 +5,7 @@ # rubocop:disable RSpec/ExampleLength it 'does not offend PhraseApp Pull configuration' do - locale_tags = Dir[File.expand_path(Rails.root.join('config', 'locales', '*.yml'))] + locale_tags = Dir[Rails.root.expand_path('config', 'locales', '*.yml')] .map { |path| path.split('/').last } # ["campaign.en.yml", "article.en.yml", "campaign.th.yml"] .map { |path| path.split('.').first } # ["campaign", "article", "campaign"] .uniq # ["campaign", "article"] diff --git a/spec/codebase/codebase_spec.rb b/spec/codebase/codebase_spec.rb index fc457818..eea7d3a0 100644 --- a/spec/codebase/codebase_spec.rb +++ b/spec/codebase/codebase_spec.rb @@ -16,7 +16,7 @@ end it 'does not offend engine prefix name' do - engine_paths = Dir[File.expand_path(Rails.root.join('engines', '*'))] + engine_paths = Dir[Rails.root.expand_path('engines', '*')] .select { |f| File.directory? f } .map { |path| path.split('/').last } invalid_engine_paths = engine_paths.reject { |path| path.start_with?('APP_NAME_HERE_') }