class Playgroundbook::RootManifestLinter
A linter for verifying the contents of a playground book's root manifest
Attributes
chapter_linter[RW]
Public Class Methods
new(chapter_linter = ChapterLinter.new)
click to toggle source
# File lib/linter/root_manifest_linter.rb, line 10 def initialize(chapter_linter = ChapterLinter.new) @chapter_linter = chapter_linter end
Public Instance Methods
chapters_directory_exist?()
click to toggle source
# File lib/linter/root_manifest_linter.rb, line 28 def chapters_directory_exist? Dir.exist? "Chapters" end
chapters_exist?()
click to toggle source
# File lib/linter/root_manifest_linter.rb, line 32 def chapters_exist? value_defined_in_manifest?("Chapters") end
lint()
click to toggle source
Calls superclass method
Playgroundbook::ManifestLinter#lint
# File lib/linter/root_manifest_linter.rb, line 14 def lint super() fail_lint "No Chapters directory" unless chapters_directory_exist? fail_lint "No Chapters specified" unless chapters_exist? # Go into Chapters/ and then each chapter directory, then lint it. Dir.chdir "Chapters" do manifest_plist_contents["Chapters"].each do |chapter_directory_name| chapter_linter.lint(chapter_directory_name) end end end