Parent

Target::ConditionalRule

Uses a conditional like ifeq() to conditionally execute one or more rules TODO: support BSD syntax like: .if $var = $cond

Public Class Methods

new(rules) click to toggle source
# File lib/makeconf/target.rb, line 89
def initialize(rules)
  @condition = nil
  @rules = rules
end

Public Instance Methods

ifdef(var) click to toggle source
# File lib/makeconf/target.rb, line 104
def ifdef(var)
  @condition = "ifdef (#{var})"
  self
end
ifeq(var,match) click to toggle source
# File lib/makeconf/target.rb, line 94
def ifeq(var,match)
  @condition = "ifeq (#{var},#{match})"
  self
end
ifneq(var,match) click to toggle source
# File lib/makeconf/target.rb, line 99
def ifneq(var,match)
  @condition = "ifneq (#{var},#{match})"
  self
end
to_s() click to toggle source
# File lib/makeconf/target.rb, line 109
def to_s
  rules = "#{@condition}\n"
  @rules.each { |r| rules += "\t#{r}\n" }
  rules += "endif\n"
  rules
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.