class Git::DeprecationGemName
The gem name handed to ActiveSupport::Deprecation
ActiveSupportās :notify behavior builds its notification name by calling āunderscore` on the gem name. That is a String core extension this gem does not load, because requiring it adds twenty-one methods to String in every process that loads the gem. This subclass answers `underscore` itself, so :notify works and String stays untouched. Everywhere else ActiveSupport interpolates the name or passes it through, where it behaves as āGitā.
@api private
Constants
- Deprecation
-
The deprecation instance used to emit deprecation warnings for the
GitgemActiveSupport defaults the deprecation horizon to a Rails version, and this gem never interpolates it into a warning: every warning is written by hand per ADR-0007. The horizon is informational only, so it carries the ADRās wording instead of a version that would go stale.
@api public
Private Class Methods
Source
# File lib/git.rb, line 57 def self.configure_deprecation_behavior(deprecation, behavior) return if behavior.nil? behavior = behavior.strip allowed_behaviors = ActiveSupport::Deprecation::DEFAULT_BEHAVIORS.keys.map(&:to_s) unless allowed_behaviors.include?(behavior) raise ArgumentError, "Invalid GIT_DEPRECATION_BEHAVIOR=#{behavior.inspect}; " \ "expected one of: #{allowed_behaviors.join(', ')}" end deprecation.behavior = behavior.to_sym end
Configure a deprecation instance from a GIT_DEPRECATION_BEHAVIOR value
@param deprecation [ActiveSupport::Deprecation] the deprecation instance to configure
@param behavior [String, nil] the desired behavior name (e.g. āāsilenceāā); when
`nil` the deprecation instance is left unchanged
@return [void]
@raise [ArgumentError] if ābehavior` is not one of the keys of
`ActiveSupport::Deprecation::DEFAULT_BEHAVIORS`
@api private
Public Instance Methods
Source
# File lib/git.rb, line 29 def underscore = 'git' end
The segment of the notification name after ādeprecation.ā
@return [String] āgitā