Remove Mutant.constant_lookup

* Since ruby-2.1 Object.const_get does nested lookups fine
This commit is contained in:
Markus Schirp 2015-06-13 03:31:33 +00:00
parent d656904781
commit abdd367ffe
4 changed files with 3 additions and 17 deletions

View file

@ -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]

View file

@ -48,7 +48,7 @@ module Mutant
# @api private
#
def scope
Mutant.constant_lookup(scope_name)
Object.const_get(scope_name)
end
# Return method name

View file

@ -60,7 +60,7 @@ module Mutant
# @api private
#
def scope
Mutant.constant_lookup(scope_name)
Object.const_get(scope_name)
end
# Return scope symbol

View file

@ -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