Method: String#latest_commit
- Defined in:
- lib/raykit/string.rb
#latest_commit ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/raykit/string.rb', line 11 def latest_commit Dir.chdir(self) do text = `git log -n 1` scan = text.scan(/commit (\w+)\s/) return scan[0][0].to_s end end |