class Rmk::AddExtraNinjaCode

Meta-tool to #add “native” ninja code

Attributes

blocks[R]

Public Class Methods

new() click to toggle source
Calls superclass method Rmk::NinjaGenerator.new
# File tools/extraninja.rb, line 11
def initialize
  super
  @blocks = []
end

Public Instance Methods

add(&block) click to toggle source

Add block that writes ninja code. Each block will be called with Ninja::Writer instance as argument.

# File tools/extraninja.rb, line 18
def add(&block)
  @blocks << block
end
ninja_begin(writer = generator.ninja) click to toggle source
# File tools/extraninja.rb, line 22
def ninja_begin(writer = generator.ninja)
  blocks.each { |b| b.call(writer) }
end