itools 0.4.2 → 0.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3828da40e5decda6064bd9396562cf03881b545a77a4a2c37d90c7eaa6111d98
4
- data.tar.gz: 57a66da5dbe207eefcfcb183d086ced229fbabc769a2cd98ac73e7740f37c57b
3
+ metadata.gz: e0451a93f506a64ac113ac4cad15eedda75903a47bca84818b5a50477ca2c414
4
+ data.tar.gz: 8d3a9ca2e73e3d3b1873b4727c765e48e3f4fd783d4a9d18348ee0947e46fbfc
5
5
  SHA512:
6
- metadata.gz: ac215d7c50ed990fed380008823cead05309cbab0a79d2b35043e0d694668e9d64ff0300eb01408908d0a410df7b1294e7e63aa3565b5da4eb1107ad05f59f6a
7
- data.tar.gz: dfbb9d64c6dc07d983b0896e993550d81ee01f62b44a73aac40c7887312fd112929032f0a9bb33fc181ffb2962483c107237bda22145c26863b6d53791dcf701
6
+ metadata.gz: 2ba26b80c4e69d31201804b86dd531f4cf17961dabfe1ab16e937501fda01fcf4c2a2e3b970c516f55c74b2fcc6b5081aad12330f0af1113203393d939bedc06
7
+ data.tar.gz: 42831fd8687341a27f67720531ae078b2d563b5395f7d97ead3514a7d253f6ac35d3282a87397b09bca6a2cd1b08bfbea39f736ce1e1da53fac8330cca09527a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- itools (0.4.2)
4
+ itools (0.4.3)
5
5
  bundler (~> 1.17)
6
6
  gli (~> 2.17)
7
7
  rake (~> 10.0)
@@ -15,25 +15,27 @@ module Itools
15
15
  @line_number = @line_number + 1
16
16
  end
17
17
  end
18
+ puts "\033[32m统计#{counter.file_path}结束,共#{counter.line_number}行\033[0m"
18
19
  return
19
20
  end
20
21
  if File::directory?(@file_path)
21
22
  Find.find(@file_path) do |file|
22
- if File.file?(file)
23
+ if File.file?(file) #判断是否是文件
23
24
  if File.extname(file).match(/^.[hm]m?$|.cpp/) #只统计.h/.m/.mm/.cpp几个文件
24
25
  File.read(file).each_line do |line|
25
- if line.match(/^\/\/|^$/) == nil #去掉单行注释和空行
26
+ if line.match(/^\/\/|^$/) == nil #去掉单行注释和空行
26
27
  @line_number = @line_number + 1
27
28
  end
28
29
  end
29
30
  end
30
31
  end
31
32
  end
33
+ puts "\033[32m统计#{counter.file_path}结束,共#{counter.line_number}行\033[0m"
32
34
  return
33
35
  end
34
36
  puts "\033[31m找不到指定路径的文件或者文件夹,请重新输入路径\033[0m"
35
-
36
37
  end
38
+
37
39
  def self.counter(args)
38
40
  file = args[0]
39
41
  if file.nil?
@@ -42,7 +44,6 @@ module Itools
42
44
  end
43
45
  counter = CodeCouner.new(file)
44
46
  counter.calculate_line_number
45
- puts "\033[32m统计#{counter.file_path}结束,共#{counter.line_number}行\033[0m"
46
47
  end
47
48
  end
48
49
  end
@@ -1,3 +1,3 @@
1
1
  module Itools
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - zhanggui