sevencop 0.48.0 → 0.48.1

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: c030a278dafeed8771940f8697c6d720961c4cd4c56971e9b160efdeaaec5c48
4
- data.tar.gz: 1f8e34a388af236e0e507908b32c8415734ebacd56da6077a2bc8ec24d3cb9d9
3
+ metadata.gz: d49c949fbef546c840c5dcb4c0559c1f233843df4e3b932480c5df63d518c040
4
+ data.tar.gz: 55dcd154e3640c7b00f7348d9236d3c97797495a2a10b0d50888501ea7806dee
5
5
  SHA512:
6
- metadata.gz: b1183c9c92492194bb05064d598181a839f6ecce9a20db75275a3ab02c730fd03f9f1d44975089650e02be6fb2a828f75fc678bef94ce57f2dd92f14e67273be
7
- data.tar.gz: 9aca03eab64515ed5605d252900d6e12fed67ef0a46dca03a193125442acafcac137a7cbb96cf8d933b663d1aff806abf68b701ad7cf1a341f2c0a6c3dda9f29
6
+ metadata.gz: 21c617d19a5045202ba55a71b4753298d2a7c92e0edc9578acc0d69ab358a25df82af35c77575eef28f287ce29710b1108f63caf4e90a74efcfed85c696768b9
7
+ data.tar.gz: 117e3d42e7dab55ba37427b4a93ac4e577c37444af4024644f9c93b153d230b5dd2e18e0c556e45b7c8244442a7d1a124b1f36a36a77bbddb585696c72e090ab
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sevencop (0.48.0)
4
+ sevencop (0.48.1)
5
5
  activesupport
6
6
  lint_roller (>= 1.1)
7
7
  rubocop (>= 1.72.1)
@@ -9,7 +9,7 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (7.2.2.1)
12
+ activesupport (7.2.2.2)
13
13
  base64
14
14
  benchmark (>= 0.3)
15
15
  bigdecimal
@@ -22,13 +22,13 @@ GEM
22
22
  securerandom (>= 0.3)
23
23
  tzinfo (~> 2.0, >= 2.0.5)
24
24
  ast (2.4.3)
25
- base64 (0.2.0)
26
- benchmark (0.4.0)
27
- bigdecimal (3.1.9)
25
+ base64 (0.3.0)
26
+ benchmark (0.4.1)
27
+ bigdecimal (3.2.3)
28
28
  concurrent-ruby (1.3.5)
29
- connection_pool (2.5.0)
29
+ connection_pool (2.5.4)
30
30
  diff-lcs (1.6.1)
31
- drb (2.2.1)
31
+ drb (2.2.3)
32
32
  i18n (1.14.7)
33
33
  concurrent-ruby (~> 1.0)
34
34
  json (2.10.2)
data/README.md CHANGED
@@ -10,7 +10,7 @@ Install `sevencop` gem:
10
10
 
11
11
  ```ruby
12
12
  # Gemfile
13
- gem 'sevencop', require: false
13
+ gem 'sevencop'
14
14
  ```
15
15
 
16
16
  then add `sevencop` and enable the cops you want to use on .rubocop.yml:
@@ -94,7 +94,7 @@ module RuboCop
94
94
  return unless node.parent&.begin_type?
95
95
 
96
96
  node.left_siblings.find do |sibling|
97
- sibling.is_a?(::RuboCop::AST::Node) && example?(sibling)
97
+ sendable_node?(sibling) && example?(sibling)
98
98
  end
99
99
  end
100
100
 
@@ -104,6 +104,15 @@ module RuboCop
104
104
  METHOD_NAMES_FOR_REGULAR_EXAMPLE.include?(node.method_name)
105
105
  end
106
106
 
107
+ # @param object [Object]
108
+ # @return [Boolean]
109
+ def sendable_node?(object)
110
+ [
111
+ ::RuboCop::AST::BlockNode,
112
+ ::RuboCop::AST::SendNode
113
+ ].any? { |klass| object.is_a?(klass) }
114
+ end
115
+
107
116
  # @param node [RuboCop::AST::BlockNode, RuboCop::AST::SendNode]
108
117
  # @return [Boolean]
109
118
  def shared_example?(node)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sevencop
4
- VERSION = '0.48.0'
4
+ VERSION = '0.48.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sevencop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.48.0
4
+ version: 0.48.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-04-09 00:00:00.000000000 Z
11
+ date: 2025-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.72.1
55
- description:
55
+ description:
56
56
  email:
57
57
  - r7kamura@gmail.com
58
58
  executables: []
@@ -110,7 +110,7 @@ metadata:
110
110
  source_code_uri: https://github.com/r7kamura/sevencop
111
111
  changelog_uri: https://github.com/r7kamura/sevencop/releases
112
112
  default_lint_roller_plugin: Sevencop::Plugin
113
- post_install_message:
113
+ post_install_message:
114
114
  rdoc_options: []
115
115
  require_paths:
116
116
  - lib
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  version: '0'
127
127
  requirements: []
128
128
  rubygems_version: 3.3.27
129
- signing_key:
129
+ signing_key:
130
130
  specification_version: 4
131
131
  summary: Opinionated custom cops for RuboCop.
132
132
  test_files: []