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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/git-headlines.rb +6 -6
  3. metadata +8 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c38c7a6210b61d6cb744bef74ff55a342b3c8f88b43ab2e42a515011a95d1e8
4
- data.tar.gz: 19f928b73502343e51d65f48648413c4c800aa49c1d6e2d735dbbd84fcbdf029
3
+ metadata.gz: 3840b3166f685fd6995c1fcf7cf7a0ba93defd88e9e9eac87c88cd9d120517f0
4
+ data.tar.gz: f64cf247314d6dfccd3ae96a6c2ffbe72808ac2938d56236b97937e6abd6fcae
5
5
  SHA512:
6
- metadata.gz: 924377ee7b72d9723e5486fe5384e48f68fdae89d01b8e6f6f9b6cd7678347d95191b6bf5752b8727b16e63288725a4b20db1990a4ffbb5289f1f9b72ceb20fc
7
- data.tar.gz: aa06a29687132fd2ba88bb897b9d6401ba18740f8b8416eeb0f7dd599b35380e098eeb9cf016526f28922f23425a672234e369a0b1b97ba112a70051bdbdc213
6
+ metadata.gz: 60f81f2bbb90f903af4ceb61bf7ca00ed6a1582b0300bfdcda058c339cb8fd8ef6b57026664b1be2e6914f4a31a4d372c484f601f053f2627aa29921ac1950e1
7
+ data.tar.gz: 2d6c3198f33a5514814bfda34057d46cb3052b3918452dd4fdbc7efde2292a091e25e14b4918bb49a68c3ce1a19af9f049605ae02fcd1b8b8f4e8df1d914c8b0
@@ -1,7 +1,7 @@
1
1
  require 'slop'
2
2
  require 'byebug'
3
3
 
4
- VERSION = '0.0.4'
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 '-e', '--ext', 'specify file extensions'
27
- o.array '-i', '--ignore', 'ignore certain files or directories', delimiter: ','
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[:ignore]
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[:ignore])
55
- allowed_extensions = prepend_dotglob.call(@opts[:ext])
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
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