rubocop-lts-ruby 0.1.0 → 0.1.2

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: 04e029bdc1be40a6931f1dc72a43f5c2cf05df615ea7de1c72615cbe7b88b7b1
4
- data.tar.gz: fc3153680a7f158cb2c032b8a7bd7430eda5b542c6fe4497f30823b42144494e
3
+ metadata.gz: 50966987c63662ef0e15c5b9d7c2824508f605a6811e0e90f1bf16bd3ebf5c24
4
+ data.tar.gz: 7db7a8fa808740f505fa77b0cd151f285aa4c3e0e98caa3463f98146a6defcb4
5
5
  SHA512:
6
- metadata.gz: 78eb4ae73f1b06ce56e49fd98b89ce35489f7a188779ea29fbf8db8bacde9df2a1a5e96422ec399c87b9596ab61ffa9690cc7c30312b112542f6a4203c38bb13
7
- data.tar.gz: c8ff5f814f6fc6c853a4c8f7414602bc7fc9e0eab4612c0a1603a39e9de103e1e04c5df4152e27bca9388f64305dd937560993832983577cf65c0bf4003f1463
6
+ metadata.gz: 41ed9fe945838de4162d1d9623339dd3cc7ffdc56d0aaebcadeabe0b906de51c5be4de17de06a7c9d8d2d744323790b06677f019f4fc7d1f4be9748d8a6e8736
7
+ data.tar.gz: 80c86ab1748486c4e8e4b3e8c8438ab79a433e6d40196b192e2790ff2ba9d406aa7fdf9e458cd15c5a33bada28ecc902f07a8364b0a3bf9f1c32b1248cdc9b5e
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,42 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [0.1.2] - 2026-09-07
34
+
35
+ - TAG: [v0.1.2][0.1.2t]
36
+ - COVERAGE: 97.47% -- 77/79 lines in 6 files
37
+ - BRANCH COVERAGE: 78.57% -- 11/14 branches in 6 files
38
+ - 44.44% documented
39
+
40
+ ### Fixed
41
+
42
+ - Avoid false positives for ObjectSpace::WeakMap delete availability checks.
43
+
44
+ ## [0.1.1] - 2026-09-07
45
+
46
+ - TAG: [v0.1.1][0.1.1t]
47
+ - COVERAGE: 98.68% -- 75/76 lines in 6 files
48
+ - BRANCH COVERAGE: 91.67% -- 11/12 branches in 6 files
49
+ - 44.44% documented
50
+
51
+ ### Changed
52
+
53
+ - [kc] kettle-jem/prepare: updated 41 project files:
54
+ - configuration (1)
55
+ - dependencies (38)
56
+ - other (2)
57
+
58
+ - [kc] kettle-jem/template: updated 22 project files:
59
+ - configuration (1)
60
+ - dependencies (9)
61
+ - documentation (2)
62
+ - other (9)
63
+ - workflows (1)
64
+
65
+ ### Fixed
66
+
67
+ - Document the plugin purpose in the README Synopsis section.
68
+
33
69
  ## [0.1.0] - 2026-08-09
34
70
 
35
71
  - TAG: [v0.1.0][0.1.0t]
@@ -114,6 +150,10 @@ Please file a bug if you notice a violation of semantic versioning.
114
150
 
115
151
  - Generated dep-heads workflows now include their checked-in appraisal Gemfile, and Ruby 3.1 stdlib appraisal references resolve to an existing modular Gemfile.
116
152
 
