no_comments 0.1.8 → 0.1.10
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/.rubocop.yml +1 -1
- data/lib/no_comments/content_processor.rb +20 -7
- data/lib/no_comments/version.rb +1 -1
- metadata +4 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5bc4347ee7e47373f8375ffe9c6e699726d61bc86bbafffce828f1c3ded8a8d
|
4
|
+
data.tar.gz: b9b155b4dd1b5d4a9bb1bbec8bb01e4a61298f7203497cd3b88bf9dae9828524
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c54ac24a9e4788546a9eba6d74d919729ae154f0dc8ee4a75e6318562f0f8c04f12955116dce1ed05f56375f6181935e215618aca66450108be29725b3b4648
|
7
|
+
data.tar.gz: dbc1757abfacb2af495446321110afe2f62e0c9f68135528f725fc2464e4e7e2898c58094e0a403c933a82cb4caea1222b6929e9b6e097c105e2cf5017779ed4
|
data/.rubocop.yml
CHANGED
@@ -93,14 +93,27 @@ module NoComments
|
|
93
93
|
|
94
94
|
def process_code_line(line)
|
95
95
|
code_part, comment_part = split_line(line)
|
96
|
-
if
|
97
|
-
|
98
|
-
else
|
99
|
-
@comments << [@line_number, comment_part.strip] if comment_part
|
100
|
-
return if code_part.strip.empty?
|
96
|
+
return handle_empty_line(line) if code_part.strip.empty? && comment_part.nil?
|
97
|
+
return handle_tool_comment_line(code_part, comment_part) if comment_part && tool_comment?(comment_part.strip)
|
101
98
|
|
102
|
-
|
103
|
-
|
99
|
+
handle_regular_code_line(code_part, comment_part)
|
100
|
+
end
|
101
|
+
|
102
|
+
private
|
103
|
+
|
104
|
+
def handle_empty_line(line)
|
105
|
+
@result_lines << line.rstrip
|
106
|
+
end
|
107
|
+
|
108
|
+
def handle_tool_comment_line(code_part, comment_part)
|
109
|
+
@result_lines << ("#{code_part.rstrip} #{comment_part.strip}")
|
110
|
+
end
|
111
|
+
|
112
|
+
def handle_regular_code_line(code_part, comment_part)
|
113
|
+
@comments << [@line_number, comment_part.strip] if comment_part
|
114
|
+
return if code_part.strip.empty?
|
115
|
+
|
116
|
+
@result_lines << code_part.rstrip
|
104
117
|
end
|
105
118
|
end
|
106
119
|
end
|
data/lib/no_comments/version.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: no_comments
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justyna
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
|
-
description:
|
14
12
|
email:
|
15
13
|
- justine84@gmail.com
|
16
14
|
executables:
|
@@ -38,7 +36,6 @@ metadata:
|
|
38
36
|
source_code_uri: https://github.com/justi/no_comments
|
39
37
|
homepage_uri: https://github.com/justi/no_comments
|
40
38
|
rubygems_mfa_required: 'true'
|
41
|
-
post_install_message:
|
42
39
|
rdoc_options: []
|
43
40
|
require_paths:
|
44
41
|
- lib
|
@@ -46,15 +43,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
46
43
|
requirements:
|
47
44
|
- - ">="
|
48
45
|
- !ruby/object:Gem::Version
|
49
|
-
version: 3.
|
46
|
+
version: 3.4.4
|
50
47
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
48
|
requirements:
|
52
49
|
- - ">="
|
53
50
|
- !ruby/object:Gem::Version
|
54
51
|
version: '0'
|
55
52
|
requirements: []
|
56
|
-
rubygems_version: 3.
|
57
|
-
signing_key:
|
53
|
+
rubygems_version: 3.6.7
|
58
54
|
specification_version: 4
|
59
55
|
summary: NoComments is a Ruby gem designed to clean up .rb files by removing unnecessary
|
60
56
|
comments, leaving your code clean and ready for deployment.
|