githelp 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/githelp +5 -0
- data/githelp.gemspec +2 -1
- data/lib/githelp/branches.rb +29 -11
- data/lib/githelp/changes.rb +20 -3
- data/lib/githelp/files.rb +5 -1
- data/lib/githelp/git_check.rb +15 -0
- data/lib/githelp/tags.rb +5 -1
- data/lib/githelp/version.rb +1 -1
- data/lib/githelp.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1b462f001e8cba0fede1763f9bc76caad5f505d
|
4
|
+
data.tar.gz: 4d4e917946e0b816336dbed35cce2d98d6519404
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c30ecf1924f95e8116c73741056425c3798f85b428b4e867dc4399dcfe88d4c44fef4c1b5473e9c23dc8653284b656b35d08e33f9b47613040030f530297401
|
7
|
+
data.tar.gz: 08d0e031d4b99b1d1f6fb7537920ebe3f1b94f7a2f9b1f5ee35acbc72e7b841343c3da2e4604650b962ac2b4a735f7abb28dd022a94e10c2244d3e8369f4fbae
|
data/exe/githelp
CHANGED
data/githelp.gemspec
CHANGED
@@ -17,7 +17,8 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
18
|
spec.bindir = "exe"
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
-
spec.
|
20
|
+
# spec.executables = ["githelp", "githelp-changed"]
|
21
|
+
spec.require_paths = ["lib", "data"]
|
21
22
|
|
22
23
|
spec.add_development_dependency "bundler", "~> 1.10"
|
23
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
data/lib/githelp/branches.rb
CHANGED
@@ -1,21 +1,39 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
module Githelp
|
4
|
+
def git_branch
|
5
|
+
begin
|
6
|
+
`git branch`
|
7
|
+
rescue
|
8
|
+
nil
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
4
12
|
def branches
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
13
|
+
b = git_branch
|
14
|
+
if b
|
15
|
+
b.split(/\n/).map { |line|
|
16
|
+
line.chomp!
|
17
|
+
line.sub(/^../,'')
|
18
|
+
}
|
19
|
+
else
|
20
|
+
[ '##BRANCH##' ]
|
21
|
+
end
|
9
22
|
end
|
10
23
|
|
11
24
|
def branch
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
25
|
+
b = git_branch
|
26
|
+
if b
|
27
|
+
b.split(/\n/).map { |line|
|
28
|
+
line.chomp!
|
29
|
+
if line =~ /^\* (.*)$/ then
|
30
|
+
return $1
|
31
|
+
end
|
32
|
+
}
|
33
|
+
''
|
34
|
+
else
|
35
|
+
''
|
36
|
+
end
|
19
37
|
end
|
20
38
|
end
|
21
39
|
|
data/lib/githelp/changes.rb
CHANGED
@@ -1,19 +1,36 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
3
|
module Githelp
|
4
|
+
def git_log_wc(since,file)
|
5
|
+
begin
|
6
|
+
`git log --oneline --since='#{since}' #{file} | wc`
|
7
|
+
rescue
|
8
|
+
nil
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
4
12
|
def changed(since)
|
5
13
|
files(true).find_all { |file|
|
6
|
-
|
14
|
+
wc = git_log_wc(since,file)
|
15
|
+
if wc
|
16
|
+
wc !~ / 0 /
|
17
|
+
else
|
18
|
+
false
|
19
|
+
end
|
7
20
|
}
|
8
21
|
end
|
9
22
|
|
10
23
|
def unchanged(since)
|
11
24
|
files(true).find_all { |file|
|
12
|
-
|
25
|
+
wc = git_log_wc(since,file)
|
26
|
+
if wc
|
27
|
+
wc =~ / 0 /
|
28
|
+
else
|
29
|
+
false
|
30
|
+
end
|
13
31
|
}
|
14
32
|
end
|
15
33
|
end
|
16
|
-
|
17
34
|
|
18
35
|
|
19
36
|
|
data/lib/githelp/files.rb
CHANGED
data/lib/githelp/tags.rb
CHANGED
data/lib/githelp/version.rb
CHANGED
data/lib/githelp.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: githelp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toshiyuki Masui
|
@@ -116,6 +116,7 @@ files:
|
|
116
116
|
- lib/githelp/branches.rb
|
117
117
|
- lib/githelp/changes.rb
|
118
118
|
- lib/githelp/files.rb
|
119
|
+
- lib/githelp/git_check.rb
|
119
120
|
- lib/githelp/glossary.rb
|
120
121
|
- lib/githelp/numbers.rb
|
121
122
|
- lib/githelp/params.rb
|
@@ -131,7 +132,6 @@ rdoc_options: []
|
|
131
132
|
require_paths:
|
132
133
|
- lib
|
133
134
|
- data
|
134
|
-
- bin
|
135
135
|
required_ruby_version: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
137
|
- - ">="
|