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
:nodoc:.
- #execute ⇒ Object
-
#initialize ⇒ CompileCommand
constructor
A new instance of CompileCommand.
-
#usage ⇒ Object
:nodoc:.
Constructor Details
#initialize ⇒ CompileCommand
Returns a new instance of CompileCommand.
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/rubygems/commands/compile_command.rb', line 5 def initialize super 'compile', 'Create binary gems from gems with extensions', :platform => Gem::Platform::CURRENT, :fat => "" add_option('-p', '--platform PLATFORM', 'Output platform name') do |value, | [:platform] = value end add_option('-f', '--fat VERSION:RUBY,...', 'Create fat binary (e.g. --fat 1.8:ruby,1.9:ruby19)') do |value, | [:fat] = value end end |
Instance Method Details
#arguments ⇒ Object
:nodoc:
19 20 21 |
# File 'lib/rubygems/commands/compile_command.rb', line 19 def arguments # :nodoc: "GEMFILE name of gem to compile" end |
#execute ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rubygems/commands/compile_command.rb', line 27 def execute gem = [:args].shift unless gem then raise Gem::CommandLineError, "Please specify a gem name or file on the command line" end fat_commands = {} [:fat].split(',').each do |ver_cmd| ver, cmd = ver_cmd.split(':', 2) unless ver =~ /^\d+\.\d+$/ then raise Gem::CommandLineError, "Invalid version string #{ver.dump}" end fat_commands[ver] = cmd end Gem::Compiler.compile(gem, [:platform], fat_commands) end |
#usage ⇒ Object
:nodoc:
23 24 25 |
# File 'lib/rubygems/commands/compile_command.rb', line 23 def usage # :nodoc: "#{program_name} GEMFILE" end |