Sha256: b5b0529bea11a8d8889912c3df0ff2cd42aab29f39520cd49db19d79dfeac32c

Contents?: true

Size: 849 Bytes

Versions: 10

Compression:

Stored size: 849 Bytes

Contents

require 'faye'
require 'faye-rails/version'
require 'faye-rails/routing_hooks'
require 'faye-rails/server_list'

module FayeRails
  ROOT = File.expand_path(File.dirname(__FILE__))

  if defined? ::Rails
    class Engine < ::Rails::Engine
    end
  end

  autoload :Controller,        File.join(ROOT, 'faye-rails', 'controller')
  autoload :RackAdapter,       File.join(ROOT, 'faye-rails', 'rack_adapter')
  autoload :Filter,            File.join(ROOT, 'faye-rails', 'filter')

  def self.servers
    @servers ||= ServerList.new
  end

  def self.server(where=nil)
    if where
      servers.at(where).first
    else
      servers.first
    end
  end

  def self.clients
    servers.map(&:get_client)
  end

  def self.client(where=nil)
    if where
      servers.at(where).first.get_client
    else
      servers.first.get_client
    end
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
faye-rails-1.0.10 lib/faye-rails.rb
faye-rails-1.0.8 lib/faye-rails.rb
faye-rails-1.0.7 lib/faye-rails.rb
faye-rails-1.0.6 lib/faye-rails.rb
faye-rails-1.0.5 lib/faye-rails.rb
faye-rails-1.0.4 lib/faye-rails.rb
faye-rails-1.0.3 lib/faye-rails.rb
faye-rails-1.0.2 lib/faye-rails.rb
faye-rails-1.0.1 lib/faye-rails.rb
faye-rails-1.0.0 lib/faye-rails.rb