josephine 0.3.2 → 0.3.3

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/josephine.rb +15 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25b427ef5043704949649ccc49f7a59efc3e7415
4
- data.tar.gz: 28072cc3b37655273c5fa97d7310081e5c18673a
3
+ metadata.gz: 5550337bb102d62a32f38f7a73a0a52e0ffba3ee
4
+ data.tar.gz: e5fdafd593b09877e42125833f75f82c7ea6ad8a
5
5
  SHA512:
6
- metadata.gz: 827e31e2ecd8a747dad90ef60e6b8b94cee961cc2ad15b30f09aaec47777ec985bdefb6341e1a35209f3d4fbc3d16dd3664c4bee9de071c471f30efd2b4fe34c
7
- data.tar.gz: ea392d3d34fcdf1edad9489cdc21ac421daf5ce446ff65b16c9a59289241f57b8e7423a0d60b441c17da2500a49d0c6c1adb029f27e9e66643653b83ef3d2ffa
6
+ metadata.gz: e452a7eec5459f929a5df1a7ecce2e3d7d5a05f03cf6b0c4cf8b1413890987381f21e8d99d74cf05e2f237887b3f394285ddcd3ffe576f095b031ced9d8eb287
7
+ data.tar.gz: 9c5b9f3cfdb69fc3eeb3520fa7ce6abfce50a13b5a8b2ab7a47154ad185555d5f1573b0ae32a26defd94306fcd65ba2cf81b96ed17a5240217771737edb3d9e2
@@ -7,8 +7,13 @@ class Josephine
7
7
  end
8
8
 
9
9
  def extension_file
10
- ext = File.join("**", "*#{@extension}")
11
- files = Dir.glob(ext)
10
+ if @extension == "-all".strip
11
+ ext = File.join("**", "*")
12
+ files = Dir.glob(ext)
13
+ else
14
+ ext = File.join("**", "*#{@extension}")
15
+ files = Dir.glob(ext)
16
+ end
12
17
  end
13
18
 
14
19
  def count_lines
@@ -23,11 +28,11 @@ class Josephine
23
28
  i = 0
24
29
  lines = []
25
30
  File.new(f).each_line do |line|
26
- if line.strip[0] == nil
31
+ if line.scrub.strip[0] == nil
27
32
  space += 1
28
33
  next
29
34
  end
30
- if line.strip[0] == '#'
35
+ if line.scrub.strip[0] == '#'
31
36
  line_com += 1
32
37
  next
33
38
  end
@@ -35,11 +40,16 @@ class Josephine
35
40
  i += 1
36
41
  end
37
42
 
43
+ # binding.pry
38
44
  line_count += i
39
45
  end
40
46
  puts ""
41
47
  puts "------------------------------"
42
- puts "#{num_files.to_s} files with #{@extension} extension."
48
+ if @extension == "-all"
49
+ puts "#{num_files.to_s} files"
50
+ else
51
+ puts "#{num_files.to_s} files with #{@extension} extension."
52
+ end
43
53
  puts "#{line_count.to_s} lines of code."
44
54
  puts "#{(line_count.to_f/num_files.to_f).round(2)} LOC/file."
45
55
  puts "#{line_com.to_s} lines of comments."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: josephine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyrus Ghazanfar