Sha256: 61d08e4d32d2f4c9766ea86f0b5eecf9be857a3328b8559450645a3e24e7af50

Contents?: true

Size: 418 Bytes

Versions: 7

Compression:

Stored size: 418 Bytes

Contents

module Semmy
  module Scm
    extend self

    def on_master?
      git.current_branch == 'master'
    end

    def on_stable?(stable_branch_name)
      !!git.current_branch.match(stable_branch_matcher(stable_branch_name))
    end

    private

    def stable_branch_matcher(stable_branch_name)
      Regexp.new(stable_branch_name.gsub(/%\{\w+\}/, '[0-9]+'))
    end

    def git
      Git.open('.')
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
semmy-1.0.2 lib/semmy/scm.rb
semmy-1.0.1 lib/semmy/scm.rb
semmy-1.0.0 lib/semmy/scm.rb
semmy-0.4.0 lib/semmy/scm.rb
semmy-0.3.0 lib/semmy/scm.rb
semmy-0.2.1 lib/semmy/scm.rb
semmy-0.2.0 lib/semmy/scm.rb