Class: Jeweler::Commands::InstallGem

Inherits:
Object
  • Object
show all
Includes:
FileUtils
Defined in:
lib/jeweler/commands/install_gem.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInstallGem

Returns a new instance of InstallGem.



8
9
10
# File 'lib/jeweler/commands/install_gem.rb', line 8

def initialize
  self.output = $stdout
end

Instance Attribute Details

#gemspec_helperObject

Returns the value of attribute gemspec_helper.



6
7
8
# File 'lib/jeweler/commands/install_gem.rb', line 6

def gemspec_helper
  @gemspec_helper
end

#outputObject

Returns the value of attribute output.



6
7
8
# File 'lib/jeweler/commands/install_gem.rb', line 6

def output
  @output
end

Class Method Details

.build_for(jeweler) ⇒ Object



23
24
25
26
27
28
# File 'lib/jeweler/commands/install_gem.rb', line 23

def self.build_for(jeweler)
  command = new
  command.output = jeweler.output
  command.gemspec_helper = jeweler.gemspec_helper
  command
end

Instance Method Details

#gem_commandObject



19
20
21
# File 'lib/jeweler/commands/install_gem.rb', line 19

def gem_command
  "#{Config::CONFIG['RUBY_INSTALL_NAME']} -S gem"
end

#runObject



12
13
14
15
16
17
# File 'lib/jeweler/commands/install_gem.rb', line 12

def run
  command = "#{gem_command} install #{gemspec_helper.gem_path}"
  output.puts "Executing #{command.inspect}:"

  sh command # TODO where does sh actually come from!? - rake, apparently
end