Sha256: dc5da8feb73fd53e582306cfc9848423de48bdfa33537121471e144870320b80
Contents?: true
Size: 664 Bytes
Versions: 6
Compression:
Stored size: 664 Bytes
Contents
require 'rubycritic/analysers/helpers/parser' module Rubycritic class ModulesLocator def initialize(analysed_module) @analysed_module = analysed_module end def first_name names.first end def names names = node.get_module_names if names.empty? name_from_path else names end end private def node Parser.parse(content) end def content File.read(@analysed_module.path) end def name_from_path [file_name.split('_').map(&:capitalize).join] end def file_name @analysed_module.pathname.basename.sub_ext('').to_s end end end
Version data entries
6 entries across 6 versions & 1 rubygems