Class: RightScraper::Scanners::CookbookMetadataReadOnly
- Inherits:
-
CookbookMetadata
- Object
- Base
- CookbookMetadata
- RightScraper::Scanners::CookbookMetadataReadOnly
- Defined in:
- lib/right_scraper/scanners/cookbook_metadata_readonly.rb
Overview
Loads existing cookbook metadata from a filesystem.
Constant Summary
Constants inherited from CookbookMetadata
RightScraper::Scanners::CookbookMetadata::FREED_FILE_SIZE_CONSTRAINT, RightScraper::Scanners::CookbookMetadata::JAILED_FILE_SIZE_CONSTRAINT, RightScraper::Scanners::CookbookMetadata::JSON_METADATA, RightScraper::Scanners::CookbookMetadata::KNIFE_METADATA_SCRIPT_NAME, RightScraper::Scanners::CookbookMetadata::RUBY_METADATA, RightScraper::Scanners::CookbookMetadata::UNDEFINED_COOKBOOK_NAME
Instance Attribute Summary
Attributes inherited from CookbookMetadata
Instance Method Summary collapse
-
#notice(relative_position, &blk) ⇒ Object
Notice a file during scanning.
Methods inherited from CookbookMetadata
#begin, #end, #finish, #initialize, #notice_dir, #tls
Methods inherited from Base
#begin, #end, #finish, #initialize, #notice_dir
Constructor Details
This class inherits a constructor from RightScraper::Scanners::CookbookMetadata
Instance Method Details
#notice(relative_position, &blk) ⇒ Object
Notice a file during scanning.
Block
Return the data for this file. We use a block because it may not always be necessary to read the data.
Parameters
- relative_position(String)
-
relative pathname for the file from root of cookbook
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/right_scraper/scanners/cookbook_metadata_readonly.rb', line 40 def notice(relative_position, &blk) case relative_position when JSON_METADATA # preferred over RUBY_METADATA. @read_blk = blk when RUBY_METADATA # defer to any JSON_METADATA, which we hope refers to the same info. @read_blk ||= self.method(:generated_metadata_json_readonly) end true end |