gloc 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc95fe549dd5543d9065169bb27ed78136f9e7099fef68d77ef960fd538477b8
4
- data.tar.gz: 56d52ed6444123d10ace0118d69fb3e645a3dd2230aae7c61e9838d50abe93aa
3
+ metadata.gz: 5156b6f1cc4eb919a465b8dc8f85de9205985ac8254b4137a69551f7962d460e
4
+ data.tar.gz: 2bbcb2c970741426522922268d8fcd0889ca34470b9b28eb2a98b4511ef333a6
5
5
  SHA512:
6
- metadata.gz: ced85c0e8bd14bf7328bf8b23fae5a35f279e9b280642468e6ccc3a7337ec09ed1e819ba06630296dbc1a19df77e4a39adbf20f3e0ee259a6b7b5622f0da3eab
7
- data.tar.gz: 829fbb09dd24e5686526c489a7f838fd599457588ca652e43da5c4aaca72418ad16f798921ee8fc96ebb19d1326a1a28e30ab67ac3f6ce22d670fd49b5e1a7e2
6
+ metadata.gz: 91e48fc39853ecf51a65945df2da0172e6dd9f5b9aa25d36591faf2f5e8681e648aba02d926efb1576945ecaee10d70ef685809d8fcc734ba984a30f5e85ef05
7
+ data.tar.gz: 96a9431bc608a88c36a95dc2c4b5a955aeb27480c75dd5891f59c44f9d13dd39b341dfde54c5b1d7ba14389e0e0dd38515cc31339c33ac281f18743aa42a1f5c
data/.rubocop.yml CHANGED
@@ -1,12 +1,14 @@
1
- Lint/HandleExceptions:
1
+ require:
2
+ - rubocop-rake
3
+ - rubocop-minitest
4
+
5
+ Lint/SuppressedException:
2
6
  Enabled: false
3
7
 
4
8
  Metrics/AbcSize:
5
9
  Enabled: false
6
10
  Metrics/ClassLength:
7
11
  Enabled: false
8
- Metrics/LineLength:
9
- Enabled: false
10
12
  Metrics/MethodLength:
11
13
  Enabled: false
12
14
  Metrics/ModuleLength:
@@ -35,3 +37,6 @@ Style/TrailingCommaInArrayLiteral:
35
37
  Enabled: false
36
38
  Style/TrailingCommaInHashLiteral:
37
39
  Enabled: false
