Class: Gem::Commands::CompileCommand
- Inherits:
-
Gem::Command
- Object
- Gem::Command
- Gem::Commands::CompileCommand
- Includes:
- Gem::CompileMethods, VersionOption
- Defined in:
- lib/rubygems-compile/commands/compile_command.rb
Overview
Use the MacRuby compiler to compile installed gems.
Instance Method Summary collapse
-
#arguments ⇒ Object
:nodoc:.
-
#defaults_str ⇒ Object
:nodoc:.
-
#execute ⇒ Object
Determine which gems need to be compiled, then create and run a compiler object for each of them.
-
#initialize ⇒ CompileCommand
constructor
A new instance of CompileCommand.
-
#usage ⇒ Object
:nodoc:.
Methods included from Gem::CompileMethods
Constructor Details
#initialize ⇒ CompileCommand
Returns a new instance of CompileCommand.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rubygems-compile/commands/compile_command.rb', line 13 def initialize super 'compile', 'Compile (or recompile) installed gems', ignore: true, all: false add_version_option add_option( '-a', '--all', 'Compile all installed gem' ) do |all,opts| opts[:all] = all end add_option( '-I', '--[no-]ignore-dependencies', 'Also compile dependencies' ) do |value, | [:ignore] = value end end |
Instance Method Details
#arguments ⇒ Object
:nodoc:
26 27 28 |
# File 'lib/rubygems-compile/commands/compile_command.rb', line 26 def arguments # :nodoc: 'GEMNAME name of the gem to compile' end |
#defaults_str ⇒ Object
:nodoc:
30 31 32 |
# File 'lib/rubygems-compile/commands/compile_command.rb', line 30 def defaults_str # :nodoc: super + '--ignore-dependencies' end |
#execute ⇒ Object
Determine which gems need to be compiled, then create and run a compiler object for each of them.
42 43 44 45 46 47 48 49 50 |
# File 'lib/rubygems-compile/commands/compile_command.rb', line 42 def execute gems = execution_list if gems.count >= 10 alert 'This could take a while...' end require 'rubygems-compile/compiler' gems.each { |gem| Gem::Compiler.compile gem } end |
#usage ⇒ Object
:nodoc:
34 35 36 |
# File 'lib/rubygems-compile/commands/compile_command.rb', line 34 def usage # :nodoc: "#{program_name} GEMNAME [GEMNAME ...]" end |