Class: Gondler::Gomfile
- Inherits:
-
Object
- Object
- Gondler::Gomfile
- Defined in:
- lib/gondler/gomfile.rb
Defined Under Namespace
Classes: NotFound
Instance Attribute Summary collapse
-
#packages ⇒ Object
readonly
Returns the value of attribute packages.
Instance Method Summary collapse
- #gom(name, options = {}) ⇒ Object (also: #package)
- #group(*groups) ⇒ Object
-
#initialize(path) ⇒ Gomfile
constructor
A new instance of Gomfile.
- #load(path) ⇒ Object
- #os(*oss) ⇒ Object
Constructor Details
Instance Attribute Details
#packages ⇒ Object (readonly)
Returns the value of attribute packages.
11 12 13 |
# File 'lib/gondler/gomfile.rb', line 11 def packages @packages end |
Instance Method Details
#gom(name, options = {}) ⇒ Object Also known as: package
17 18 19 20 21 22 23 |
# File 'lib/gondler/gomfile.rb', line 17 def gom(name, = {}) [:group] = @now_group if @now_group [:os] = @now_os if @now_os package = Gondler::Package.new(name, ) @packages.push(package) if package.installable? end |
#group(*groups) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/gondler/gomfile.rb', line 26 def group(*groups) @now_group = groups yield if block_given? ensure @now_group = nil end |
#load(path) ⇒ Object
13 14 15 |
# File 'lib/gondler/gomfile.rb', line 13 def load(path) instance_eval(File.read(path)) end |
#os(*oss) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/gondler/gomfile.rb', line 33 def os(*oss) @now_os = oss yield if block_given? ensure @now_os = nil end |