Class: Playgroundbook::CutscenePageManifestLinter

Inherits:
ManifestLinter show all
Defined in:
lib/linter/cutscene_page_manifest_linter.rb

Overview

A linter for verifying the contents of a cutscene page’s manifest

Instance Attribute Summary collapse

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 Attribute Details

#page_manifest_linterObject

Returns the value of attribute page_manifest_linter.



6
7
8
# File 'lib/linter/cutscene_page_manifest_linter.rb', line 6

def page_manifest_linter
  @page_manifest_linter
end

Instance Method Details

#lintObject



8
9
10
11
12
13
14
15
16
# File 'lib/linter/cutscene_page_manifest_linter.rb', line 8

def lint
  super()

  # Cutscene references should point to an existent HTML file
  cutscene_reference = manifest_plist_contents["CutsceneReference"]
  fail_lint "Cutscene manifest doesn't reference a cutscene file" if cutscene_reference.nil?
  fail_lint "Cutscene file at '#{cutscene_reference}' isn't HTML" unless cutscene_reference =~ /^.+\.html$/i
  fail_lint "Cutscene file at '#{cutscene_reference}' doesn't exist" unless File.exist? cutscene_reference
end