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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c027187e4d044c39f2f94274675ac81db2753aca4824be006543aea44421de91
4
- data.tar.gz: 024e089a04c15fd8528361d918c0da35a182551f14f0d4567d1aebc9e473d855
3
+ metadata.gz: e5bc4347ee7e47373f8375ffe9c6e699726d61bc86bbafffce828f1c3ded8a8d
4
+ data.tar.gz: b9b155b4dd1b5d4a9bb1bbec8bb01e4a61298f7203497cd3b88bf9dae9828524
5
5
  SHA512:
6
- metadata.gz: d055e920017f0fd4deaa25ee331aaaf37b851120dc3297178fecc43bd06195ed3a1df9cea969298b66efbb0d0b0add3ec271abfa0f8b334426e6750facacadd0
7
- data.tar.gz: 6307ff40e3e67b62794e41498fb4e3a80934ee13cfa376ea916dd81cf72b2506a020bc9fd9fe5243db9e1b230ef54f438faf13d41164a8127be0e1aea26269a1
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,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 comment_part && tool_comment?(comment_part.strip)
97
- @result_lines << ("#{code_part.rstrip} #{comment_part.strip}")
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
- @result_lines << code_part.rstrip
103
- end
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NoComments
4
- VERSION = "0.1.8"
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.8
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-25 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.