Class: Gem::Commands::AutoCompileCommand

Inherits:
Gem::Command
  • Object
show all
Includes:
UserInteraction
Defined in:
lib/rubygems-compile/commands/autocompile_command.rb

Instance Method Summary collapse

Constructor Details

#initializeAutoCompileCommand

Returns a new instance of AutoCompileCommand.



4
5
6
# File 'lib/rubygems-compile/commands/autocompile_command.rb', line 4

def initialize
  super 'auto_compile', 'Enable gem compilation at install time'
end

Instance Method Details

#descriptionObject

:nodoc:



8
9
10
# File 'lib/rubygems-compile/commands/autocompile_command.rb', line 8

def description # :nodoc:
  'Toggle a setting that enables compiling gems at install time.'
end

#executeObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/rubygems-compile/commands/autocompile_command.rb', line 16

def execute
  Gem.configuration[:compile] = if Gem.configuration[:compile]
                                  say 'Disabling automatic compilation'
                                  false
                                else
                                  say 'Enabling automatic compilation'
                                  true
                                end
  Gem.configuration.write
end

#usageObject



12
13
14
# File 'lib/rubygems-compile/commands/autocompile_command.rb', line 12

def usage
  "#{progname}"
end