Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/raykit/string.rb

Instance Method Summary collapse

Instance Method Details

#latest_commitObject



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

#work_dirObject



6
7
8
9
# File 'lib/raykit/string.rb', line 6

def work_dir
  rel_name = sub("https://", "").gsub("http://", "").gsub(".git", "")
  "#{Raykit::Environment.get_dev_dir("work")}/#{rel_name}"
end