117
- [Unreleased]: https://github.com/rubocop-lts/rubocop-lts-ruby/compare/v0.1.0...HEAD
153
+ [Unreleased]: https://github.com/rubocop-lts/rubocop-lts-ruby/compare/v0.1.2...HEAD
154
+ [0.1.2]: https://github.com/rubocop-lts/rubocop-lts-ruby/compare/v0.1.1...v0.1.2
155
+ [0.1.2t]: https://github.com/rubocop-lts/rubocop-lts-ruby/releases/tag/v0.1.2
156
+ [0.1.1]: https://github.com/rubocop-lts/rubocop-lts-ruby/compare/v0.1.0...v0.1.1
157
+ [0.1.1t]: https://github.com/rubocop-lts/rubocop-lts-ruby/releases/tag/v0.1.1
118
158
  [0.1.0]: https://github.com/rubocop-lts/rubocop-lts-ruby/compare/968b2f62d3056d967753b1ee4fcdc3c958553b87...v0.1.0
119
159
  [0.1.0t]: https://github.com/rubocop-lts/rubocop-lts-ruby/releases/tag/v0.1.0
data/README.md CHANGED
@@ -21,6 +21,8 @@ I've summarized my thoughts in [this blog post](https://dev.to/galtzo/hostile-ta
21
21
 
22
22
  ## 🌻 Synopsis <a href="https://discord.gg/3qme4XHNKN"><img alt="Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0" src="https://logos.galtzo.com/assets/images/galtzo-floss/avatar-128px.svg" width="8%" align="right"/></a> <a href="https://ruby-toolbox.com"><img alt="ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5" src="https://logos.galtzo.com/assets/images/ruby-lang/avatar-128px.svg" width="8%" align="right"/></a>
23
23
 
24
+ `rubocop-lts-ruby` provides a RuboCop plugin with compatibility cops for Ruby core and standard-library APIs. It reports calls to catalogued methods that are unavailable in the configured target Ruby version, helping projects catch accidental use of newer APIs before they reach supported runtimes.
25
+
24
26
  ## 💡 Info you can shake a stick at
25
27
 
26
28
  | Tokens to Remember | [![Gem name][⛳️name-img]][⛳️gem-name] [![Gem namespace][⛳️namespace-img]][⛳️gem-namespace] |
@@ -39,7 +41,7 @@ I've summarized my thoughts in [this blog post](https://dev.to/galtzo/hostile-ta
39
41
 
40
42
  ### Compatibility
41
43
 
42
- Compatible with MRI Ruby, JRuby, and TruffleRuby.
44
+ Compatible with MRI Ruby 3.2.0+, JRuby, and TruffleRuby.
43
45
  CI workflows and Appraisals are generated for MRI Ruby 3.2.0+.
44
46
  This test floor is configured by `ruby.test_minimum` in `.kettle-jem.yml` and
45
47
  may be higher than the gem's runtime compatibility floor when legacy Rubies are
@@ -78,7 +80,9 @@ The _amazing_ test matrix is powered by the kettle-dev stack.
78
80
 
79
81
  </details>
80
82
 
