Class: Jeweler::Commands::ReleaseToRubygems

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeReleaseToRubygems

Returns a new instance of ReleaseToRubygems.



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

def initialize
  self.output = $stdout
end

Instance Attribute Details

#gemspecObject

Returns the value of attribute gemspec.



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

def gemspec
  @gemspec
end

#gemspec_helperObject

Returns the value of attribute gemspec_helper.



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

def gemspec_helper
  @gemspec_helper
end

#outputObject

Returns the value of attribute output.



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

def output
  @output
end

#versionObject

Returns the value of attribute version.



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

def version
  @version
end

Class Method Details

.build_for(jeweler) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/jeweler/commands/release_to_rubygems.rb', line 18

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

Instance Method Details

#runObject



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

def run
  command = "gem push #{@gemspec_helper.gem_path}"
  output.puts "Executing #{command.inspect}:"
  sh command
end