
* rubocop still warns about this on ruby 1.9.3, so it was fixed so it produces less output on travis.
37 lines
619 B
Ruby
37 lines
619 B
Ruby
# encoding: utf-8
|
|
|
|
module Mutant
|
|
class CLI
|
|
class Classifier
|
|
|
|
# Scope classifier
|
|
class Scope < self
|
|
|
|
REGEXP = /\A(#{SCOPE_PATTERN})\z/.freeze
|
|
|
|
private
|
|
|
|
# Return matcher
|
|
#
|
|
# @return [Matcher]
|
|
#
|
|
# @api private
|
|
#
|
|
def matcher
|
|
Matcher::Scope.new(scope)
|
|
end
|
|
|
|
# Return namespace
|
|
#
|
|
# @return [Class, Module]
|
|
#
|
|
# @api private
|
|
#
|
|
def scope
|
|
Classifier.constant_lookup(match[1].to_s)
|
|
end
|
|
|
|
end # Scope
|
|
end # Classifier
|
|
end # CLI
|
|
end # Mutant
|