lib/rubocop_challenger/rubocop/yardoc.rb
# Find a RuboCop class by cop name. It find from rubocop/rspec if cannot
# find any class from rubocop gem.
#
# @param cop [String] The target cop name (e.g. "Performance/Size")
# @return [RuboCop::Cop] Found a RuboCop::Cop class
Find a RuboCop class by cop name. It find from rubocop/rspec if cannot
find any class from rubocop gem.
Find a RuboCop class by cop name . It find from rubocop / rspec if cannot find any class from rubocop gem .
def find_cop_class(cop)
        Object.const_get("RuboCop::Cop::#{cop.sub('/', '::')}")
      rescue NameError
        Object.const_get("RuboCop::Cop::RSpec::#{cop.sub('/', '::')}")
      end
def find_cop_class ( cop ) Object . const_get ( "RuboCop::Cop::#{cop.sub('/', '::')}" ) rescue NameError Object . const_get ( "RuboCop::Cop::RSpec::#{cop.sub('/', '::')}" ) end
Find a RuboCop class by cop name.
Find a RuboCop class by cop name .
Found a RuboCop::Cop class
Found a RuboCop :: Cop class
RuboCop::Cop
cop
The target cop name
The target cop name