Class: Ninja::Rule
- Inherits:
-
Object
- Object
- Ninja::Rule
- Defined in:
- lib/ninja.rb
Instance Method Summary collapse
- #depfile_line ⇒ Object
-
#initialize(rule_desc, depfile = "") ⇒ Rule
constructor
A new instance of Rule.
- #name ⇒ Object
- #to_ninja_format ⇒ Object
- #unique_name ⇒ Object
Constructor Details
#initialize(rule_desc, depfile = "") ⇒ Rule
Returns a new instance of Rule.
13 14 15 16 17 |
# File 'lib/ninja.rb', line 13 def initialize(rule_desc, depfile="") @rule_desc = rule_desc @depfile = depfile @unique_name = Ninja.create_UUID end |
Instance Method Details
#depfile_line ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/ninja.rb', line 23 def depfile_line if @depfile == "" "" else " depfile = #{@depfile}\n" end end |
#name ⇒ Object
38 39 40 |
# File 'lib/ninja.rb', line 38 def name @unique_name end |
#to_ninja_format ⇒ Object
31 32 33 34 35 36 |
# File 'lib/ninja.rb', line 31 def to_ninja_format """ rule #{unique_name} #{depfile_line} command = #{@rule_desc} """ end |
#unique_name ⇒ Object
19 20 21 |
# File 'lib/ninja.rb', line 19 def unique_name @unique_name end |