Sha256: 4100d3cfc32b69e14fdc3a0f8f0791170bfa8d37b31557ff57a5d8d768198db1

Contents?: true

Size: 1.02 KB

Versions: 11

Compression:

Stored size: 1.02 KB

Contents

module Spider
   
   module Master
       
       def self.scout_plugins
           path = Spider.conf.get('master.scout_plugins_path')
           return [] unless path
           res = []
           Dir.new(path).each do |dir|
               next if dir[0].chr == '.'
               next unless File.directory?(File.join(path, dir))
               res << dir
           end
           res
       end
       
       def self.url_for_server(id)
           id = id.id if id.is_a?(Spider::Model::BaseModel)
           server = Server.new(id)
           "#{self.url}/servers/#{server.id}"
       end
       
       def self.url_for_plugin(id)
           id = id.id if id.is_a?(Spider::Model::BaseModel)
           instance = ScoutPluginInstance.new(id)
           "#{self.url}/servers/#{instance.server.id}/plugins/#{id}"
       end
       
       def self.add_site_type(type)
           @site_types ||= []
           @site_types << type
       end
       
       def self.site_types
           @site_types ||= []
       end
       
   end
    
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
spiderfw-0.6.16 apps/master/master.rb
spiderfw-0.6.15 apps/master/master.rb
spiderfw-0.6.14 apps/master/master.rb
spiderfw-0.6.13 apps/master/master.rb
spiderfw-0.6.12 apps/master/master.rb
spiderfw-0.6.11 apps/master/master.rb
spiderfw-0.6.10 apps/master/master.rb
spiderfw-0.6.9 apps/master/master.rb
spiderfw-0.6.8 apps/master/master.rb
spiderfw-0.6.7 apps/master/master.rb
spiderfw-0.6.6 apps/master/master.rb