git-headlines 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/git-headlines.rb +6 -6
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3840b3166f685fd6995c1fcf7cf7a0ba93defd88e9e9eac87c88cd9d120517f0
|
4
|
+
data.tar.gz: f64cf247314d6dfccd3ae96a6c2ffbe72808ac2938d56236b97937e6abd6fcae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60f81f2bbb90f903af4ceb61bf7ca00ed6a1582b0300bfdcda058c339cb8fd8ef6b57026664b1be2e6914f4a31a4d372c484f601f053f2627aa29921ac1950e1
|
7
|
+
data.tar.gz: 2d6c3198f33a5514814bfda34057d46cb3052b3918452dd4fdbc7efde2292a091e25e14b4918bb49a68c3ce1a19af9f049605ae02fcd1b8b8f4e8df1d914c8b0
|
data/lib/git-headlines.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'slop'
|
2
2
|
require 'byebug'
|
3
3
|
|
4
|
-
VERSION = '0.0.
|
4
|
+
VERSION = '0.0.5'
|
5
5
|
|
6
6
|
class HeadLines
|
7
7
|
def initialize
|
@@ -23,8 +23,8 @@ class HeadLines
|
|
23
23
|
def parse_cla
|
24
24
|
@opts = Slop.parse do |o|
|
25
25
|
o.string '-p', '--path', 'specify a different path'
|
26
|
-
o.array '-
|
27
|
-
o.array '-
|
26
|
+
o.array '-i', '--include', 'specify included file extensions'
|
27
|
+
o.array '-e', '--exclude', 'exclude certain files, directories or extensions', delimiter: ','
|
28
28
|
o.bool '-q', '--quiet', 'suppress output'
|
29
29
|
o.on '-v', '--version', 'print version' do
|
30
30
|
puts VERSION
|
@@ -37,7 +37,7 @@ class HeadLines
|
|
37
37
|
search_path = @opts[:path] || '.'
|
38
38
|
|
39
39
|
file_paths = `find #{search_path} -type f -not -path '*/\.*' \
|
40
|
-
#{@ignore_grep} #{@allow_grep}`.split("\n") - @opts[:
|
40
|
+
#{@ignore_grep} #{@allow_grep}`.split("\n") - @opts[:exclude]
|
41
41
|
|
42
42
|
@contents = file_paths.map do |path|
|
43
43
|
`git blame --line-porcelain #{path}`.scan(/author \S.*$/)
|
@@ -51,8 +51,8 @@ class HeadLines
|
|
51
51
|
end.join('|')
|
52
52
|
end
|
53
53
|
|
54
|
-
ignored_extensions = prepend_dotglob.call(@opts[:
|
55
|
-
allowed_extensions = prepend_dotglob.call(@opts[:
|
54
|
+
ignored_extensions = prepend_dotglob.call(@opts[:exclude])
|
55
|
+
allowed_extensions = prepend_dotglob.call(@opts[:include])
|
56
56
|
|
57
57
|
@ignore_grep = ignored_extensions.empty? ? '' : "| grep -vE '#{ignored_extensions}'"
|
58
58
|
@allow_grep = allowed_extensions.empty? ? '' : "| grep -E '#{allowed_extensions}'"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-headlines
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vikdotdev
|
@@ -10,8 +10,13 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2019-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Gem exposes `githl` binary that allows to perform line count / contributor
|
14
|
-
at current HEAD. Running on dirty working tree will produce git errors
|
13
|
+
description: "Gem exposes `githl` binary that allows to perform line count / contributor
|
14
|
+
at current HEAD. Running on dirty working tree will produce git errors.\n\nBinary
|
15
|
+
has a couple of options:\n `-p` or `--path` specifies relative path, defaults to
|
16
|
+
`.`;\n `-i` or `--include` specify included files/directories or file extensions;\n
|
17
|
+
\ `-e` or `--exlude` specify exluded files/directories or file extensions;\n `-v`
|
18
|
+
or `--version` prints version.\n\n Currently does not work with non-UTF-8 encoded
|
19
|
+
files.\n "
|
15
20
|
email: vikdotdev@gmail.com
|
16
21
|
executables:
|
17
22
|
- githl
|