Sha256: bb25663ed1f972d112f1ea5bbf6d2c8014321f03701297dce52c9c236234b78c

Contents?: true

Size: 1.22 KB

Versions: 5

Compression:

Stored size: 1.22 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 = 'master' unless defined?(PUSH_FROM_BRANCH)

  ReleaseToGit.class_eval do
    def run
      branch = PUSH_FROM_BRANCH
      remote = 'origin'

      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(branch)
      repo.push(remote, branch)

      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
      branch = PUSH_FROM_BRANCH
      remote = 'origin'

      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(branch)

      regenerate_gemspec!
      commit_gemspec! if gemspec_changed?

      output.puts "Pushing #{branch} to origin"
      repo.push(remote, branch)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ironfan-3.1.4 tasks/jeweler_use_alt_branch.rake
ironfan-3.1.3 tasks/jeweler_use_alt_branch.rake
ironfan-3.1.2 tasks/jeweler_use_alt_branch.rake
ironfan-3.1.1 tasks/jeweler_use_alt_branch.rake
ironfan-3.1.0.rc1 tasks/jeweler_use_alt_branch.rake