Class: GemLint::Strategies::RequireMatchesGemnameStrategy

Inherits:
AbstractStrategy show all
Defined in:
lib/gem_lint/strategies/require_matches_gemname_strategy.rb

Instance Attribute Summary

Attributes inherited from AbstractStrategy

#filename, #metadata_path, #path

Instance Method Summary collapse

Methods inherited from AbstractStrategy

#initialize, #level_char

Constructor Details

This class inherits a constructor from GemLint::Strategies::AbstractStrategy

Instance Method Details

#descriptionObject



7
8
9
# File 'lib/gem_lint/strategies/require_matches_gemname_strategy.rb', line 7

def description
  "Gem cannot be loaded by require '#{preferred_basename.gsub(/^lib\//,'')}'"
end

#fail?Boolean

TODO: does thi need to be beefed up to recognise extensions

Returns:

  • (Boolean)


21
22
23
# File 'lib/gem_lint/strategies/require_matches_gemname_strategy.rb', line 21

def fail?
  !spec.files.include?(preferred_filename)
end

#levelObject



15
16
17
# File 'lib/gem_lint/strategies/require_matches_gemname_strategy.rb', line 15

def level
  :warning
end

#tagObject



11
12
13
# File 'lib/gem_lint/strategies/require_matches_gemname_strategy.rb', line 11

def tag
  :"require-doesnt-match-gemname"
end