Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/core_ext/string.rb
Overview
Add convenience methods to grab information from git refs
Instance Method Summary collapse
-
#to_local_branch ⇒ Object
Grabs branch name from git remote refs.
-
#to_tag ⇒ Object
Grabs tag name from git tag refs.
Instance Method Details
#to_local_branch ⇒ Object
Grabs branch name from git remote refs.
4 5 6 |
# File 'lib/core_ext/string.rb', line 4 def to_local_branch self[%r{refs/remotes/origin/(.*)}, 1] end |
#to_tag ⇒ Object
Grabs tag name from git tag refs.
9 10 11 |
# File 'lib/core_ext/string.rb', line 9 def to_tag self[%r{refs/tags/(.*)}, 1] end |