Sha256: ef14836dd3aa8faede8ffc8b5afb12c443121902688314e2b782e034c1a1d691

Contents?: true

Size: 931 Bytes

Versions: 2

Compression:

Stored size: 931 Bytes

Contents

# This is a hacked up (and old) version of jcoglan's excellent Faye library.
# Hacks include adding cookie support (so we can use the cookies from a rails login),
# and avoiding use of em-http-request

require 'forwardable'
require 'observer'
require 'set'
require 'rubygems'
require 'eventmachine'

module Faye
  VERSION = '0.3.2'
  
  ROOT = File.expand_path(File.dirname(__FILE__))
  
  BAYEUX_VERSION   = '1.0'
  ID_LENGTH        = 128
  JSONP_CALLBACK   = 'jsonpcallback'
  CONNECTION_TYPES = %w[long-polling callback-polling]
  
  %w[ timeouts grammar namespace
      server channel connection
      error client transport
  ].each do |lib|
    require File.join(ROOT, 'faye', lib)
  end
  
  autoload :RackAdapter, File.join(ROOT, 'faye', 'rack_adapter')
  
  def self.random(bitlength = ID_LENGTH)
    field  = 2 ** bitlength
    strlen = bitlength / 4
    ("%0#{strlen}s" % rand(field).to_s(16)).gsub(' ', '0')
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
goshrine_bot-0.1.1 lib/goshrine_bot/faye.rb
goshrine_bot-0.1.0 lib/goshrine_bot/faye.rb