Sha256: 265f1cd2f2a706796f3c90f7e9adc1d0f6c346baca4f645b2986e7bab1cd06d9

Contents?: true

Size: 1.19 KB

Versions: 8

Compression:

Stored size: 1.19 KB

Contents

require 'rgitflow/tasks/task'

module RGitFlow
  module Tasks
    class Release
      class Finish < RGitFlow::Tasks::Task
        def initialize(git)
          super(git, 'finish', 'Finish a release branch',
                ['rgitflow', 'release'], ['install'])
        end

        protected

        def run
          status 'Finishing release branch...'

          branch = @git.current_branch

          unless branch.start_with? RGitFlow::Config.options[:release]
            error %Q(Cannot finish a release branch unless you are in a release
                     branch)
            abort
          end

          msg = %Q(merging #{branch} into #{RGitFlow::Config.options[:master]})

          @git.branch(RGitFlow::Config.options[:master]).checkout
          @git.merge branch, msg

          invoke 'rgitflow:scm:tag'

          @git.push
          # force re-creation of develop branch
          if @git.is_remote_branch? branch
            @git.push('origin', branch, { :delete => true })
          end

          @git.branch(branch).delete

          @git.branch(RGitFlow::Config.options[:develop]).checkout

          status "Finished release branch #{branch}!"
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rgitflow-0.2.1.pre.alpha.pre.32 lib/rgitflow/tasks/release/finish.rb
rgitflow-0.2.1.pre.alpha.pre.28 lib/rgitflow/tasks/release/finish.rb
rgitflow-0.2.0.pre.alpha.pre.27 lib/rgitflow/tasks/release/finish.rb
rgitflow-0.2.0.pre.alpha.pre.26 lib/rgitflow/tasks/release/finish.rb
rgitflow-0.2.0.pre.alpha.pre.25 lib/rgitflow/tasks/release/finish.rb
rgitflow-0.2.0 lib/rgitflow/tasks/release/finish.rb
rgitflow-0.2.0.pre.alpha.pre.23 lib/rgitflow/tasks/release/finish.rb
rgitflow-0.2.0.pre.alpha.pre.22 lib/rgitflow/tasks/release/finish.rb