Class: GemLint::Strategies::AbstractStrategy
- Inherits:
-
Object
- Object
- GemLint::Strategies::AbstractStrategy
- Defined in:
- lib/gem_lint/strategies/abstract_strategy.rb
Direct Known Subclasses
BinEndsWithRbStrategy, BinWithoutShebangStrategy, CapitalsInNameStrategy, ChangelogStrategy, ContainsGemFileStrategy, CsvAuthorsStrategy, CsvEmailStrategy, DuplicateAuthorsStrategy, DuplicateEmailStrategy, EmptyAuthorsStrategy, EmptyEmailStrategy, NoFilesStrategy, PkgDirStrategy, ReadmeStrategy, RequireMatchesGemnameStrategy, RubyFileLocationStrategy, StringEmailStrategy, TestFilesInFilesAttributeStrategy, Utf8MetadataStrategy
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#metadata_path ⇒ Object
readonly
Returns the value of attribute metadata_path.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #description ⇒ Object
- #fail? ⇒ Boolean
-
#initialize(args = {}) ⇒ AbstractStrategy
constructor
A new instance of AbstractStrategy.
- #level ⇒ Object
- #level_char ⇒ Object
- #tag ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ AbstractStrategy
Returns a new instance of AbstractStrategy.
8 9 10 11 12 13 14 15 16 |
# File 'lib/gem_lint/strategies/abstract_strategy.rb', line 8 def initialize(args = {}) @filename = args[:filename] @path = args[:data_path] @metadata_path = args[:metadata_path] raise ArgumentError, "#{@path} is not a directory" unless File.directory?(@path) raise ArgumentError, "#{@metadata_path} is not a file" unless File.file?(@metadata_path) raise ArgumentError, ":filename must be a filename ending in gem" unless @filename.to_s[-4,4] == ".gem" end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
6 7 8 |
# File 'lib/gem_lint/strategies/abstract_strategy.rb', line 6 def filename @filename end |
#metadata_path ⇒ Object (readonly)
Returns the value of attribute metadata_path.
6 7 8 |
# File 'lib/gem_lint/strategies/abstract_strategy.rb', line 6 def @metadata_path end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/gem_lint/strategies/abstract_strategy.rb', line 6 def path @path end |
Instance Method Details
#description ⇒ Object
22 23 24 |
# File 'lib/gem_lint/strategies/abstract_strategy.rb', line 22 def description raise "this should be implemented by concrete subclasses" end |
#fail? ⇒ Boolean
26 27 28 |
# File 'lib/gem_lint/strategies/abstract_strategy.rb', line 26 def fail? raise "this should be implemented by concrete subclasses" end |
#level ⇒ Object
30 31 32 |
# File 'lib/gem_lint/strategies/abstract_strategy.rb', line 30 def level raise "this should be implemented by concrete subclasses" end |
#level_char ⇒ Object
18 19 20 |
# File 'lib/gem_lint/strategies/abstract_strategy.rb', line 18 def level_char self.level.to_s[0,1].upcase end |
#tag ⇒ Object
34 35 36 |
# File 'lib/gem_lint/strategies/abstract_strategy.rb', line 34 def tag raise "this should be implemented by concrete subclasses" end |