Class: Gem::Commands::ExportCommand
- Inherits:
-
Gem::Command
- Object
- Gem::Command
- Gem::Commands::ExportCommand
- Defined in:
- lib/rubygems/commands/export_command.rb
Instance Method Summary collapse
-
#arguments ⇒ Object
:nodoc:.
-
#description ⇒ Object
:nodoc:.
-
#execute ⇒ Object
:nodoc:.
-
#initialize ⇒ ExportCommand
constructor
new, #execute, #arguments, #defaults_str, #description and #usage.
-
#usage ⇒ Object
:nodoc:.
Constructor Details
#initialize ⇒ ExportCommand
new, #execute, #arguments, #defaults_str, #description and #usage
6 7 8 |
# File 'lib/rubygems/commands/export_command.rb', line 6 def initialize # :nodoc: super 'export', 'Export installed gems to a yaml file format' end |
Instance Method Details
#arguments ⇒ Object
:nodoc:
20 21 22 |
# File 'lib/rubygems/commands/export_command.rb', line 20 def arguments # :nodoc: "" end |
#description ⇒ Object
:nodoc:
24 25 26 27 28 |
# File 'lib/rubygems/commands/export_command.rb', line 24 def description # :nodoc: <<-EOF Exports all installed gems to a YAML file EOF end |
#execute ⇒ Object
:nodoc:
10 11 12 13 14 15 16 17 18 |
# File 'lib/rubygems/commands/export_command.rb', line 10 def execute # :nodoc: puts "Exporting to gems.yml" # TODO: This is a huge hack to work with current version of GemInstaller. Need to modify # geminstaller to have a proper --export [FILE] option to export all installed gems # to a specified yaml file, with no required input geminstaller.yml file system('touch /tmp/gems-to-exclude.yml') || raise output = `geminstaller --print-rogue-gems --config=/tmp/gems-to-exclude.yml` File.open('gems.yml', 'w') {|f| f.write(output) } end |
#usage ⇒ Object
:nodoc:
30 31 32 |
# File 'lib/rubygems/commands/export_command.rb', line 30 def usage # :nodoc: "#{program_name}" end |