Class: Brutal::Manifest::File
- Inherits:
-
Object
- Object
- Brutal::Manifest::File
- Defined in:
- lib/brutal/manifest/file.rb,
lib/brutal/manifest/file/name.rb
Overview
YAML manifest file parser.
Defined Under Namespace
Modules: Name
Instance Attribute Summary collapse
-
#yaml ⇒ Object
readonly
Returns the value of attribute yaml.
Instance Method Summary collapse
-
#initialize(pathname) ⇒ File
constructor
A new instance of File.
- #parse ⇒ Object
Constructor Details
#initialize(pathname) ⇒ File
Returns a new instance of File.
13 14 15 16 17 18 19 |
# File 'lib/brutal/manifest/file.rb', line 13 def initialize(pathname) unless pathname.fnmatch?(Name::SUFFIX_PATTERN, ::File::FNM_PATHNAME | ::File::FNM_DOTMATCH) raise ::ArgumentError end @yaml = pathname.read end |
Instance Attribute Details
#yaml ⇒ Object (readonly)
Returns the value of attribute yaml.
11 12 13 |
# File 'lib/brutal/manifest/file.rb', line 11 def yaml @yaml end |
Instance Method Details
#parse ⇒ Object
21 22 23 |
# File 'lib/brutal/manifest/file.rb', line 21 def parse ::YAML.safe_load(yaml, symbolize_names: false) end |