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

Constructor Details

#initialize(build) ⇒ Gperf

Returns a new instance of Gperf.



231
232
233
234
235
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 231

def initialize(build)
  super
  @command = 'gperf'
  @compile_options = '-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.



229
230
231
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 229

def compile_options
  @compile_options
end

Instance Method Details

#run(outfile, infile) ⇒ Object



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

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