class Rmk::Touch

Touch existing or create empty #files by touch

Attributes

files[RW]

list of #files to be touched

touch[RW]

touch binary

Public Class Methods

new() click to toggle source
Calls superclass method Rmk::Processor.new
# File tools/touch.rb, line 14
def initialize
  super
  data = tool_params(:Touch, generator.configuration)
  @touch = data[:touch]
  @files = data[:files] || []

  @slot = SLOTS[:begin]
end

Public Instance Methods

command_touch_files() click to toggle source
# File tools/touch.rb, line 23
def command_touch_files
  "#{touch} $out"
end
ninja_build(writer = generator.ninja) click to toggle source
# File tools/touch.rb, line 38
def ninja_build(writer = generator.ninja)
  out = stable_unique(files)
  return if out.empty?

  writer.build(out, 'touch', [])
  generator.add_to_toplevel_target(%i[default all], out)
end
ninja_rules(writer = generator.ninja) click to toggle source
# File tools/touch.rb, line 33
def ninja_rules(writer = generator.ninja)
  writer.rule('touch', command_touch_files,
              description: 'touch $out')
end
ninja_variables(writer = generator.ninja) click to toggle source
# File tools/touch.rb, line 27
def ninja_variables(writer = generator.ninja)
  writer.comment 'touch'
  writer.variable('touch', @touch)
  writer.newline
end