Class: MRuby::Command::Archiver

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

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) ⇒ Archiver

Returns a new instance of Archiver.



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

def initialize(build)
  super
  @command = ENV['AR'] || 'ar'
  @archive_options = 'rs "%{outfile}" %{objs}'
end

Instance Attribute Details

#archive_optionsObject

Returns the value of attribute archive_options.



226
227
228
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 226

def archive_options
  @archive_options
end

Instance Method Details

#run(outfile, objfiles) ⇒ Object



234
235
236
237
238
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 234

def run(outfile, objfiles)
  mkdir_p File.dirname(outfile)
  _pp "AR", outfile.relative_path
  _run archive_options, { :outfile => filename(outfile), :objs => filename(objfiles).map{|f| %Q["#{f}"]}.join(' ') }
end