rubocop-definition_validator 0.1.3 → 0.1.4
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
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7285177ee78db58b094887342e7d8c6990912a0
|
4
|
+
data.tar.gz: d62012742771f224b9edccafa999259d646489ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14c9619b5f9e37ada623fc7695d8c1e68c6064e2f3709fc16346b3345cc993622f45a373d0ed09729dc47e5e4fc785e494fc81d832d817505826454b223e44c9
|
7
|
+
data.tar.gz: 559e7fc68c72c37ca7e5d1de874c0962c4200e7289311a8c719da7eb23af69280d38538f3f98fb63f43c4884d66294b02c99464c1cb32fe8c2e02e2e554db086
|
@@ -18,8 +18,9 @@ module Rubocop::DefinitionValidator::ChangeDetector
|
|
18
18
|
.map{|patch| patch.changed_methods}
|
19
19
|
.flatten
|
20
20
|
end
|
21
|
+
|
22
|
+
def changed_methods
|
23
|
+
@changed_methods || init('./.rubocop-definition_validator.diff')
|
24
|
+
end
|
21
25
|
end
|
22
26
|
end
|
23
|
-
|
24
|
-
# XXX: 暫定的に .rubocop-definition_validator.diff からdiffを読む
|
25
|
-
Rubocop::DefinitionValidator::ChangeDetector.init('./.rubocop-definition_validator.diff')
|
@@ -35,7 +35,7 @@ module Rubocop::DefinitionValidator
|
|
35
35
|
params = ast[1][0][2]
|
36
36
|
name = ast[1][0][1][1]
|
37
37
|
rescue NoMethodError => ex
|
38
|
-
raise InvalidAST, "Can't parse AST. \
|
38
|
+
raise InvalidAST, "Can't parse AST. \nCode: #{code}\nError: #{ex}"
|
39
39
|
end
|
40
40
|
|
41
41
|
if params[0] == :paren
|
@@ -59,8 +59,13 @@ module Rubocop::DefinitionValidator
|
|
59
59
|
.select{|_, v| v.all?{|x| x.content =~ /def\s+\w+/}}
|
60
60
|
.map{|line, v|
|
61
61
|
sorted = v.sort_by(&:type)
|
62
|
-
|
62
|
+
begin
|
63
|
+
ChangedMethod.new(sorted.first, sorted.last, line, @file)
|
64
|
+
rescue Method::InvalidAST => ex
|
65
|
+
warn "Warning: #{ex}\n#{ex.backtrace.join("\n")}"if RuboCop::ConfigLoader.debug
|
66
|
+
end
|
63
67
|
}
|
68
|
+
.compact
|
64
69
|
end
|
65
70
|
end
|
66
71
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-definition_validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masataka Kuwabara
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|