Skip to content

Commit

Permalink
[CLEANUP] Use module_function to create module functions
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverklee committed Oct 6, 2023
1 parent 3598ddf commit d574d1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 35 deletions.
36 changes: 2 additions & 34 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:01:33 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 Down Expand Up @@ -53,23 +37,7 @@ 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:
- 'Rakefile'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, Autocorrect.
# SupportedStyles: module_function, extend_self, forbidden
Style/ModuleFunction:
Exclude:
- 'lib/page_title_helper.rb'
2 changes: 1 addition & 1 deletion lib/page_title_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
module PageTitleHelper
# https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/interpolations.rb
module Interpolations
extend self
module_function

def self.interpolate(pattern, *args)
instance_methods(false).sort.reverse.inject(pattern.to_s.dup) do |result, tag|
Expand Down

0 comments on commit d574d1d

Please sign in to comment.