Class: Incept::PackageCollection
- Inherits:
-
Object
- Object
- Incept::PackageCollection
- Defined in:
- lib/incept/package_collection.rb
Class Method Summary collapse
- .command_options ⇒ Object
- .configuration ⇒ Object
- .each(&block) ⇒ Object
- .packages ⇒ Object
- .render ⇒ Object
- .selected(&block) ⇒ Object
Class Method Details
.command_options ⇒ Object
35 36 37 |
# File 'lib/incept/package_collection.rb', line 35 def self. selected.map {|p| p. }.join(' ') end |
.configuration ⇒ Object
4 5 6 |
# File 'lib/incept/package_collection.rb', line 4 def self.configuration @configuration ||= Configuration.load end |
.each(&block) ⇒ Object
12 13 14 |
# File 'lib/incept/package_collection.rb', line 12 def self.each(&block) packages.each(&block) end |
.packages ⇒ Object
8 9 10 |
# File 'lib/incept/package_collection.rb', line 8 def self.packages @packages ||= configuration.map {|type, | new(type, ) } end |
.render ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/incept/package_collection.rb', line 20 def self.render output = '' selected do |package| output << package.render(:install) end output << %{run "bundle install"\n} selected do |package| output << package.render(:post_install) end output end |
.selected(&block) ⇒ Object
16 17 18 |
# File 'lib/incept/package_collection.rb', line 16 def self.selected(&block) packages.select {|p| p.selected? }.each(&block) end |