code_analyzer 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/code_analyzer.gemspec +1 -0
- data/lib/code_analyzer/sexp.rb +2 -2
- data/lib/code_analyzer/version.rb +1 -1
- data/spec/code_analyzer/sexp_spec.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 181ca088af7fc724c6d7a7085e3dd50b90d31a49
|
4
|
+
data.tar.gz: 70b0d7541e77386f21d5fc0e99ae0176beaa8aaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eea1a16c0f746a013ebf8b2a7a8cd46178aa5e2e3151ecd43d2a7977af4472bd1f5d18eaa7c842c70ed3bc598d5af1465cc9ec2efa03ea4b5a6e6dfaa3a6b85
|
7
|
+
data.tar.gz: 3b61e0c6959affae821256498031bd124f05ba6140e970f47a6a196155f43f4ca121a3c93c28ae88373fd6a62067b444bbf122cdaadb2482fdd37ca9c5a82a4d
|
data/code_analyzer.gemspec
CHANGED
@@ -7,6 +7,7 @@ Gem::Specification.new do |gem|
|
|
7
7
|
gem.description = %q{a code analyzer tool which extracted from rails_best_practices, it helps you easily build your own code analyzer tool.}
|
8
8
|
gem.summary = %q{a code analyzer helps you build your own code analyzer tool.}
|
9
9
|
gem.homepage = "https://github.com/flyerhzm/code_analyzer"
|
10
|
+
gem.license = 'MIT'
|
10
11
|
|
11
12
|
gem.files = `git ls-files`.split($\)
|
12
13
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
data/lib/code_analyzer/sexp.rb
CHANGED
@@ -465,7 +465,7 @@ class Sexp
|
|
465
465
|
# )
|
466
466
|
#
|
467
467
|
# @return [Sexp] body node
|
468
|
-
def
|
468
|
+
def block_node
|
469
469
|
case sexp_type
|
470
470
|
when :method_add_block
|
471
471
|
self[2]
|
@@ -872,7 +872,7 @@ class Sexp
|
|
872
872
|
|
873
873
|
# if the return value of these methods is nil, then return CodeAnalyzer::Nil.new instead
|
874
874
|
[:sexp_type, :receiver, :message, :arguments, :argument, :class_name, :base_class, :method_name,
|
875
|
-
:body, :
|
875
|
+
:body, :block_node, :conditional_statement, :left_value, :right_value].each do |method|
|
876
876
|
class_eval <<-EOS
|
877
877
|
alias_method :origin_#{method}, :#{method}
|
878
878
|
|
@@ -439,7 +439,7 @@ describe Sexp do
|
|
439
439
|
describe "block" do
|
440
440
|
it "sould get block of method_add_block node" do
|
441
441
|
node = parse_content("resources :posts do; resources :comments; end").grep_node(sexp_type: :method_add_block)
|
442
|
-
node.
|
442
|
+
node.block_node.sexp_type.should == :do_block
|
443
443
|
end
|
444
444
|
end
|
445
445
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: code_analyzer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sexp_processor
|
@@ -90,7 +90,8 @@ files:
|
|
90
90
|
- spec/code_analyzer/warning_spec.rb
|
91
91
|
- spec/spec_helper.rb
|
92
92
|
homepage: https://github.com/flyerhzm/code_analyzer
|
93
|
-
licenses:
|
93
|
+
licenses:
|
94
|
+
- MIT
|
94
95
|
metadata: {}
|
95
96
|
post_install_message:
|
96
97
|
rdoc_options: []
|