Class: MRuby::Command::Archiver

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

Returns a new instance of Archiver.



195
196
197
198
199
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 195

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.



193
194
195
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 193

def archive_options
  @archive_options
end

Instance Method Details

#run(outfile, objfiles) ⇒ Object



201
202
203
204
205
206
207
208
209
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 201

def run(outfile, objfiles)
  FileUtils.mkdir_p File.dirname(outfile)
  _pp "AR", outfile.relative_path
  if MRUBY_BUILD_HOST_IS_CYGWIN
    _run archive_options, { :outfile => cygwin_filename(outfile), :objs => cygwin_filename(objfiles).join(' ') }
  else
    _run archive_options, { :outfile => filename(outfile), :objs => filename(objfiles).join(' ') }
  end
end