Class: Zoom::ProfileManager

Inherits:
Object
  • Object
show all
Defined in:
lib/zoom/profile_manager.rb

Constant Summary collapse

@@ranking =
[
    ["ag", "Zoom::Profile::Ag", "-Su"],
    ["pt", "Zoom::Profile::Pt", "-SU --hidden"],
    ["ack", "Zoom::Profile::Ack", ""],
    ["ack-grep", "Zoom::Profile::Ack", ""],
    ["grep", "Zoom::Profile::Grep", "-ai"],
    ["find", "Zoom::Profile::Find", ""]
]

Class Method Summary collapse

Class Method Details

.default_profileObject



15
16
17
18
19
20
# File 'lib/zoom/profile_manager.rb', line 15

def self.default_profile
    @@ranking.each do |op, clas, all|
        return op if (ScoobyDoo.where_are_you(op))
    end
    return nil # shouldn't happen
end

.default_profilesObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/zoom/profile_manager.rb', line 22

def self.default_profiles
    profiles = Hash.new

    @@ranking.each do |op, clas, all|
        if (ScoobyDoo.where_are_you(op))
            name = op.gsub("-grep", "")
            obj = Zoom::Profile.profile_by_name(clas)
            profiles[name] = obj.new(name)
            if (!all.empty?)
                profiles["all"] ||= obj.new("all", name, all)
            end
        end
    end

    return profiles
end

.security_profilesObject



39
40
41
42
43
44
45
# File 'lib/zoom/profile_manager.rb', line 39

def self.security_profiles
    profs = Array.new
    Zoom::SecurityProfile.subclasses.each do |clas|
        profs.push(clas.new)
    end
    return profs
end