Class: EnginePack::PackageConfig
- Inherits:
-
Object
- Object
- EnginePack::PackageConfig
- Defined in:
- lib/engine_pack/package_config.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(package_path) ⇒ PackageConfig
constructor
A new instance of PackageConfig.
- #package_files_paths ⇒ Object
Constructor Details
#initialize(package_path) ⇒ PackageConfig
Returns a new instance of PackageConfig.
7 8 9 10 11 12 13 |
# File 'lib/engine_pack/package_config.rb', line 7 def initialize(package_path) @path = package_path raise ArgumentError, "#{package_path} does not have a package.json file." unless File.exist?(config_path) @config = JSON.parse(File.read(config_path)) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/engine_pack/package_config.rb', line 5 def path @path end |
Instance Method Details
#package_files_paths ⇒ Object
15 16 17 18 19 |
# File 'lib/engine_pack/package_config.rb', line 15 def package_files_paths specified_files.map { |f| "#{path}/#{f}" }.tap do |paths| paths << config_path unless paths.include?(config_path) end end |