rubocop-sketchup 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 54e1ec01fa127cd38810ced15038882c35db152d
4
- data.tar.gz: 777b95231929eebf76988a435e5ee5aa28bac9ba
2
+ SHA256:
3
+ metadata.gz: 0b39936ba1a1375007815214923cb932346b1eff463fafdc6c9577f22e863492
4
+ data.tar.gz: bd4f3946f2a2ca0186e03116295a09d84ad9668e65c978fb27ab8056dc3b6fa6
5
5
  SHA512:
6
- metadata.gz: c2a9a1103b4efb4e45d8d812be98ef4ce77956d6546a3c300fa08716787150e6544335f469ffabb27810e1ee0065769733caf23bd9395185f2ef3115915487c1
7
- data.tar.gz: 13edc1663e8f050e41e4e52e00129f9bc80231bd09410b761f9bf189fceb905e78f68c36c4aeeb36cc1757fe0a701182a559e76b7ea96aca0de057d06bbc1362
6
+ metadata.gz: f2653174e89623626d71c3af775e1c519629da9db8a4afd5645cd2dcd05c23da22eaf16f661d4138be9f6ed3d1b6aad245c80478e20b08bd8a9d32a2ef011afe
7
+ data.tar.gz: ec333f79c8d6422978e96c46ca61286fb8267640b0ed94f6e0031c2ec3f69d36b114bd8f8a62f5ccf915a9051d7de2ec75fba0d9e4ae5c950744b6a77a90881c
@@ -37,8 +37,10 @@ end
37
37
 
38
38
  # Make it easier to explore available methods on a method.
39
39
  class Object
40
- def methods!
41
- methods.sort - Object.class.instance_methods
40
+ def methods!(queries = true)
41
+ sorted = methods.sort - Object.class.instance_methods
42
+ sorted.reject! { |m| m.to_s.end_with?('?') } unless queries
43
+ sorted
42
44
  end
43
45
  end
44
46
 
@@ -43,8 +43,11 @@ module RuboCop
43
43
  end
44
44
 
45
45
  def on_const(node)
46
- namespace = Namespace.new(node.parent_module_name)
47
- return unless namespace.top_level?
46
+ if node.parent && node.parent.module_definition?
47
+ # This catches definition of classes and modules.
48
+ namespace = Namespace.new(node.parent_module_name)
49
+ return unless namespace.top_level?
50
+ end
48
51
 
49
52
  feature_name = node.const_name
50
53
  [:class, :module, :constant].each { |type|
@@ -10,7 +10,9 @@ module RuboCop
10
10
 
11
11
  # @param [String] namespace
12
12
  def initialize(namespace)
13
- raise TypeError unless namespace.is_a?(String)
13
+ unless namespace.is_a?(String)
14
+ raise TypeError, "Expected String, got #{namespace.class.name}"
15
+ end
14
16
 
15
17
  @namespace = namespace
16
18
  end
@@ -1,5 +1,5 @@
1
1
  module RuboCop
2
2
  module SketchUp
3
- VERSION = '0.8.0'.freeze
3
+ VERSION = '0.8.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-sketchup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trimble Inc, SketchUp Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-05 00:00:00.000000000 Z
11
+ date: 2019-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  requirements: []
135
135
  rubyforge_project:
136
- rubygems_version: 2.6.14
136
+ rubygems_version: 2.7.3
137
137
  signing_key:
138
138
  specification_version: 4
139
139
  summary: RuboCop rules for SketchUp extensions.