Parent

Class Index [+]

Quicksearch

Jeweler::Commands::ReleaseToGithub

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_github.rb, line 52
52:       def self.build_for(jeweler)
53:         command = self.new
54: 
55:         command.base_dir = jeweler.base_dir
56:         command.gemspec = jeweler.gemspec
57:         command.version = jeweler.version
58:         command.repo = jeweler.repo
59:         command.output = jeweler.output
60:         command.gemspec_helper = jeweler.gemspec_helper
61: 
62:         command
63:       end
new(attributes = {}) click to toggle source
    # File lib/jeweler/commands/release_to_github.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_github.rb, line 26
26:       def clean_staging_area?
27:         status = repo.status
28:         status.added.empty? && status.deleted.empty? && status.changed.empty?
29:       end
commit_gemspec!() click to toggle source
    # File lib/jeweler/commands/release_to_github.rb, line 31
31:       def commit_gemspec!
32:         repo.add(gemspec_helper.path)
33:         output.puts "Committing #{gemspec_helper.path}"
34:         repo.commit "Regenerated gemspec for version #{version}"
35:       end
gemspec_changed?() click to toggle source
    # File lib/jeweler/commands/release_to_github.rb, line 42
42:       def gemspec_changed?
43:         `git status` # OMGHAX. status always ends up being 'M' unless this runs
44:         status = repo.status[gemspec_helper.path]
45:         ! status.type.nil?
46:       end
gemspec_helper() click to toggle source
    # File lib/jeweler/commands/release_to_github.rb, line 48
48:       def gemspec_helper
49:         @gemspec_helper ||= Jeweler::GemSpecHelper.new(self.gemspec, self.base_dir)
50:       end
regenerate_gemspec!() click to toggle source
    # File lib/jeweler/commands/release_to_github.rb, line 37
37:       def regenerate_gemspec!
38:         gemspec_helper.update_version(version)
39:         gemspec_helper.write
40:       end
run() click to toggle source
    # File lib/jeweler/commands/release_to_github.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: 
19:         regenerate_gemspec!
20:         commit_gemspec! if gemspec_changed?
21: 
22:         output.puts "Pushing master to origin"
23:         repo.push
24:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.