excellent 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,7 @@ module Simplabs #:nodoc:
9
9
 
10
10
  module Excellent #:nodoc:
11
11
 
12
- VERSION = '2.0.0'
12
+ VERSION = '2.0.1'
13
13
 
14
14
  end
15
15
 
@@ -48,8 +48,15 @@ module Simplabs
48
48
  end
49
49
 
50
50
  def record_validation
51
- if ClassContext::VALIDATIONS.include?(@method) && @parent && @parent.is_a?(ClassContext) && @parent.active_record_model?
52
- @parent.validations << @method
51
+ active_record_parent = if @parent.is_a?(ClassContext)
52
+ @parent if @parent.active_record_model?
53
+ elsif @parent.is_a?(BlockContext) && @parent.parent.is_a?(ClassContext)
54
+ @parent.parent if @parent.parent.active_record_model?
55
+ else
56
+ nil
57
+ end
58
+ if ClassContext::VALIDATIONS.include?(@method) && !!active_record_parent
59
+ active_record_parent.validations << @method
53
60
  end
54
61
  end
55
62
 
@@ -12,6 +12,11 @@ module Simplabs
12
12
  include Scopeable
13
13
 
14
14
  VALIDATIONS = %w(
15
+ validate
16
+ validates
17
+ validates!
18
+ validates_each
19
+ validates_with
15
20
  validates_acceptance_of
16
21
  validates_associated
17
22
  validates_confirmation_of
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excellent
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2009-08-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby_parser
16
- requirement: &70322483230640 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70322483230640
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '3.0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: sexp_processor
27
- requirement: &70322483229880 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '4.0'
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *70322483229880
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '4.0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: hashr
38
- requirement: &70322483228960 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,7 +53,12 @@ dependencies:
43
53
  version: 0.0.10
44
54
  type: :runtime
45
55
  prerelease: false
46
- version_requirements: *70322483228960
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 0.0.10
47
62
  description: Excellent finds the nasty lines in your code. It implements a comprehensive
48
63
  set of checks for possibly buggy parts of your app that would otherwise make it
49
64
  into your repo and eventually to the production server.
@@ -53,9 +68,7 @@ executables:
53
68
  extensions: []
54
69
  extra_rdoc_files: []
55
70
  files:
56
- - MIT-LICENSE
57
71
  - README.md
58
- - History.txt
59
72
  - bin/excellent
60
73
  - lib/simplabs/excellent/checks/abc_metric_method_check.rb
61
74
  - lib/simplabs/excellent/checks/assignment_in_conditional_check.rb
@@ -152,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
165
  version: '0'
153
166
  requirements: []
154
167
  rubyforge_project:
155
- rubygems_version: 1.8.11
168
+ rubygems_version: 1.8.23
156
169
  signing_key:
157
170
  specification_version: 2
158
171
  summary: Source Code analysis gem for Ruby and Rails
data/History.txt DELETED
@@ -1,107 +0,0 @@
1
- =======
2
- = 2.0.0
3
-
4
- * now supporting config file .excellent.yml in current working directory to configure which specs to run/ not to run with thresholds, patterns etc.
5
- * predefined globals will not be reported anymore ($!, $@, $&, $`, $', $+, $1, $2.., $~, $=, $/, $\, $,, $;, $., $<, $>, $_, $0, $*, $$, $?, $:, $", $DEBUG, $FILENAME, $LOAD_PATH, $stdin, $stdout, $stderr, $VERBOSE, option variables, $-0, $-a, $-d, $-F, $-i, $-I, $-l, $-p, $-v)
6
- * enabled previously disable checks again: AbcMetricMethodCheck, ControlCouplingCheck, CyclomaticComplexityBlockCheck, CyclomaticComplexityMethodCheck, ForLoopCheck, FlogBlockCheck, FlogClassCheck, FlogMethodCheck
7
- * testing now uses Rspec 2
8
- * internal cleanups/ simplifications
9
-
10
- = 1.7.2
11
-
12
- * fixed Simplabs::Excellent::Checks::Rails::CustomInitializeMethodCheck
13
- * fixed Simplabs::Excellent::Checks::MethodNameCheck so it allows method names that exist in Ruby itself
14
- * fixed Simplabs::Excellent::Checks::GlobalVariableCheck so it doesn't report false positives for rescue bodies
15
- * made the parser more forgiving/stable in some situations
16
-
17
- = 1.7.1
18
-
19
- * fixed excellent for Ruby 2.0
20
- * some internal cleanup
21
- * support -v switch on command line
22
-
23
- = 1.7.0
24
-
25
- * fixed issue #24
26
- * updated ruby_parser and sexp_processor dependencies
27
- * fixed some wrong line number reports
28
-
29
- = 1.6.0
30
-
31
- * added Gemfile
32
- * internal refactoring/cleanups
33
-
34
- = 1.5.5
35
-
36
- * better option parsing in the executable, (thanks trans, http://github.com/trans)
37
- * added line count parser (not yet used), (thanks trans, http://github.com/trans)
38
-
39
- = 1.5.4
40
-
41
- * fixed handling of parser errors
42
-
43
- = 1.5.3
44
-
45
- * added missing dependency to facets gem
46
-
47
- = 1.5.2
48
-
49
- * added GlobalVariableCheck
50
- * added Rails::CustomInitializeMethodCheck
51
- * added Rails::ParamsHashInViewCheck
52
- * added Rails::SessionHashInViewCheck
53
-
54
- = 1.5.1
55
-
56
- * removed duplication checks (they are just too coarse for dynamic languages like Ruby and especially Rails apps where you would call e.g. params all over the place)
57
- * added Rails::ValidationsCheck to the default checks
58
-
59
- = 1.5.0
60
-
61
- * new check Rails::ValidationsCheck that reports ActiveRecord models that do not validate anything
62
- * added DuplicationCheck to default checks
63
- * split DuplicationCheck up into MethodDuplicationCheck and BlockDuplicationCheck
64
-
65
- = 1.4.1
66
-
67
- * added Rake Task (see Rakefile for example)
68
-
69
- = 1.4.0
70
-
71
- * Excellent not parses *.erb files
72
- * added new check InstanceVarInPartialCheck
73
-
74
- = 1.3.1
75
-
76
- * FIX (forgot files in gemspec on 1.3.0)
77
-
78
- = 1.3.0
79
-
80
- * added formatters (currently text and HTML formatting is supported, see README)
81
-
82
- = 1.2.2
83
-
84
- * fixed specs
85
-
86
- = 1.2.1
87
-
88
- * renamed Error to Warning
89
- * added documentation
90
-
91
- = 1.2.0
92
-
93
- * cleanup
94
- * added 2 Rails specific checks, AttrAccessibleCheck and AttrProtectedCheck
95
-
96
- = 1.1.0
97
-
98
- * completely restructured, made everything running in the flow of the SexpProcessor
99
- * added most tests from reek (except for UtilityFunction and FeatureEnvy)
100
-
101
- = 1.0.1
102
-
103
- * fixed some errors
104
-
105
- = 1.0.0
106
-
107
- * this is basically just a custom version of roodi, converted to ruby_parser to be 1.9 safe
data/MIT-LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright (c) 2008-2009 Marco Otte-Witte
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.