Class: Ninja::Build

Inherits:
Object
  • Object
show all
Defined in:
lib/ninja.rb

Instance Method Summary collapse

Constructor Details

#initialize(rule, target, explicit_dep, implicit_dep = nil) ⇒ Build

Returns a new instance of Build.



78
79
80
81
82
83
84
# File 'lib/ninja.rb', line 78

def initialize(rule, target, explicit_dep, implicit_dep=nil)
  @rule = rule
  @target = target
  @explicit_dep = explicit_dep
  @implicit_dep = implicit_dep
  # order-only dep is not supported because I do not get how we need it.
end

Instance Method Details

#get_rule_objectObject



90
91
92
# File 'lib/ninja.rb', line 90

def get_rule_object
  @rule
end

#get_target_objectObject



86
87
88
# File 'lib/ninja.rb', line 86

def get_target_object
  @target
end

#implicit_dep_lineObject



94
95
96
97
98
99
100
# File 'lib/ninja.rb', line 94

def implicit_dep_line
  if @implicit_dep == nil
    ""
  else
    @implicit_dep.to_ninja_format
  end
end

#to_ninja_formatObject



102
103
104
105
106
# File 'lib/ninja.rb', line 102

def to_ninja_format
"""
build #{@target.to_ninja_format}: #{@rule.name} #{@explicit_dep.to_ninja_format} #{implicit_dep_line}
"""
end