Parent

Class Index [+]

Quicksearch

Jeweler::Commands::ReleaseToGit

Attributes

gemspec[RW]
version[RW]
repo[RW]
output[RW]
gemspec_helper[RW]
base_dir[RW]

Public Class Methods

build_for(jeweler) click to toggle source
    # File lib/jeweler/commands/release_to_git.rb, line 43
43:       def self.build_for(jeweler)
44:         command = self.new
45: 
46:         command.base_dir = jeweler.base_dir
47:         command.gemspec = jeweler.gemspec
48:         command.version = jeweler.version
49:         command.repo = jeweler.repo
50:         command.output = jeweler.output
51:         command.gemspec_helper = jeweler.gemspec_helper
52: 
53:         command
54:       end
new(attributes = {}) click to toggle source
    # File lib/jeweler/commands/release_to_git.rb, line 6
 6:       def initialize(attributes = {})
 7:         self.output = $stdout
 8: 
 9:         attributes.each_pair do |key, value|
10:           send("#{key}=", value)
11:         end
12:       end

Public Instance Methods

clean_staging_area?() click to toggle source
    # File lib/jeweler/commands/release_to_git.rb, line 29
29:       def clean_staging_area?
30:         status = repo.status
31:         status.added.empty? && status.deleted.empty? && status.changed.empty?
32:       end
release_not_tagged?() click to toggle source
    # File lib/jeweler/commands/release_to_git.rb, line 38
38:       def release_not_tagged?
39:         tag = repo.tag(release_tag) rescue nil
40:         tag.nil?
41:       end
release_tag() click to toggle source
    # File lib/jeweler/commands/release_to_git.rb, line 34
34:       def release_tag
35:         "v#{version}"
36:       end
run() click to toggle source
    # File lib/jeweler/commands/release_to_git.rb, line 14
14:       def run
15:         raise "Hey buddy, try committing them files first" unless clean_staging_area?
16: 
17:         repo.checkout('master')
18:         repo.push
19:         
20:         if release_not_tagged?
21:           output.puts "Tagging #{release_tag}"
22:           repo.add_tag(release_tag)
23: 
24:           output.puts "Pushing #{release_tag} to origin"
25:           repo.push('origin', release_tag)
26:         end
27:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.