Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
社会瑞弟呀
brakeman
提交
a593ed85
B
brakeman
项目概览
社会瑞弟呀
/
brakeman
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
brakeman
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a593ed85
编写于
1月 16, 2012
作者:
J
Justin Collins
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some more documentation for Brakeman module
上级
b79af994
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
0 deletion
+19
-0
lib/brakeman.rb
lib/brakeman.rb
+19
-0
未找到文件。
lib/brakeman.rb
浏览文件 @
a593ed85
...
...
@@ -50,6 +50,7 @@ module Brakeman
scan
options
end
#Sets up options for run, checks given application path
def
self
.
set_options
options
if
options
.
is_a?
String
options
=
{
:app_path
=>
options
}
...
...
@@ -73,6 +74,7 @@ module Brakeman
options
end
#Load options from YAML file
def
self
.
load_options
config_file
config_file
||=
""
...
...
@@ -99,6 +101,7 @@ module Brakeman
return
{}
end
#Default set of options
def
self
.
get_defaults
{
:skip_checks
=>
Set
.
new
,
:check_arguments
=>
true
,
...
...
@@ -116,6 +119,8 @@ module Brakeman
}
end
#Determine output format based on options[:output_format]
#or options[:output_file]
def
self
.
get_output_format
options
#Set output format
if
options
[
:output_format
]
...
...
@@ -147,6 +152,7 @@ module Brakeman
end
end
#Output list of checks (for `-k` option)
def
self
.
list_checks
require
'brakeman/scanner'
$stderr
.
puts
"Available Checks:"
...
...
@@ -154,6 +160,9 @@ module Brakeman
$stderr
.
puts
Checks
.
checks
.
map
{
|
c
|
c
.
to_s
.
match
(
/^Brakeman::(.*)$/
)[
1
]
}.
sort
.
join
"
\n
"
end
#Installs Rake task for running Brakeman,
#which basically means copying `lib/brakeman/brakeman.rake` to
#`lib/tasks/brakeman.rake` in the current Rails application.
def
self
.
install_rake_task
if
not
File
.
exists?
"Rakefile"
abort
"No Rakefile detected"
...
...
@@ -180,6 +189,7 @@ module Brakeman
end
end
#Output configuration to YAML
def
self
.
dump_config
options
if
options
[
:create_config
].
is_a?
String
file
=
options
[
:create_config
]
...
...
@@ -206,6 +216,7 @@ module Brakeman
exit
end
#Run a scan. Generally called from Brakeman.run instead of directly.
def
self
.
scan
options
#Load scanner
warn
"Loading scanner..."
...
...
@@ -256,6 +267,14 @@ module Brakeman
tracker
end
#Rescan a subset of files in a Rails application.
#
#A full scan must have been run already to use this method.
#The returned Tracker object from Brakeman.run is used as a starting point
#for the rescan.
#
#This method returns a RescanReport object with information about the scan.
#However, the Tracker object will also be modified as the scan is run.
def
self
.
rescan
tracker
,
files
require
'brakeman/rescanner'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录