Sha256: a13a5ef493c0edb7c71d4d01f3f7ffa9aa2e754c39d344707154c49e940798e4

Contents?: true

Size: 1.03 KB

Versions: 12

Compression:

Stored size: 1.03 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_servant(id)
           id = id.id if id.is_a?(Spider::Model::BaseModel)
           servant = Servant.new(id)
           "#{self.url}/servants/#{servant.id}"
       end
       
       def self.url_for_plugin(id)
           id = id.id if id.is_a?(Spider::Model::BaseModel)
           instance = ScoutPluginInstance.new(id)
           "#{self.url}/servants/#{instance.servant.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

12 entries across 12 versions & 1 rubygems

Version Path
spiderfw-0.6.5 apps/master/master.rb
spiderfw-0.6.4 apps/master/master.rb
spiderfw-0.6.3 apps/master/master.rb
spiderfw-0.6.2 apps/master/master.rb
spiderfw-0.6.1 apps/master/master.rb
spiderfw-0.6.0 apps/master/master.rb
spiderfw-0.5.19 apps/master/master.rb
spiderfw-0.5.18 apps/master/master.rb
spiderfw-0.5.17 apps/master/master.rb
spiderfw-0.5.16 apps/master/master.rb
spiderfw-0.5.15 apps/master/master.rb
spiderfw-0.5.14 apps/master/master.rb