40
+
41
+ AllCops:
42
+ NewCops: enable
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.3.8
1
+ 2.6.3
data/Gemfile.lock CHANGED
@@ -1,52 +1,61 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gloc (0.7.0)
4
+ gloc (0.8.0)
5
5
  rainbow (~> 3.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- ast (2.4.0)
11
- coderay (1.1.2)
10
+ ast (2.4.2)
11
+ coderay (1.1.3)
12
12
  interception (0.5)
13
- jaro_winkler (1.5.2)
14
- method_source (0.9.2)
15
- minitest (5.11.3)
16
- parallel (1.14.0)
17
- parser (2.6.2.0)
18
- ast (~> 2.4.0)
19
- pry (0.12.2)
20
- coderay (~> 1.1.0)
21
- method_source (~> 0.9.0)
22
- pry-rescue (1.5.0)
13
+ method_source (1.0.0)
14
+ minitest (5.14.4)
15
+ parallel (1.20.1)
16
+ parser (3.0.2.0)
17
+ ast (~> 2.4.1)
18
+ pry (0.14.1)
19
+ coderay (~> 1.1)
20
+ method_source (~> 1.0)
21
+ pry-rescue (1.5.2)
23
22
  interception (>= 0.5)
24
23
  pry (>= 0.12.0)
25
- psych (3.1.0)
26
24
  rainbow (3.0.0)
27
- rake (12.3.2)
28
- rubocop (0.66.0)
29
- jaro_winkler (~> 1.5.1)
25
+ rake (13.0.6)
26
+ regexp_parser (2.1.1)
27
+ rexml (3.2.5)
28
+ rubocop (1.18.4)
30
29
  parallel (~> 1.10)
31
- parser (>= 2.5, != 2.5.1.1)
32
- psych (>= 3.1.0)
30
+ parser (>= 3.0.0.0)
33
31
  rainbow (>= 2.2.2, < 4.0)
32
+ regexp_parser (>= 1.8, < 3.0)
33
+ rexml
34
+ rubocop-ast (>= 1.8.0, < 2.0)
34
35
  ruby-progressbar (~> 1.7)
35
- unicode-display_width (>= 1.4.0, < 1.6)
36
- ruby-progressbar (1.10.0)
37
- unicode-display_width (1.5.0)
36
+ unicode-display_width (>= 1.4.0, < 3.0)
37
+ rubocop-ast (1.8.0)
38
+ parser (>= 3.0.1.1)
39
+ rubocop-minitest (0.14.0)
40
+ rubocop (>= 0.90, < 2.0)
41
+ rubocop-rake (0.6.0)
42
+ rubocop (~> 1.0)
43
+ ruby-progressbar (1.11.0)
44
+ unicode-display_width (2.0.0)
38
45
 
39
46
  PLATFORMS
40
47
  ruby
41
48
 
42
49
  DEPENDENCIES
43
- bundler
50
+ bundler (~> 2.2)
44
51
  gloc!
45
- minitest
46
- pry
47
- pry-rescue
48
- rake
49
- rubocop
52
+ minitest (~> 5.14)
53
+ pry (~> 0.14)
54
+ pry-rescue (~> 1.5)
55
+ rake (~> 13.0)
56
+ rubocop (~> 1.18)
57
+ rubocop-minitest (~> 0.14)
58
+ rubocop-rake (~> 0.6)
50
59
 
51
60
  BUNDLED WITH
52
- 2.0.2
61
+ 2.2.25
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  # rubocop:disable Style/SymbolArray
2
2
  # rubocop:disable Style/HashSyntax
3
+ # rubocop:disable Rake/Desc
3
4
 
4
5
  require 'bundler/gem_tasks'
5
6
 
@@ -34,5 +35,6 @@ end
34
35
 
35
36
  Rake::Task['build'].enhance([:default, :ready])
36
37
 
38
+ # rubocop:enable Rake/Desc
37
39
  # rubocop:enable Style/HashSyntax
38
40
  # rubocop:enable Style/SymbolArray
data/exe/gloc CHANGED
@@ -1,11 +1,13 @@
1
1
  #!/usr/bin/env ruby -s
2
2
 
3
3
  #
4
- # rubocop:disable Layout/AlignHash
4
+ # rubocop:disable Layout/HashAlignment
5
5
  # rubocop:disable Layout/ElseAlignment
6
6
  # rubocop:disable Layout/EndAlignment
7
7
  # rubocop:disable Layout/IndentationWidth
8
8
  #
9
+ # rubocop:disable Lint/DuplicateBranch:
10
+ #
9
11
  # rubocop:disable Style/EmptyCaseCondition
10
12
  # rubocop:disable Style/GlobalVars
11
13
  # rubocop:disable Style/RegexpLiteral
@@ -14,7 +16,7 @@
14
16
  require 'English'
15
17
  require 'ostruct'
16
18
 
17
- source_files = if STDIN.tty? || $tty
19
+ source_files = if $stdin.tty? || $tty
18
20
  `git rev-parse --show-toplevel &> /dev/null`
19
21
  if $CHILD_STATUS.success?
20
22
  # we're inside a git repo so
@@ -27,8 +29,8 @@ source_files = if STDIN.tty? || $tty
27
29
  end
28
30
  else
29
31
  # assume we're running it in a pipeline
30
- # and read list of filenames from STDIN
31
- STDIN.read.split($RS).map(&:chomp)
32
+ # and read list of filenames from $stdin
33
+ $stdin.read.split($RS).map(&:chomp)
32
34
  end
33
35
 
34
36
  # exclude binary files from stats
@@ -96,7 +98,7 @@ STATS_FOR = Hash.new do |stats_for_ext, ext|
96
98
  end
97
99
 
98
100
  source_files.each do |file|
99
- ext = '*' + File.extname(file) # e.g. '*.rb' or '*' if no ext!
101
+ ext = File.extname(file).prepend('*') # e.g. '*.rb' or '*' if no ext!
100
102
 
101
103
  blank_regex = BLANKS[ext]
102
104
  comment_regex = COMMENTS[ext]
@@ -120,17 +122,13 @@ sort_metric = case
120
122
  else :code_count
121
123
  end
122
124
 
123
- file_stats = Hash[
124
- STATS_FOR_FILE.sort_by { |_, stats|
125
- stats.send(sort_metric)
126
- }.reverse
127
- ]
125
+ file_stats = STATS_FOR_FILE.sort_by { |_, stats|
126
+ stats.send(sort_metric)
127
+ }.reverse.to_h
128
128
 
129
- source_stats = Hash[
130
- STATS_FOR.sort_by { |_, stats|
131
- stats.send(sort_metric)
132
- }.reverse
133
- ]
129
+ source_stats = STATS_FOR.sort_by { |_, stats|
130
+ stats.send(sort_metric)
131
+ }.reverse.to_h
134
132
 
135
133
  source_stats['TOTAL'] = OpenStruct.new(
136
134
  file_count: source_stats.values.map(&:file_count).reduce(:+) || 0,
@@ -144,7 +142,7 @@ source_stats['TOTAL'] = OpenStruct.new(
144
142
  # JSON formatting for non-TTY output
145
143
  #
146
144
 
147
- unless STDOUT.tty? || $tty || $visual
145
+ unless $stdout.tty? || $tty || $visual
148
146
  require 'json'
149
147
 
150
148
  class OpenStruct
@@ -175,7 +173,7 @@ unless $visual
175
173
  # fancy formatting for TTY output
176
174
  #
177
175
 
178
- source_stats.values.each do |stats_for_ext|
176
+ source_stats.each_value do |stats_for_ext|
179
177
  stats_for_ext.file_count = stats_for_ext.file_count.commify
180
178
  stats_for_ext.line_count = stats_for_ext.line_count.commify
181
179
  stats_for_ext.blank_count = stats_for_ext.blank_count.commify
@@ -242,10 +240,12 @@ end
242
240
  # rubocop:enable Style/GlobalVars
243
241
  # rubocop:enable Style/EmptyCaseCondition
244
242
  #
243
+ # rubocop:enable Lint/DuplicateBranch:
244
+ #
245
245
  # rubocop:enable Layout/IndentationWidth
246
246
  # rubocop:enable Layout/EndAlignment
247
247
  # rubocop:enable Layout/ElseAlignment
248
- # rubocop:enable Layout/AlignHash
248
+ # rubocop:enable Layout/HashAlignment
249
249
  #
250
250
 
251
251
  # That's all Folks!
data/gloc.gemspec CHANGED
@@ -22,12 +22,16 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
+ spec.required_ruby_version = ['>= 2.6.0', '< 2.7.0']
26
+
25
27
  spec.add_dependency 'rainbow', '~> 3.0'
26
28
 
27
- spec.add_development_dependency 'bundler'
28
- spec.add_development_dependency 'minitest'
29
- spec.add_development_dependency 'pry'
30
- spec.add_development_dependency 'pry-rescue'
31
- spec.add_development_dependency 'rake'
32
- spec.add_development_dependency 'rubocop'
29
+ spec.add_development_dependency 'bundler', '~> 2.2'
30
+ spec.add_development_dependency 'minitest', '~> 5.14'
31
+ spec.add_development_dependency 'pry', '~> 0.14'
32
+ spec.add_development_dependency 'pry-rescue', '~> 1.5'
33
+ spec.add_development_dependency 'rake', '~> 13.0'
34
+ spec.add_development_dependency 'rubocop', '~> 1.18'
35
+ spec.add_development_dependency 'rubocop-minitest', '~> 0.14'
36
+ spec.add_development_dependency 'rubocop-rake', '~> 0.6'
33
37
  end
data/lib/gloc/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module GLOC
2
2
  NAME = 'gloc'.freeze
3
- VERSION = '0.7.0'.freeze
3
+ VERSION = '0.8.0'.freeze
4
4
 
5
5
  def self.version
6
6
  "#{NAME} v#{VERSION}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gloc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Vandenberk
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-10 00:00:00.000000000 Z
11
+ date: 2021-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rainbow
@@ -28,86 +28,114 @@ dependencies:
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '2.2'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '2.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '5.14'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '5.14'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pry
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '0.14'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '0.14'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: pry-rescue
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '1.5'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '1.5'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '13.0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '13.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubocop
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.18'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.18'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-minitest
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.14'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.14'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop-rake
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
102
130
  - !ruby/object:Gem::Version
103
- version: '0'
131
+ version: '0.6'
104
132
  type: :development
105
133
  prerelease: false
106
134
  version_requirements: !ruby/object:Gem::Requirement
107
135
  requirements:
108
- - - ">="
136
+ - - "~>"
109
137
  - !ruby/object:Gem::Version
110
- version: '0'
138
+ version: '0.6'
111
139
  description: Simple "lines of code" utility, based on file extensions!
112
140
  email:
113
141
  - pvandenberk@mac.com
@@ -138,7 +166,7 @@ homepage: https://github.com/pvdb/gloc
138
166
  licenses:
139
167
  - MIT
140
168
  metadata: {}
141
- post_install_message:
169
+ post_install_message:
142
170
  rdoc_options: []
143
171
  require_paths:
144
172
  - lib
@@ -146,15 +174,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
146
174
  requirements:
147
175
  - - ">="
148
176
  - !ruby/object:Gem::Version
149
- version: '0'
177
+ version: 2.6.0
178
+ - - "<"
179
+ - !ruby/object:Gem::Version
180
+ version: 2.7.0
150
181
  required_rubygems_version: !ruby/object:Gem::Requirement
151
182
  requirements:
152
183
  - - ">="
153
184
  - !ruby/object:Gem::Version
154
185
  version: '0'
155
186
  requirements: []
156
- rubygems_version: 3.0.4
157
- signing_key:
187
+ rubygems_version: 3.0.3
188
+ signing_key:
158
189
  specification_version: 4
159
190
  summary: Not `loc`, not `cloc`, not `tokei`, not `SLOCCOUNT`, ...
160
191
  test_files: []