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

[CSC] Sexp#meth_name -> Sexp#method_name

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