class String

Add convenience methods to grab information from git refs

Public Instance Methods

to_local_branch() click to toggle source

Grabs branch name from git remote refs.

# File lib/core_ext/string.rb, line 4
def to_local_branch
  self[%r{refs/remotes/origin/(.*)}, 1]
end
to_tag() click to toggle source

Grabs tag name from git tag refs.

# File lib/core_ext/string.rb, line 9
def to_tag
  self[%r{refs/tags/(.*)}, 1]
end