Class: Gem::Commands::DebCommand
- Inherits:
-
Gem::Command
- Object
- Gem::Command
- Gem::Commands::DebCommand
- Includes:
- InstallUpdateOptions, LocalRemoteOptions, VersionOption
- Defined in:
- lib/commands/deb.rb
Instance Method Summary collapse
- #arguments ⇒ Object
- #description ⇒ Object
- #execute ⇒ Object
-
#initialize ⇒ DebCommand
constructor
A new instance of DebCommand.
- #usage ⇒ Object
Constructor Details
#initialize ⇒ DebCommand
Returns a new instance of DebCommand.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/commands/deb.rb', line 27 def initialize defaults = Gem::DependencyInstaller::DEFAULT_OPTIONS.merge({ :generate_rdoc => false, :generate_ri => true, :format_executable => false, :test => false, :version => Gem::Requirement.default, }) super 'deb', 'Convert a rubygem to debian package', defaults add_version_option @templates_dir = File.dirname(__FILE__)+"/../templates" @install_dir = Dir.tmpdir+"/gemdeb_home" @current_dir = Dir.getwd FileUtils.mkpath(@install_dir) end |
Instance Method Details
#arguments ⇒ Object
19 20 21 |
# File 'lib/commands/deb.rb', line 19 def arguments "GEM gem to convert" end |
#description ⇒ Object
15 16 17 |
# File 'lib/commands/deb.rb', line 15 def description 'Convert a rubygem to debian package' end |
#execute ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/commands/deb.rb', line 49 def execute = { :env_shebang => [:env_shebang], :domain => [:domain], :force => [:force], :format_executable => [:format_executable], :ignore_dependencies => [:ignore_dependencies], :install_dir => @install_dir, :security_policy => [:security_policy], :wrappers => [:wrappers], :bin_dir => "#{@install_dir}/bin", :development => [:development] } get_all_gem_names.each do |gem_name| installer = Gem::DependencyInstaller.new() installer.install gem_name, [:version] installer.installed_gems.each do |spec| generate_deb_for(spec) end end end |
#usage ⇒ Object
23 24 25 |
# File 'lib/commands/deb.rb', line 23 def usage "#{program_name} GEM" end |