legit 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/legit +7 -0
- data/lib/legit/version.rb +1 -1
- data/lib/legit.rb +11 -3
- data/lib/legit_helper.rb +8 -0
- metadata +4 -4
data/bin/legit
CHANGED
data/lib/legit/version.rb
CHANGED
data/lib/legit.rb
CHANGED
@@ -2,9 +2,17 @@ require 'legit_helper'
|
|
2
2
|
require 'thor'
|
3
3
|
|
4
4
|
class Legit < Thor
|
5
|
-
desc "log", "print a graph-like log"
|
6
|
-
|
7
|
-
|
5
|
+
desc "log [ARGS]", "print a graph-like log"
|
6
|
+
method_option :me, :type => :boolean, :desc => 'Only include my commits'
|
7
|
+
def log(*args)
|
8
|
+
command = []
|
9
|
+
command << "git log --pretty=format:'%C(yellow)%h%Creset%C(bold cyan)%d%Creset %s %Cgreen(%cr)%Creset %C(bold magenta) <%an>%Creset' --graph --abbrev-commit --date=relative"
|
10
|
+
command << author_equals_me if options[:me]
|
11
|
+
args.each do |arg|
|
12
|
+
command << arg
|
13
|
+
end
|
14
|
+
|
15
|
+
system(command.join(' '))
|
8
16
|
end
|
9
17
|
|
10
18
|
desc "catch-todos [TODO_FORMAT]", "Abort commit if any todos in TODO_FORMAT found"
|
data/lib/legit_helper.rb
CHANGED
@@ -8,6 +8,14 @@ def delete_remote_branch(branch_name)
|
|
8
8
|
system("git push --delete origin #{branch_name}")
|
9
9
|
end
|
10
10
|
|
11
|
+
def author_equals_me
|
12
|
+
"--author='#{user_name}'"
|
13
|
+
end
|
14
|
+
|
15
|
+
def user_name
|
16
|
+
`git config --get user.name`.chomp
|
17
|
+
end
|
18
|
+
|
11
19
|
def show(message, type = :success)
|
12
20
|
color =
|
13
21
|
case type
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: legit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dillon Kearns
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-01-
|
18
|
+
date: 2013-01-12 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|