Sha256: b195b792303dd7987ae5064d85f093857bb1317e261e08e16d34fe8a81c13fc0

Contents?: true

Size: 568 Bytes

Versions: 3

Compression:

Stored size: 568 Bytes

Contents

module YSI
  class ReleaseBranch < Assertion
    def display_name
      "release branch"
    end

    def branch
      "master"
    end

    def current_branch
      git_branch.each_line do |line|
        if line =~ /\* (.*)/
          return $1
        end
      end
      nil
    end

    def git_branch
      `git branch`
    end

    def check
      if current_branch != branch
        @error = "Not on release branch '#{branch}'"
        return nil
      else
        return branch
      end
    end

    def assert(dry_run: false)
      branch
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yes_ship_it-0.0.5 assertions/release_branch.rb
yes_ship_it-0.0.4 assertions/release_branch.rb
yes_ship_it-0.0.3 assertions/release_branch.rb