Class: ARPM::Libfile
- Inherits:
-
Object
- Object
- ARPM::Libfile
- Defined in:
- lib/arpm/libfile.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
Class Method Summary collapse
Instance Method Summary collapse
- #dependencies ⇒ Object
-
#initialize(content) ⇒ Libfile
constructor
A new instance of Libfile.
Constructor Details
#initialize(content) ⇒ Libfile
Returns a new instance of Libfile.
6 7 8 |
# File 'lib/arpm/libfile.rb', line 6 def initialize(content) @content = content end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
4 5 6 |
# File 'lib/arpm/libfile.rb', line 4 def content @content end |
Class Method Details
.location ⇒ Object
10 11 12 |
# File 'lib/arpm/libfile.rb', line 10 def self.location Dir.pwd + "/Libfile" end |
Instance Method Details
#dependencies ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/arpm/libfile.rb', line 14 def dependencies packages = [] content.gsub!(/\r\n?/, "\n") content.each_line do |line| if line.start_with?('lib') elements = line.scan(/"([^"]*)"/) + line.scan(/'([^']*)'/) packages << {elements[0][0] => elements[1][0]} end end packages end |