Class: Vendor::VendorFile::Loader
- Inherits:
-
Object
- Object
- Vendor::VendorFile::Loader
- Defined in:
- lib/vendor/vendor_file/loader.rb
Instance Attribute Summary collapse
-
#dsl ⇒ Object
readonly
Returns the value of attribute dsl.
-
#libraries ⇒ Object
Returns the value of attribute libraries.
Instance Method Summary collapse
-
#initialize ⇒ Loader
constructor
A new instance of Loader.
- #install(project) ⇒ Object
- #libraries_to_install ⇒ Object
- #load(filename) ⇒ Object
Constructor Details
#initialize ⇒ Loader
Returns a new instance of Loader.
11 12 13 14 |
# File 'lib/vendor/vendor_file/loader.rb', line 11 def initialize @dsl = Vendor::VendorFile::DSL.new @libraries = [] end |
Instance Attribute Details
#dsl ⇒ Object (readonly)
Returns the value of attribute dsl.
8 9 10 |
# File 'lib/vendor/vendor_file/loader.rb', line 8 def dsl @dsl end |
#libraries ⇒ Object
Returns the value of attribute libraries.
9 10 11 |
# File 'lib/vendor/vendor_file/loader.rb', line 9 def libraries @libraries end |
Instance Method Details
#install(project) ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/vendor/vendor_file/loader.rb', line 34 def install(project) unless @graph.version_conflicts? @graph.libraries_to_install.each do |lib| library, targets = lib library.install project, :targets => targets end end end |
#libraries_to_install ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/vendor/vendor_file/loader.rb', line 26 def libraries_to_install unless @graph.version_conflicts? @graph.libraries_to_install.each do |library,targets| yield library, targets if block_given? end end end |
#load(filename) ⇒ Object
21 22 23 24 |
# File 'lib/vendor/vendor_file/loader.rb', line 21 def load(filename) @dsl.instance_eval(File.read(filename), filename) self.libraries = @dsl.libraries end |