Class: Gem::Commands::InstallBranchCommand

Inherits:
InstallCommand
  • Object
show all
Defined in:
lib/rubygems/commands/install_branch_command.rb

Instance Method Summary collapse

Constructor Details

#initializeInstallBranchCommand

Returns a new instance of InstallBranchCommand.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/rubygems/commands/install_branch_command.rb', line 5

def initialize
  super

  add_option '--master', "Install from gem's GitHub 'master' branch" do |value, options|
    @github_branch = 'master'
  end

  add_option '--branch BRANCH', "Install from gem's GitHub BRANCH branch" do |value, options|
    @github_branch = value
  end
end

Instance Method Details

#executeObject



17
18
19
20
21
22
23
# File 'lib/rubygems/commands/install_branch_command.rb', line 17

def execute
  if @github_branch
    GemInstallBranch.install(options[:args].first, @github_branch)
  else
    super
  end
end