Sha256: 2ccd02148f936559f3892a7adaf465b2844be745913379725285157b14ce0163

Contents?: true

Size: 1.11 KB

Versions: 2

Compression:

Stored size: 1.11 KB

Contents

#
# Jeweler has hardcoded the 'master' branch as where to push from.
# We hardcode it right back in.
#

module Jeweler::Commands

  PUSH_FROM_BRANCH = 'version_3' unless defined?(PUSH_FROM_BRANCH)
  
  ReleaseToGit.class_eval do
    def run
      unless clean_staging_area?
        system "git status"
        raise "Unclean staging area! Be sure to commit or .gitignore everything first. See `git status` above."
      end

      repo.checkout(PUSH_FROM_BRANCH)
      repo.push

      if release_not_tagged?
        output.puts "Tagging #{release_tag}"
        repo.add_tag(release_tag)

        output.puts "Pushing #{release_tag} to origin"
        repo.push('origin', release_tag)
      end
    end
  end
  
  ReleaseGemspec.class_eval do
    def run
      unless clean_staging_area?
        system "git status"
        raise "Unclean staging area! Be sure to commit or .gitignore everything first. See `git status` above."
      end

      repo.checkout(PUSH_FROM_BRANCH)

      regenerate_gemspec!
      commit_gemspec! if gemspec_changed?

      output.puts "Pushing #{PUSH_FROM_BRANCH} to origin"
      repo.push
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
cluster_chef-3.0.5 tasks/jeweler_use_alt_branch.rb
cluster_chef-knife-3.0.5 tasks/jeweler_use_alt_branch.rb