Class: Lake::Target
- Inherits:
-
Struct
- Object
- Struct
- Lake::Target
- Defined in:
- lib/lake.rb
Instance Attribute Summary collapse
-
#deps ⇒ Object
Returns the value of attribute deps.
-
#flags ⇒ Object
Returns the value of attribute flags.
-
#name ⇒ Object
Returns the value of attribute name.
-
#proc ⇒ Object
Returns the value of attribute proc.
Instance Method Summary collapse
Instance Attribute Details
#deps ⇒ Object
Returns the value of attribute deps
5 6 7 |
# File 'lib/lake.rb', line 5 def deps @deps end |
#flags ⇒ Object
Returns the value of attribute flags
5 6 7 |
# File 'lib/lake.rb', line 5 def flags @flags end |
#name ⇒ Object
Returns the value of attribute name
5 6 7 |
# File 'lib/lake.rb', line 5 def name @name end |
#proc ⇒ Object
Returns the value of attribute proc
5 6 7 |
# File 'lib/lake.rb', line 5 def proc @proc end |
Instance Method Details
#build ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/lake.rb', line 6 def build for d in deps if proc or need_build? $targets[d].build else puts "[INFO] #{d} is already built" end end puts "[INFO] Building #{name}" proc.call if proc end |
#need_build? ⇒ Boolean
18 19 20 21 22 23 24 |
# File 'lib/lake.rb', line 18 def need_build? for dep in deps do return true if not $targets[dep] and File.exists? dep return true if $targets[dep].need_build? end (!dep)||(!File.exists? dep)||(flags[:unchecked]) end |