提交 6ba67d5e 编写于 作者: J Justin Collins

[CSC] Sexp#meth_name -> Sexp#method_name

上级 ac19e657
......@@ -76,7 +76,7 @@ class Brakeman::CheckSingleQuotes < Brakeman::BaseCheck
#
# def html_escape
def process_defn exp
if @inside_util and exp.meth_name == :html_escape
if @inside_util and exp.method_name == :html_escape
@inside_html_escape = true
process exp.body
@inside_html_escape = false
......
......@@ -77,7 +77,7 @@ class Brakeman::ControllerAliasProcessor < Brakeman::AliasProcessor
#Processes a method definition, which may include
#processing any rendered templates.
def process_methdef exp
meth_name = exp.meth_name
meth_name = exp.method_name
#Skip if instructed to only process a specific method
#(but don't skip if this method was called from elsewhere)
......
......@@ -124,7 +124,7 @@ class Brakeman::ControllerProcessor < Brakeman::BaseProcessor
#Process method definition and store in Tracker
def process_defn exp
name = exp.meth_name
name = exp.method_name
@current_method = name
res = Sexp.new :methdef, name, process(exp[2]), process(exp.body.block)
res.line(exp.line)
......@@ -136,7 +136,7 @@ class Brakeman::ControllerProcessor < Brakeman::BaseProcessor
#Process self.method definition and store in Tracker
def process_defs exp
name = exp.meth_name
name = exp.method_name
if exp[1].node_type == :self
if @controller
......
......@@ -102,9 +102,9 @@ class Brakeman::LibraryProcessor < Brakeman::BaseProcessor
exp.node_type = :methdef
if @current_class
@current_class[:public][exp.meth_name] = exp
@current_class[:public][exp.method_name] = exp
elsif @current_module
@current_module[:public][exp.meth_name] = exp
@current_module[:public][exp.method_name] = exp
end
exp
......@@ -115,9 +115,9 @@ class Brakeman::LibraryProcessor < Brakeman::BaseProcessor
exp.node_type = :selfdef
if @current_class
@current_class[:public][exp.meth_name] = exp
@current_class[:public][exp.method_name] = exp
elsif @current_module
@current_module[:public][exp.meth_name] = exp
@current_module[:public][exp.method_name] = exp
end
exp
......
......@@ -99,7 +99,7 @@ class Brakeman::ModelProcessor < Brakeman::BaseProcessor
#Add method definition to tracker
def process_defn exp
return exp unless @model
name = exp.meth_name
name = exp.method_name
@current_method = name
res = Sexp.new :methdef, name, exp[2], process(exp.body.value)
......@@ -115,7 +115,7 @@ class Brakeman::ModelProcessor < Brakeman::BaseProcessor
#Add method definition to tracker
def process_defs exp
return exp unless @model
name = exp.meth_name
name = exp.method_name
if exp[1].node_type == :self
target = @model[:name]
......
......@@ -316,7 +316,7 @@ class Sexp
end
#Returns name of method being defined in a method definition.
def meth_name
def method_name
expect :defn, :defs, :methdef, :selfdef
case self.node_type
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册