no_comments 0.1.9 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4bd25fbe95f21f9b67340ed123921b6b483c3134edbc4b8924f4bff6395daaa8
4
- data.tar.gz: de4c4dd2964da1ed0720f7265813c27a54f2a98dc5cd66a6c56544276709d9e7
3
+ metadata.gz: e5bc4347ee7e47373f8375ffe9c6e699726d61bc86bbafffce828f1c3ded8a8d
4
+ data.tar.gz: b9b155b4dd1b5d4a9bb1bbec8bb01e4a61298f7203497cd3b88bf9dae9828524
5
5
  SHA512:
6
- metadata.gz: 58cd74ff623136cd6af53270606a9db22bdd7ea6dec8c7e8b952d05b4c2c91079b53c029a21c8b60fa8e90a2d721cc3a0a39f5807a5fd56bfe82ba4351e4503d
7
- data.tar.gz: 860f0e0646154364946327a9294464dc933fd191e20cbb2a47f25b342798af9afd5587d8118a134897735f12f08d9420ea9bea0b685f81db3fa8f03a726e3a02
6
+ metadata.gz: 6c54ac24a9e4788546a9eba6d74d919729ae154f0dc8ee4a75e6318562f0f8c04f12955116dce1ed05f56375f6181935e215618aca66450108be29725b3b4648
7
+ data.tar.gz: dbc1757abfacb2af495446321110afe2f62e0c9f68135528f725fc2464e4e7e2898c58094e0a403c933a82cb4caea1222b6929e9b6e097c105e2cf5017779ed4
data/.rubocop.yml CHANGED
@@ -3,7 +3,7 @@ require:
3
3
  - rubocop-rake
4
4
 
5
5
  AllCops:
6
- TargetRubyVersion: 3.2
6
+ TargetRubyVersion: 3.4.4
7
7
  NewCops: enable
8
8
 
9
9
  Style/StringLiterals:
@@ -93,17 +93,27 @@ module NoComments
93
93
 
94
94
  def process_code_line(line)
95
95
  code_part, comment_part = split_line(line)
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)
96
98
 
97
- if code_part.strip.empty? && comment_part.nil?
98
- @result_lines << line.rstrip
99
- elsif comment_part && tool_comment?(comment_part.strip)
100
- @result_lines << ("#{code_part.rstrip} #{comment_part.strip}")
101
- else
102
- @comments << [@line_number, comment_part.strip] if comment_part
103
- return if code_part.strip.empty?
99
+ handle_regular_code_line(code_part, comment_part)
100
+ end
104
101
 
105
- @result_lines << code_part.rstrip
106
- end
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
107
117
  end
108
118
  end
109
119
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NoComments
4
- VERSION = "0.1.9"
4
+ VERSION = "0.1.10"
5
5
  end
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.9
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: 2024-11-26 00:00:00.000000000 Z
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.2.4
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.4.19
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.