Remove Mutant.constant_lookup
* Since ruby-2.1 Object.const_get does nested lookups fine
This commit is contained in:
parent
d656904781
commit
abdd367ffe
4 changed files with 3 additions and 17 deletions
|
@ -41,20 +41,6 @@ module Mutant
|
|||
ENV.key?('CI')
|
||||
end
|
||||
|
||||
# Lookup constant for location
|
||||
#
|
||||
# @param [String] location
|
||||
#
|
||||
# @return [Object]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def self.constant_lookup(location)
|
||||
location.split(SCOPE_OPERATOR).reduce(Object) do |parent, name|
|
||||
parent.const_get(name, nil)
|
||||
end
|
||||
end
|
||||
|
||||
# Perform self zombification
|
||||
#
|
||||
# @return [self]
|
||||
|
|
|
@ -48,7 +48,7 @@ module Mutant
|
|||
# @api private
|
||||
#
|
||||
def scope
|
||||
Mutant.constant_lookup(scope_name)
|
||||
Object.const_get(scope_name)
|
||||
end
|
||||
|
||||
# Return method name
|
||||
|
|
|
@ -60,7 +60,7 @@ module Mutant
|
|||
# @api private
|
||||
#
|
||||
def scope
|
||||
Mutant.constant_lookup(scope_name)
|
||||
Object.const_get(scope_name)
|
||||
end
|
||||
|
||||
# Return scope symbol
|
||||
|
|
|
@ -81,7 +81,7 @@ module Mutant
|
|||
# @api private
|
||||
#
|
||||
def matcher(env)
|
||||
Matcher::Scope.new(env, Mutant.constant_lookup(namespace), self)
|
||||
Matcher::Scope.new(env, Object.const_get(namespace), self)
|
||||
end
|
||||
|
||||
end # Exact
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue