code_analyzer 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/lib/code_analyzer/checking_visitor/default.rb +2 -6
- data/lib/code_analyzer/checking_visitor/plain.rb +1 -1
- data/lib/code_analyzer/version.rb +1 -1
- data/spec/code_analyzer/checking_visitor/plain_spec.rb +3 -1
- metadata +15 -28
- data/.rvmrc +0 -2
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: acb16ff0641c7cecd7c88ba37acccd70096bfd07
|
4
|
+
data.tar.gz: cc27133da8f3b783580002ef92b2b6f514e58c8a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0542120dedeb3c25c3038d89f12c2538c899630cf7d0f2e0bd2699d37a161b5ec46f7bae9e45a3e784af269fbaf13c8ef85cff8ee0e12dee40316b41d9f488c3
|
7
|
+
data.tar.gz: 66375301eae5426ff0585bffe9aa182e501bc89f89505c52575a260feeff8388c03a9c1f0b5804f6e8b116c8d7d3c02331e5b8cc36b8b91e74b7b93bd8507e03
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
code_analyzer
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.0.0-p0
|
@@ -52,18 +52,14 @@ module CodeAnalyzer::CheckingVisitor
|
|
52
52
|
def check_node(node)
|
53
53
|
checkers = @checks[node.sexp_type]
|
54
54
|
if checkers
|
55
|
-
checkers.each { |checker|
|
56
|
-
checker.node_start(node) if checker.parse_file?(node.file)
|
57
|
-
}
|
55
|
+
checkers.each { |checker| checker.node_start(node) if checker.parse_file?(node.file) }
|
58
56
|
end
|
59
57
|
node.children.each { |child_node|
|
60
58
|
child_node.file = node.file
|
61
59
|
child_node.check(self)
|
62
60
|
}
|
63
61
|
if checkers
|
64
|
-
checkers.each { |checker|
|
65
|
-
checker.node_end(node) if checker.parse_file?(node.file)
|
66
|
-
}
|
62
|
+
checkers.each { |checker| checker.node_end(node) if checker.parse_file?(node.file) }
|
67
63
|
end
|
68
64
|
end
|
69
65
|
end
|
@@ -8,7 +8,7 @@ module CodeAnalyzer::CheckingVisitor
|
|
8
8
|
# @param [String] content is the content of ruby file.
|
9
9
|
def check(filename, content)
|
10
10
|
@checkers.each do |checker|
|
11
|
-
checker.check(filename, content)
|
11
|
+
checker.check(filename, content) if checker.parse_file?(filename)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -9,7 +9,9 @@ module CodeAnalyzer::CheckingVisitor
|
|
9
9
|
it "should check by all checkers" do
|
10
10
|
filename = "filename"
|
11
11
|
content = "content"
|
12
|
-
checker1.should_receive(:
|
12
|
+
checker1.should_receive(:parse_file?).and_return(false)
|
13
|
+
checker2.should_receive(:parse_file?).and_return(true)
|
14
|
+
checker1.should_not_receive(:check).with(filename, content)
|
13
15
|
checker2.should_receive(:check).with(filename, content)
|
14
16
|
|
15
17
|
visitor.check(filename, content)
|
metadata
CHANGED
@@ -1,62 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: code_analyzer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
5
|
-
prerelease:
|
4
|
+
version: 0.3.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Richard Huang
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-06-14 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: sexp_processor
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rspec
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rake
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
description: a code analyzer tool which extracted from rails_best_practices, it helps
|
@@ -69,7 +62,8 @@ extra_rdoc_files: []
|
|
69
62
|
files:
|
70
63
|
- .gitignore
|
71
64
|
- .rspec
|
72
|
-
- .
|
65
|
+
- .ruby-gemset
|
66
|
+
- .ruby-version
|
73
67
|
- .travis.yml
|
74
68
|
- Gemfile
|
75
69
|
- LICENSE
|
@@ -97,33 +91,26 @@ files:
|
|
97
91
|
- spec/spec_helper.rb
|
98
92
|
homepage: https://github.com/flyerhzm/code_analyzer
|
99
93
|
licenses: []
|
94
|
+
metadata: {}
|
100
95
|
post_install_message:
|
101
96
|
rdoc_options: []
|
102
97
|
require_paths:
|
103
98
|
- lib
|
104
99
|
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
100
|
requirements:
|
107
|
-
- -
|
101
|
+
- - '>='
|
108
102
|
- !ruby/object:Gem::Version
|
109
103
|
version: '0'
|
110
|
-
segments:
|
111
|
-
- 0
|
112
|
-
hash: -3700642731172846945
|
113
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
|
-
none: false
|
115
105
|
requirements:
|
116
|
-
- -
|
106
|
+
- - '>='
|
117
107
|
- !ruby/object:Gem::Version
|
118
108
|
version: '0'
|
119
|
-
segments:
|
120
|
-
- 0
|
121
|
-
hash: -3700642731172846945
|
122
109
|
requirements: []
|
123
110
|
rubyforge_project:
|
124
|
-
rubygems_version:
|
111
|
+
rubygems_version: 2.0.3
|
125
112
|
signing_key:
|
126
|
-
specification_version:
|
113
|
+
specification_version: 4
|
127
114
|
summary: a code analyzer helps you build your own code analyzer tool.
|
128
115
|
test_files:
|
129
116
|
- spec/code_analyzer/checker_spec.rb
|
data/.rvmrc
DELETED