Class: Playgroundbook::PageLinter
- Inherits:
-
AbstractLinter
- Object
- AbstractLinter
- Playgroundbook::PageLinter
- Defined in:
- lib/linter/page_linter.rb
Overview
A linter for verifying the contents of a page directory
Instance Attribute Summary collapse
-
#page_manifest_linter ⇒ Object
Returns the value of attribute page_manifest_linter.
Instance Method Summary collapse
- #contents_swift_file_exists? ⇒ Boolean
-
#initialize(page_manifest_linter = PageManifestLinter.new) ⇒ PageLinter
constructor
A new instance of PageLinter.
- #lint ⇒ Object
Methods inherited from AbstractLinter
Constructor Details
#initialize(page_manifest_linter = PageManifestLinter.new) ⇒ PageLinter
Returns a new instance of PageLinter.
9 10 11 |
# File 'lib/linter/page_linter.rb', line 9 def initialize(page_manifest_linter = PageManifestLinter.new) @page_manifest_linter = page_manifest_linter end |
Instance Attribute Details
#page_manifest_linter ⇒ Object
Returns the value of attribute page_manifest_linter.
7 8 9 |
# File 'lib/linter/page_linter.rb', line 7 def page_manifest_linter @page_manifest_linter end |
Instance Method Details
#contents_swift_file_exists? ⇒ Boolean
19 20 21 |
# File 'lib/linter/page_linter.rb', line 19 def contents_swift_file_exists? File.exist? ContentsSwiftFileName end |
#lint ⇒ Object
13 14 15 16 17 |
# File 'lib/linter/page_linter.rb', line 13 def lint fail_lint "Missing #{ContentsSwiftFileName} in #{Dir.pwd}" unless contents_swift_file_exists? page_manifest_linter.lint end |