lib/brakeman/report.rb in brakeman-min-3.7.2 vs lib/brakeman/report.rb in brakeman-min-4.0.0
- old
+ new
@@ -4,11 +4,11 @@
#Tracker#run_checks. Be sure to +run_checks+ before generating
#a report.
class Brakeman::Report
attr_reader :tracker
- VALID_FORMATS = [:to_html, :to_pdf, :to_csv, :to_json, :to_tabs, :to_hash, :to_s, :to_markdown, :to_codeclimate, :to_plain]
+ VALID_FORMATS = [:to_html, :to_pdf, :to_csv, :to_json, :to_tabs, :to_hash, :to_s, :to_markdown, :to_codeclimate, :to_plain, :to_text]
def initialize app_tree, tracker
@app_tree = app_tree
@tracker = tracker
end
@@ -32,14 +32,14 @@
when :to_hash
require_report 'hash'
Brakeman::Report::Hash
when :to_markdown
return self.to_markdown
- when :to_plain
+ when :to_plain, :to_text, :to_s
return self.to_plain
- when :to_s
- return self.to_s
+ when :to_table
+ return self.to_table
when :to_pdf
raise "PDF output is not yet supported."
else
raise "Invalid format: #{format}. Should be one of #{VALID_FORMATS.inspect}"
end
@@ -62,23 +62,26 @@
def to_json
require_report 'json'
generate Brakeman::Report::JSON
end
- def to_s
+ def to_table
require_report 'table'
generate Brakeman::Report::Table
end
def to_markdown
require_report 'markdown'
generate Brakeman::Report::Markdown
end
- def to_plain
+ def to_text
require_report 'text'
generate Brakeman::Report::Text
end
+
+ alias to_plain to_text
+ alias to_s to_text
def generate reporter
reporter.new(@app_tree, @tracker).generate_report
end
end