Class: Playgroundbook::PageManifestLinter

Inherits:
ManifestLinter show all
Defined in:
lib/playgroundbook_lint/page_manifest_linter.rb

Overview

A linter for verifying the contents of a page’s Manifest.plist

Constant Summary collapse

SUPPORTED_LIVE_VIEW_MODES =
%w(VisibleByDefault HiddenByDefault).freeze

Instance Method Summary collapse

Methods inherited from ManifestLinter

#manifest_file_exists?, #manifest_plist_contents, #name?, #value_defined_in_manifest?

Methods inherited from AbstractLinter

#fail_lint, #message

Instance Method Details

#lintObject



9
10
11
12
13
14
15
16
# File 'lib/playgroundbook_lint/page_manifest_linter.rb', line 9

def lint
  super()

  live_view_mode = manifest_plist_contents['LiveViewMode']
  unless live_view_mode.nil?
    fail_lint "Unsopported LiveViewMoode '#{live_view_mode}'" unless SUPPORTED_LIVE_VIEW_MODES.include? live_view_mode
  end
end