Class: MRuby::Command::Gperf

Inherits:
MRuby::Command show all
Defined in:
ext/enterprise_script_service/mruby/lib/mruby/build/command.rb

Constant Summary

Constants inherited from MRuby::Command

NotFoundCommands

Instance Attribute Summary collapse

Attributes inherited from MRuby::Command

#build, #command

Instance Method Summary collapse

Methods inherited from MRuby::Command

#clone, #shellquote

Constructor Details

#initialize(build) ⇒ Gperf

Returns a new instance of Gperf.



242
243
244
245
246
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 242

def initialize(build)
  super
  @command = 'gperf'
  @compile_options = %q[-L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k"1,3,$" "%{infile}" > "%{outfile}"]
end

Instance Attribute Details

#compile_optionsObject

Returns the value of attribute compile_options.



240
241
242
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 240

def compile_options
  @compile_options
end

Instance Method Details

#run(outfile, infile) ⇒ Object



248
249
250
251
252
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 248

def run(outfile, infile)
  mkdir_p File.dirname(outfile)
  _pp "GPERF", infile.relative_path, outfile.relative_path
  _run compile_options, { :outfile => filename(outfile) , :infile => filename(infile) }
end