Class: WrappersCommand
- Inherits:
-
Gem::Command
- Object
- Gem::Command
- WrappersCommand
- Defined in:
- lib/gem-wrappers/command.rb
Instance Method Summary collapse
-
#arguments ⇒ Object
:nodoc:.
-
#defaults_str ⇒ Object
:nodoc:.
-
#description ⇒ Object
:nodoc:.
- #execute ⇒ Object
- #execute_regenerate ⇒ Object
- #execute_show ⇒ Object
- #execute_unknown(subcommand) ⇒ Object
-
#initialize ⇒ WrappersCommand
constructor
A new instance of WrappersCommand.
-
#usage ⇒ Object
:nodoc:.
Constructor Details
#initialize ⇒ WrappersCommand
Returns a new instance of WrappersCommand.
7 8 9 |
# File 'lib/gem-wrappers/command.rb', line 7 def initialize super 'regenerate_binstubs', 'Re run generation of environment wrappers for gems.' end |
Instance Method Details
#arguments ⇒ Object
:nodoc:
11 12 13 |
# File 'lib/gem-wrappers/command.rb', line 11 def arguments # :nodoc: "regenerate regenerate environment wrappers for current Gem.home" end |
#defaults_str ⇒ Object
:nodoc:
19 20 21 |
# File 'lib/gem-wrappers/command.rb', line 19 def defaults_str # :nodoc: "" end |
#description ⇒ Object
:nodoc:
23 24 25 26 27 |
# File 'lib/gem-wrappers/command.rb', line 23 def description # :nodoc: "Show (default) or regenerate environment wrappers for current 'GEM_HOME'.\n" end |
#execute ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/gem-wrappers/command.rb', line 29 def execute subcommand = get_one_optional_argument || '' case subcommand when '' execute_show when 'regenerate' execute_regenerate else execute_unknown subcommand end end |
#execute_regenerate ⇒ Object
53 54 55 |
# File 'lib/gem-wrappers/command.rb', line 53 def execute_regenerate GemWrappers.install(gem_dir_executables) end |
#execute_show ⇒ Object
41 42 43 44 45 |
# File 'lib/gem-wrappers/command.rb', line 41 def execute_show $stdout.puts description $stdout.puts " Wrappers path: #{GemWrappers.wrappers_path}" $stdout.puts "Environment file: #{GemWrappers.environment_file}" end |
#execute_unknown(subcommand) ⇒ Object
47 48 49 50 51 |
# File 'lib/gem-wrappers/command.rb', line 47 def execute_unknown(subcommand) $stderr.puts "Unknown wrapper subcommand: #{subcommand}" $stdout.puts description false end |
#usage ⇒ Object
:nodoc:
15 16 17 |
# File 'lib/gem-wrappers/command.rb', line 15 def usage # :nodoc: "#{program_name} [regenerate]" end |