Class: Gem::Commands::CompileCommand
- Inherits:
-
Gem::Command
- Object
- Gem::Command
- Gem::Commands::CompileCommand
- Defined in:
- lib/rubygems/commands/compile_command.rb
Instance Method Summary collapse
- #arguments ⇒ Object
- #execute ⇒ Object
-
#initialize ⇒ CompileCommand
constructor
A new instance of CompileCommand.
- #usage ⇒ Object
Constructor Details
#initialize ⇒ CompileCommand
Returns a new instance of CompileCommand.
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/rubygems/commands/compile_command.rb', line 4 def initialize super "compile", "Create binary pre-compiled gem", output: Dir.pwd add_option "--prune", "Clean non-existing files during re-packaging" do |value, | [:prune] = true end add_option "-N", "--no-abi-lock", "Do not lock compiled Gem to Ruby's ABI" do |value, | [:no_abi_lock] = true end end |
Instance Method Details
#arguments ⇒ Object
17 18 19 |
# File 'lib/rubygems/commands/compile_command.rb', line 17 def arguments "GEMFILE path to the gem file to compile" end |
#execute ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/rubygems/commands/compile_command.rb', line 25 def execute gemfile = [:args].shift # no gem, no binary unless gemfile raise Gem::CommandLineError, "Please specify a gem file on the command line (e.g. #{program_name} foo-0.1.0.gem)" end require "rubygems/compiler" compiler = Gem::Compiler.new(gemfile, ) compiler.compile end |
#usage ⇒ Object
21 22 23 |
# File 'lib/rubygems/commands/compile_command.rb', line 21 def usage "#{program_name} GEMFILE" end |