Class: Zoom::SecurityProfile::UnsafeRuby

Inherits:
Zoom::SecurityProfile show all
Defined in:
lib/zoom/profile/unsafe_ruby.rb

Instance Method Summary collapse

Constructor Details

#initialize(n = nil, o = nil, f = nil, b = nil, a = nil) ⇒ UnsafeRuby

Returns a new instance of UnsafeRuby.



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/zoom/profile/unsafe_ruby.rb', line 2

def initialize(n = nil, o = nil, f = nil, b = nil, a = nil)
    case Zoom::ProfileManager.default_profile
    when /^ack(-grep)?$/
        f ||= "--smart-case --ruby"
    when "ag", "pt"
        f ||= [
            "-S",
            "-G \"\\.(erb|r(ake|b|html|js|xml)|spec)$|Rakefile\""
        ].join(" ")
    when "grep"
        f ||= [
            "-i",
            "--include=\"*.erb\"",
            "--include=\"*.rake\"",
            "--include=\"*.rb\"",
            "--include=\"*.rhtml\"",
            "--include=\"*.rjs\"",
            "--include=\"*.rxml\"",
            "--include=\"*.spec\"",
            "--include=\"Rakefile\""
        ].join(" ")
    end

    super(n, nil, f, b, a)
    @pattern = [
        "%x\\(",
        "|",
        "\\.constantize",
        "|",
        "(^|[^\\nA-Za-z_])",
        "(",
        [
            "instance_eval",
            "(public_)?send",
            "system",
        ].join("|"),
        ")"
    ].join
    @taggable = true
end