提交 e8fbca25 编写于 作者: M Matthew Shanley

Changed all instances of the load_dependency method to load_brakeman_dependency.

Fixes #373
上级 d9210690
......@@ -153,7 +153,7 @@ module Brakeman
end
end
end
def self.get_formats_from_output_format output_format
case output_format
when :html, :to_html
......@@ -171,7 +171,7 @@ module Brakeman
end
end
private_class_method :get_formats_from_output_format
def self.get_formats_from_output_files output_files
output_files.map do |output_file|
case output_file
......@@ -196,7 +196,7 @@ module Brakeman
def self.list_checks
require 'brakeman/scanner'
format_length = 30
$stderr.puts "Available Checks:"
$stderr.puts "-" * format_length
Checks.checks.each do |check|
......@@ -307,7 +307,7 @@ module Brakeman
tracker
end
def self.write_report_to_files tracker, output_files
output_files.each_with_index do |output_file, idx|
File.open output_file, "w" do |f|
......@@ -317,7 +317,7 @@ module Brakeman
end
end
private_class_method :write_report_to_files
def self.write_report_to_formats tracker, output_formats
output_formats.each do |output_format|
puts tracker.report.format(output_format)
......@@ -375,7 +375,7 @@ module Brakeman
Brakeman::Differ.new(new_results, previous_results).diff
end
def self.load_dependency name
def self.load_brakeman_dependency name
return if @loaded_dependencies.include? name
begin
......
Brakeman.load_dependency 'erubis'
Brakeman.load_brakeman_dependency 'erubis'
#Erubis processor which ignores any output which is plain text.
class Brakeman::ScannerErubis < Erubis::Eruby
......
Brakeman.load_dependency 'erubis'
Brakeman.load_brakeman_dependency 'erubis'
#This is from the rails_xss plugin for Rails 2
class Brakeman::Rails2XSSPluginErubis < ::Erubis::Eruby
......
Brakeman.load_dependency 'erubis'
Brakeman.load_brakeman_dependency 'erubis'
#This is from Rails 3 version of the Erubis handler
class Brakeman::Rails3Erubis < ::Erubis::Eruby
......
Brakeman.load_dependency 'highline'
Brakeman.load_brakeman_dependency 'highline'
module Brakeman
class InteractiveIgnorer
......
Brakeman.load_dependency 'csv'
Brakeman.load_brakeman_dependency 'csv'
require "brakeman/report/initializers/faster_csv"
require "brakeman/report/report_table"
......
Brakeman.load_dependency 'multi_json'
Brakeman.load_brakeman_dependency 'multi_json'
require 'brakeman/report/initializers/multi_json'
class Brakeman::Report::JSON < Brakeman::Report::Base
......
Brakeman.load_dependency 'terminal-table'
Brakeman.load_brakeman_dependency 'terminal-table'
class Brakeman::Report::Table < Brakeman::Report::Base
def generate_report
......
......@@ -282,14 +282,14 @@ class Brakeman::Scanner
parsed = parse_ruby src
elsif type == :haml
Brakeman.load_dependency 'haml'
Brakeman.load_dependency 'sass'
Brakeman.load_brakeman_dependency 'haml'
Brakeman.load_brakeman_dependency 'sass'
src = Haml::Engine.new(text,
:escape_html => !!tracker.config[:escape_html]).precompiled
parsed = parse_ruby src
elsif type == :slim
Brakeman.load_dependency 'slim'
Brakeman.load_brakeman_dependency 'slim'
src = Slim::Template.new(:disable_capture => true,
:generator => Temple::Generators::RailsOutputBuffer) { text }.precompiled_template
......
......@@ -385,7 +385,7 @@ module Brakeman::Util
def truncate_table str
@terminal_width ||= if $stdin && $stdin.tty?
Brakeman.load_dependency 'highline'
Brakeman.load_brakeman_dependency 'highline'
::HighLine.new.terminal_size[0]
else
80
......@@ -403,7 +403,7 @@ module Brakeman::Util
# rely on Terminal::Table to build the structure, extract the data out in CSV format
def table_to_csv table
Brakeman.load_dependency 'terminal-table'
Brakeman.load_brakeman_dependency 'terminal-table'
output = CSV.generate_line(table.headings.cells.map{|cell| cell.to_s.strip})
table.rows.each do |row|
output << CSV.generate_line(row.cells.map{|cell| cell.to_s.strip})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册