81
- ### Enterprise Support [![Tidelift](https://tidelift.com/badges/package/rubygems/rubocop-lts-ruby)](https://tidelift.com/subscription/pkg/rubygems-rubocop-lts-ruby?utm_source=rubygems-rubocop-lts-ruby&utm_medium=referral&utm_campaign=readme)
83
+ ### Enterprise Support
84
+
85
+ [![Tidelift](https://tidelift.com/badges/package/rubygems/rubocop-lts-ruby)](https://tidelift.com/subscription/pkg/rubygems-rubocop-lts-ruby?utm_source=rubygems-rubocop-lts-ruby&utm_medium=referral&utm_campaign=readme)
82
86
 
83
87
  Available as part of the Tidelift Subscription.
84
88
 
@@ -229,8 +233,7 @@ See [SECURITY.md][🔐security].
229
233
  ## 🤝 Contributing
230
234
 
231
235
  If you need some ideas of where to help, you could work on adding more code coverage,
232
- or if it is already 💯 (see [below](#code-coverage)) check [issues][🤝gh-issues] or [PRs][🤝gh-pulls],
233
- or use the gem and think about how it could be better.
236
+ check [issues][🤝gh-issues] or [PRs][🤝gh-pulls], or use the gem and think about how it could be better.
234
237
 
235
238
  We [![Keep A Changelog][📗keep-changelog-img]][📗keep-changelog] so if you make changes, remember to update it.
236
239
 
@@ -266,19 +269,6 @@ Made with [contributors-img][🖐contrib-rocks].
266
269
 
267
270
  Also see GitLab Contributors: [https://gitlab.com/rubocop-lts/rubocop-lts-ruby/-/graphs/main][🚎contributors-gl]
268
271
 
269
- <details markdown="1">
270
- <summary>⭐️ Star History</summary>
271
-
272
- <a href="https://star-history.com/rubocop-lts/rubocop-lts-ruby&Date">
273
- <picture>
274
- <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=rubocop-lts/rubocop-lts-ruby&type=Date&theme=dark" />
275
- <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=rubocop-lts/rubocop-lts-ruby&type=Date" />
276
- <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=rubocop-lts/rubocop-lts-ruby&type=Date" />
277
- </picture>
278
- </a>
279
-
280
- </details>
281
-
282
272
  ## 📌 Versioning
283
273
 
284
274
  This library follows [![Semantic Versioning 2.0.0][📌semver-img]][📌semver] for its public API where practical.
@@ -510,7 +500,7 @@ Thanks for RTFM. ☺️
510
500
  [📌gitmoji]: https://gitmoji.dev
511
501
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
512
502
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
513
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.076-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
503
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.079-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
514
504
  [🔐security]: https://github.com/rubocop-lts/rubocop-lts-ruby/blob/main/SECURITY.md
515
505
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
516
506
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -237,7 +237,7 @@ module RuboCop
237
237
  entry("Object", :then, "2.6"),
238
238
  entry("Object", :yield_self, "2.5"),
239
239
  entry("ObjectSpace", :reachable_objects_from, "2.0", receiver_type: :constant),
240
- entry("ObjectSpace::WeakMap", :delete, "3.3"),
240
+ entry("ObjectSpace::WeakMap", :delete, "3.3", receiver_type: :constructed_instance),
241
241
  entry("OpenStruct", :[], "2.0"),
242
242
  entry("OpenStruct", :[]=, "2.0"),
243
243
  entry("OpenStruct", :each_pair, "2.0"),
@@ -44,13 +44,24 @@ module RuboCop
44
44
  end
45
45
 
46
46
  def entry_applies?(node, entry)
47
- if entry.receiver_type == :instance
48
- return false if node.receiver.const_type?
49
-
50
- return true
47
+ case entry.receiver_type
48
+ when :instance
49
+ !node.receiver.const_type?
50
+ when :constant
51
+ node.receiver.const_type? && node.receiver.const_name == entry.owner
52
+ when :constructed_instance
53
+ constructed_instance_of?(node.receiver, entry.owner)
54
+ else
55
+ false
51
56
  end
57
+ end
52
58
 
53
- node.receiver.const_type? && node.receiver.const_name == entry.owner
59
+ # A local receiver has no reliable static class in RuboCop's AST. Restrict
60
+ # constructor-only APIs to a directly visible `Owner.new` expression rather
61
+ # than treating every nonconstant receiver as an instance of that owner.
62
+ def constructed_instance_of?(receiver, owner)
63
+ receiver.send_type? && receiver.method?(:new) &&
64
+ receiver.receiver&.const_type? && receiver.receiver.const_name == owner
54
65
  end
55
66
 
56
67
  def report_unavailable(node, entries)
@@ -6,7 +6,7 @@ module RuboCop
6
6
  # Version namespace for this gem.
7
7
  module Version
8
8
  # Current gem version.
9
- VERSION = "0.1.0"
9
+ VERSION = "0.1.2"
10
10
  end
11
11
  # Current gem version exposed at the traditional constant location.
12
12
  VERSION = Version::VERSION # Traditional Constant Location
@@ -120,7 +120,7 @@ Gem::Specification.new do |spec|
120
120
  # and preferably a modular one (see gemfiles/modular/*.gemfile).
121
121
 
122
122
  # Dev, Test, & Release Tasks
123
- spec.add_development_dependency("kettle-dev", "~> 2.5", ">= 2.5.26") # ruby >= 3.2.0
123
+ spec.add_development_dependency("kettle-dev", "~> 3.0", ">= 3.0.32") # ruby >= 3.2.0
124
124
 
125
125
  # Security
126
126
  spec.add_development_dependency("bundler-audit", "~> 0.9.3") # ruby >= 2.0.0
@@ -134,9 +134,9 @@ Gem::Specification.new do |spec|
134
134
  # Testing
135
135
  # Loads version files in anonymous namespaces for coverage without constant redefinition warnings.
136
136
  spec.add_development_dependency("anonymous_loader", "~> 0.1", ">= 0.1.3") # ruby >= 2.2.0
137
- spec.add_development_dependency("appraisal2", "~> 3.2", ">= 3.2.2") # ruby >= 1.8.7, for testing against multiple versions of dependencies
138
- spec.add_development_dependency("kettle-test", "~> 2.0", ">= 2.0.19") # ruby >= 3.2.0
139
- spec.add_development_dependency("turbo_tests2", "~> 3.2", ">= 3.2.5") # ruby >= 2.4.0, default kettle-test runner
137
+ spec.add_development_dependency("appraisal2", "~> 3.2", ">= 3.2.3") # ruby >= 1.8.7, for testing against multiple versions of dependencies
138
+ spec.add_development_dependency("kettle-test", "~> 2.0", ">= 2.0.21") # ruby >= 3.2.0
139
+ spec.add_development_dependency("turbo_tests2", "~> 3.2", ">= 3.2.7") # ruby >= 2.4.0, default kettle-test runner
140
140
 
141
141
  # Releasing
142
142
  spec.add_development_dependency("ruby-progressbar", "~> 1.13") # ruby >= 0
@@ -147,5 +147,5 @@ Gem::Specification.new do |spec|
147
147
  # This means we have no choice but to use the erb that shipped with Ruby 2.3
148
148
  # /opt/hostedtoolcache/Ruby/2.3.8/x64/lib/ruby/gems/2.3.0/gems/erb-2.2.2/lib/erb.rb:670:in `prepare_trim_mode': undefined method `match?' for "-":String (NoMethodError)
149
149
  # spec.add_development_dependency("erb", ">= 2.2") # ruby >= 2.3.0, not SemVer, old rubies get dropped in a patch.
150
- spec.add_development_dependency("gitmoji-regex", "~> 2.0", ">= 2.0.11") # ruby >= 2.4
150
+ spec.add_development_dependency("gitmoji-regex", "~> 2.0", ">= 2.0.12") # ruby >= 2.4
151
151
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-lts-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -97,20 +97,20 @@ dependencies:
97
97
  requirements:
98
98
  - - "~>"
99
99
  - !ruby/object:Gem::Version
100
- version: '2.5'
100
+ version: '3.0'
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 2.5.26
103
+ version: 3.0.32
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '2.5'
110
+ version: '3.0'
111
111
  - - ">="
112
112
  - !ruby/object:Gem::Version
113
- version: 2.5.26
113
+ version: 3.0.32
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: bundler-audit
116
116
  requirement: !ruby/object:Gem::Requirement
@@ -188,7 +188,7 @@ dependencies:
188
188
  version: '3.2'
189
189
  - - ">="
190
190
  - !ruby/object:Gem::Version
191
- version: 3.2.2
191
+ version: 3.2.3
192
192
  type: :development
193
193
  prerelease: false
194
194
  version_requirements: !ruby/object:Gem::Requirement
@@ -198,7 +198,7 @@ dependencies:
198
198
  version: '3.2'
199
199
  - - ">="
200
200
  - !ruby/object:Gem::Version
201
- version: 3.2.2
201
+ version: 3.2.3
202
202
  - !ruby/object:Gem::Dependency
203
203
  name: kettle-test
204
204
  requirement: !ruby/object:Gem::Requirement
@@ -208,7 +208,7 @@ dependencies:
208
208
  version: '2.0'
209
209
  - - ">="
210
210
  - !ruby/object:Gem::Version
211
- version: 2.0.19
211
+ version: 2.0.21
212
212
  type: :development
213
213
  prerelease: false
214
214
  version_requirements: !ruby/object:Gem::Requirement
@@ -218,7 +218,7 @@ dependencies:
218
218
  version: '2.0'
219
219
  - - ">="
220
220
  - !ruby/object:Gem::Version
221
- version: 2.0.19
221
+ version: 2.0.21
222
222
  - !ruby/object:Gem::Dependency
223
223
  name: turbo_tests2
224
224
  requirement: !ruby/object:Gem::Requirement
@@ -228,7 +228,7 @@ dependencies:
228
228
  version: '3.2'
229
229
  - - ">="
230
230
  - !ruby/object:Gem::Version
231
- version: 3.2.5
231
+ version: 3.2.7
232
232
  type: :development
233
233
  prerelease: false
234
234
  version_requirements: !ruby/object:Gem::Requirement
@@ -238,7 +238,7 @@ dependencies:
238
238
  version: '3.2'
239
239
  - - ">="
240
240
  - !ruby/object:Gem::Version
241
- version: 3.2.5
241
+ version: 3.2.7
242
242
  - !ruby/object:Gem::Dependency
243
243
  name: ruby-progressbar
244
244
  requirement: !ruby/object:Gem::Requirement
@@ -282,7 +282,7 @@ dependencies:
282
282
  version: '2.0'
283
283
  - - ">="
284
284
  - !ruby/object:Gem::Version
285
- version: 2.0.11
285
+ version: 2.0.12
286
286
  type: :development
287
287
  prerelease: false
288
288
  version_requirements: !ruby/object:Gem::Requirement
@@ -292,7 +292,7 @@ dependencies:
292
292
  version: '2.0'
293
293
  - - ">="
294
294
  - !ruby/object:Gem::Version
295
- version: 2.0.11
295
+ version: 2.0.12
296
296
  description: |
297
297
  RuboCop cops that detect use of Ruby core and standard library APIs that are
298
298
  unavailable for the configured TargetRubyVersion.
@@ -320,10 +320,10 @@ licenses:
320
320
  - MIT
321
321
  metadata:
322
322
  homepage_uri: https://github.com/rubocop-lts/rubocop-lts-ruby
323
- source_code_uri: https://github.com/rubocop-lts/rubocop-lts-ruby/tree/v0.1.0
324
- changelog_uri: https://github.com/rubocop-lts/rubocop-lts-ruby/blob/v0.1.0/CHANGELOG.md
323
+ source_code_uri: https://github.com/rubocop-lts/rubocop-lts-ruby/tree/v0.1.2
324
+ changelog_uri: https://github.com/rubocop-lts/rubocop-lts-ruby/blob/v0.1.2/CHANGELOG.md
325
325
  bug_tracker_uri: https://github.com/rubocop-lts/rubocop-lts-ruby/issues
326
- documentation_uri: https://www.rubydoc.info/gems/rubocop-lts-ruby/0.1.0
326
+ documentation_uri: https://www.rubydoc.info/gems/rubocop-lts-ruby/0.1.2
327
327
  funding_uri: https://github.com/sponsors/pboling
328
328
  wiki_uri: https://github.com/rubocop-lts/rubocop-lts-ruby/wiki
329
329
  news_uri: https://www.railsbling.com/tags/rubocop-lts-ruby
metadata.gz.sig CHANGED
Binary file