gloc 0.3.0 → 0.3.1
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/README.md +1 -0
- data/exe/gloc +7 -3
- data/lib/gloc/version.rb +1 -1
- 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: cb9244dd2be37e278104bde4f0204c06f47aeeb6
|
4
|
+
data.tar.gz: 52d608564c2c687b790727d66bd1c233cddf3357
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 205bc3d6622914c67b52544300850f33df426baeed919cebd21104c6d237feff7e3beeb39b7ae385b9368eb25bfb5501290058e3117cf86da2b965717035350c
|
7
|
+
data.tar.gz: 35f904fbace4b6c866739cc249e55082dc8bad254ed03eca0a390b00f0802388ff2fa195fa7c0d28f3da637f35c7cb31bce038cf9e3f14a93ddb51fa1a2b6dcf
|
data/README.md
CHANGED
@@ -99,6 +99,7 @@ The results are sorted by "lines of code" by default _(with "lines of code" defi
|
|
99
99
|
|
100
100
|
* identify comment-only lines for a lot more languages
|
101
101
|
* support more file encodings (not just `UTF-8` and `ISO-8859-1`)
|
102
|
+
* parse shebang lines for scripts without a file extension
|
102
103
|
|
103
104
|
* (?) installation via Homebrew
|
104
105
|
* (?) convert script to Perl for performance
|
data/exe/gloc
CHANGED
@@ -31,6 +31,7 @@ end
|
|
31
31
|
# looking at the first 16 is fine
|
32
32
|
# for our purposes... for now :-)
|
33
33
|
# see buffer_is_binary() function
|
34
|
+
# in the "git" source repository!
|
34
35
|
source_files.delete_if { |file|
|
35
36
|
(
|
36
37
|
File.extname(file) == '.pdf' || # skip bl**dy PDF documents
|
@@ -38,7 +39,7 @@ source_files.delete_if { |file|
|
|
38
39
|
!File.exist?(file) || # skip non-existent paths
|
39
40
|
!File.file?(file) || # skip directories
|
40
41
|
!File.size?(file) || # skip empty files
|
41
|
-
!File.read(file, 16)["\0"].nil?
|
42
|
+
!File.read(file, 16)["\0"].nil? # skip binary files
|
42
43
|
) && ( $verbose && warn("SKIPPING #{file}...") ; true )
|
43
44
|
}
|
44
45
|
|
@@ -65,8 +66,11 @@ source_stats = source_files.each_with_object({}) { |file, stats|
|
|
65
66
|
comment_count: 0,
|
66
67
|
})
|
67
68
|
end
|
68
|
-
file_content = File.read(file, :encoding => 'UTF-8')
|
69
|
-
|
69
|
+
file_content = File.read(file, :encoding => 'UTF-8')
|
70
|
+
unless file_content.valid_encoding?
|
71
|
+
file_content = File.read(file, :encoding => 'ISO-8859-1')
|
72
|
+
# FIXME what about file encodings other than these two???
|
73
|
+
end
|
70
74
|
source_lines = file_content.each_line
|
71
75
|
stats_for_ext.file_count += 1
|
72
76
|
stats_for_ext.line_count += source_lines.count
|
data/lib/gloc/version.rb
CHANGED
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.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Vandenberk
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|