Class: Gitgit::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/gitgit.rb

Overview

Your code goes here…

Instance Method Summary collapse

Instance Method Details

#initObject



11
12
13
14
# File 'lib/gitgit.rb', line 11

def init
  Git.init
  say "Git repo created! Let's git going ...", :green
end

#lgObject



26
27
28
29
# File 'lib/gitgit.rb', line 26

def lg
  g = Git.open('.')
  g.log(20).each {|l| puts l }
end

#saveObject



17
18
19
20
21
22
23
# File 'lib/gitgit.rb', line 17

def save
  yes? "Do you really want to save?"
  m = ask "Give a short description of the work you're saving: "
  g = Git.open('.')
  g.add(all:true)
  g.commit(m)
end