rubocop-canon 0.2.1 → 0.2.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: 24d224c2ecf5e361f702c300a79778baf8ad63247fb726cb8c39b89534d7dd3f
4
- data.tar.gz: 8e4e0ca31f844a61bdba984c2efd2ccadb2d0ddea11693f38dc452c9b356e40c
3
+ metadata.gz: c0d98429626224c644766d7ef86c951721e1cacb1ed1f2ca8399088dc7e83b26
4
+ data.tar.gz: 7f07b6c9c8a8005d3403a2ec8fbdd01e9048a142bf2cbd16fd0274166f3808bf
5
5
  SHA512:
6
- metadata.gz: b1eea01a2c5652d7513ccfe08b048cd61817f4f20c3dcb757c5e7b0e96ac99c92d0b52f1840d40b69a9c3c5b2eced42444c22ae29ed3461eedc83c1dbd4b5081
7
- data.tar.gz: 98f0a6237ae0b71995af7bf03e8d8b46bcf83ebd92f3fa0ddf81f607a503ab71061b365f2e19a05279702791998be00d7cd1d621224dcdd965ae79d2d3fc2d84
6
+ metadata.gz: 59e81cc7a968cdc8bb061621f7526ee386df07b354d75b305010c5290d52286e8d5a4906f24c41aaad28cba648288d6e675c45d415edd2d2569ad6d53de4337a
7
+ data.tar.gz: 00a20f3e22afc400098761be958ffc1d1bbc8eddffbb9738969037b42dc4ca0babcaa0d9c54a21ba093142d5c64b4a40b0572affa30a17d8b0a0d2cbf6ac1ed9
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Canon
5
- VERSION = '0.2.1'
5
+ VERSION = '0.2.2'
6
6
  end
7
7
  end
@@ -12,10 +12,10 @@ module RuboCop
12
12
  # cop says nothing about a method name it has not been given, so a DSL
13
13
  # it does not know stays as its author wrote it.
14
14
  #
15
- # A block is a group of one whatever it calls, so a DSL block always
16
- # stands apart from the declarations around it. Everything else the cop
17
- # has not been told about — an unlisted method name, a constant — it
18
- # leaves alone.
15
+ # A declaration spanning several lines, and any block, is a group of one
16
+ # whatever it calls, so it always stands apart from its neighbours.
17
+ # Everything else the cop has not been told about — an unlisted method
18
+ # name on one line, a constant — it leaves alone.
19
19
  #
20
20
  # @example GroupedMethods: [[belongs_to, has_many], [validate, validates]]
21
21
  # # bad
@@ -112,7 +112,13 @@ module RuboCop
112
112
  end
113
113
 
114
114
  def standalone?(node)
115
- STANDALONE_TYPES.include?(node.type)
115
+ return true if STANDALONE_TYPES.include?(node.type)
116
+
117
+ multiline?(node)
118
+ end
119
+
120
+ def multiline?(node)
121
+ node.first_line != node.last_line
116
122
  end
117
123
 
118
124
  def group_key(node)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-canon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - skiftle