Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
47 lines (42 sloc)
1.22 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "em-http-request" | |
require "em-websocket" | |
require "multi_json" | |
require "openssl" | |
require "thin" | |
require "pusher-fake/channel" | |
require "pusher-fake/channel/public" | |
require "pusher-fake/channel/private" | |
require "pusher-fake/channel/presence" | |
require "pusher-fake/configuration" | |
require "pusher-fake/connection" | |
require "pusher-fake/server" | |
require "pusher-fake/server/application" | |
require "pusher-fake/webhook" | |
module PusherFake | |
# The current version string. | |
VERSION = "0.12.0" | |
# Call this method to modify the defaults. | |
# | |
# @example | |
# PusherFake.configure do |configuration| | |
# configuration.port = 443 | |
# end | |
# | |
# @yield [Configuration] The current configuration. | |
def self.configure | |
yield(configuration) | |
end | |
# @return [Configuration] Current configuration. | |
def self.configuration | |
@configuration ||= Configuration.new | |
end | |
# Convenience method for the JS to override the Pusher client host and port. | |
# | |
# @param [Hash] options Custom options for Pusher client. | |
# @return [String] JavaScript overriding the Pusher client host and port. | |
def self.javascript(options = {}) | |
<<-EOS | |
new Pusher(#{configuration.key.to_json}, #{configuration.to_options(options).to_json}) | |
EOS | |
end | |
end |