Class: Npm::Rails::PackageFileParser
- Inherits:
-
Object
- Object
- Npm::Rails::PackageFileParser
- Defined in:
- lib/npm/rails/package_file_parser.rb
Instance Attribute Summary collapse
-
#packages ⇒ Object
readonly
Returns the value of attribute packages.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ PackageFileParser
constructor
A new instance of PackageFileParser.
- #parse(package_file_path) ⇒ Object
Constructor Details
#initialize ⇒ PackageFileParser
Returns a new instance of PackageFileParser.
13 14 15 16 |
# File 'lib/npm/rails/package_file_parser.rb', line 13 def initialize @packages = [] @development = false end |
Instance Attribute Details
#packages ⇒ Object (readonly)
Returns the value of attribute packages.
5 6 7 |
# File 'lib/npm/rails/package_file_parser.rb', line 5 def packages @packages end |
Class Method Details
.parse(package_file_path) ⇒ Object
7 8 9 10 11 |
# File 'lib/npm/rails/package_file_parser.rb', line 7 def self.parse(package_file_path) parser = new parser.parse(package_file_path) parser.packages end |
Instance Method Details
#parse(package_file_path) ⇒ Object
18 19 20 21 |
# File 'lib/npm/rails/package_file_parser.rb', line 18 def parse(package_file_path) @package_file = File.open(package_file_path, "r", &:read) eval(@package_file) end |