rubocop-elegant 0.0.12 → 0.0.13

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: 339ef33644424e7d5a16d648c25e1816c25567ce88f65a68183ef0e6f293b335
4
- data.tar.gz: dbc16893f109848be8aab8c4757115c4fefe72d8b8d486547c13046fe1dd915a
3
+ metadata.gz: 52b4a90ea309c9255ce91551140e414d270d93084d5db71ab0ca6c274b989064
4
+ data.tar.gz: 88cf9d0d858f6c551fa8b4adc9c9a319f8008496f97853f458c6c419c61d8b7b
5
5
  SHA512:
6
- metadata.gz: 9b1cdcc2a1cb3cd39a8436b8601082922587d1f8730a1f3138eff4ba6cd178114904acfd5acb6637b795f17986b5b6ac3bb4648af97e87efc39c7e3e2109ddfb
7
- data.tar.gz: 74e0563ef2342162ba2d80d0fc086c605c41793d6d7568c34d5a67362944297ec0ec43bdf52bc7dd319bbdf92a10b6f39c20f176339555dbddfae01b551cd7ee
6
+ metadata.gz: 8578b0c3c3ec4dfda7a4bb23be3595cebffc8fc6a61189fe671d24f64ee520e3b12db3e76651d6885c6b8d29e18692f1f0cb806aac70cf1e3a4eb25cca57d303
7
+ data.tar.gz: 0b73760980abf0f65481797d62e82fa7e813dbc980cb9f14274ce2185132ea68dcbd116d0b0ceff8fb9ae4650f1724b76aab4534ffe8bc268111ab80845e7540
@@ -9,7 +9,7 @@ module RuboCop
9
9
  class NoComments < Base
10
10
  extend AutoCorrector
11
11
 
12
- MSG = 'Comment is not allowed, unless it is SPDX, magic, or rubocop directive'
12
+ MSG = 'Comment is not allowed, unless it is SPDX, magic, rubocop directive, or docblock'
13
13
  public_constant :MSG
14
14
 
15
15
  def on_new_investigation
@@ -40,8 +40,14 @@ module RuboCop
40
40
  return @gemspec if defined?(@gemspec)
41
41
  path = processed_source.path
42
42
  return @gemspec = false if path.nil?
43
- dir = File.dirname(path)
44
- @gemspec = Dir.glob(File.join(dir, '*.gemspec')).any?
43
+ @gemspec = root(File.dirname(path))
44
+ end
45
+
46
+ def root(dir)
47
+ return true if Dir.glob(File.join(dir, '*.gemspec')).any?
48
+ parent = File.dirname(dir)
49
+ return false if parent == dir
50
+ root(parent)
45
51
  end
46
52
 
47
53
  def docblock?(comment)
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to?(:required_rubygems_version=)
10
10
  s.required_ruby_version = '>=2.2'
11
11
  s.name = 'rubocop-elegant'
12
- s.version = '0.0.12'
12
+ s.version = '0.0.13'
13
13
  s.license = 'MIT'
14
14
  s.summary = 'Set of custom RuboCop cops for elegant Ruby coding'
15
15
  s.description =
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-elegant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko