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: fa86e3e6fe2bfcf08e59edec7e293a5157261928
4
- data.tar.gz: f46184b454d4276de2189ca823d4e52ba198f881
3
+ metadata.gz: a7285177ee78db58b094887342e7d8c6990912a0
4
+ data.tar.gz: d62012742771f224b9edccafa999259d646489ec
5
5
  SHA512:
6
- metadata.gz: e5b7017b657064ac3271e833c039b979393f4759b7c9958c6267fcba4f40f07bd1db1efb50c3c1de74b07951535e57add590af2846340019e9d65f93f582521a
7
- data.tar.gz: a955f6c0154fd34f51cf19222f80a42434d1984067de41c098e9a0501116ba6bf29656d527ed79f52851fe6b56521de195784738e6b8e09927eeca8a333f5423
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. \nAST: #{ast}\nError: #{ex}"
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
- ChangedMethod.new(sorted.first, sorted.last, line, @file)
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
@@ -1,5 +1,5 @@
1
1
  module Rubocop
2
2
  module DefinitionValidator
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  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.3
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-08 00:00:00.000000000 Z
11
+ date: 2016-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop