Skip to content

Commit

Permalink
[CLEANUP] Use a shorter notation for getting the Rails root basename
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverklee committed Oct 6, 2023
1 parent 3598ddf commit 3efdb41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 33 deletions.
34 changes: 2 additions & 32 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
# This configuration was generated by
# `rubocop --auto-gen-config --exclude-limit 10000`
# on 2023-10-05 13:54:27 UTC using RuboCop version 1.56.4.
# `rubocop --auto-gen-config`
# on 2023-10-06 15:04:01 UTC using RuboCop version 1.56.4.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/DeprecatedAttributeAssignment:
Exclude:
- 'page_title_helper.gemspec'

# Offense count: 5
# Configuration parameters: EnforcedStyle, AllowedGems, Include.
# SupportedStyles: Gemfile, gems.rb, gemspec
# Include: **/*.gemspec, **/Gemfile, **/gems.rb
Gemspec/DevelopmentDependencies:
Exclude:
- 'page_title_helper.gemspec'

# Offense count: 1
# Configuration parameters: AllowedParentClasses.
Lint/MissingSuper:
Expand All @@ -47,20 +31,6 @@ Naming/MemoizedInstanceVariableName:
Exclude:
- 'test/test_helper.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/RootPathnameMethods:
Exclude:
- 'lib/page_title_helper.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Exclude:
- 'page_title_helper.gemspec'

# Offense count: 1
Style/MixinUsage:
Exclude:
Expand Down
2 changes: 1 addition & 1 deletion lib/page_title_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def self.interpolate(pattern, *args)
end

def app(env)
env[:app] || I18n.t('app.name', default: File.basename(Rails.root).humanize)
env[:app] || I18n.t('app.name', default: Rails.root.basename.humanize)
end

def title(env)
Expand Down

0 comments on commit 3efdb41

Please sign in to comment.