gloc 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/exe/gloc +7 -3
  4. data/lib/gloc/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bb008de5d3e4876e1fdfc917d9c9f8c8b29560c0
4
- data.tar.gz: a90bd40e3e81f8f5f5a9bd1848d1ac219dac3b1d
3
+ metadata.gz: cb9244dd2be37e278104bde4f0204c06f47aeeb6
4
+ data.tar.gz: 52d608564c2c687b790727d66bd1c233cddf3357
5
5
  SHA512:
6
- metadata.gz: 329271c34e3ce802253be45beabe866e8747ceaa5705dde7448359248d6a3bfc6071a9f065f00392fed5ece92aed9ec9b67904e02ddd6ef138a20208ec8cf47a
7
- data.tar.gz: a669b54dd3a4875954ec6002d47e9be98d5fbfcc237b023e44fd34f70cc343921f5d5f8de7361ab2404f6ab0c00323402cd1707c60c90c69b25fed8107df53a5
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? # skip binary files
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') # FIXME what about other encodings?
69
- file_content = File.read(file, :encoding => 'ISO-8859-1') unless content.valid_encoding?
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
@@ -1,3 +1,3 @@
1
1
  module GLOC
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
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.0
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-10 00:00:00.000000000 Z
11
+ date: 2017-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler