Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Ensure ruby uses top-level WebSocket constant in client.rb. Provides em-websocket compatibility. #1

Merged
merged 1 commit into from

2 participants

@DanKnox

This commit enables compatibility with the em-websocket server gem.

The em-websocket gem adds a WebSocket module under the EventMachine
namespace. The client.rb file references the WebSocket constant while
executing within the EventMachine namespace. Once em-websocket is
required, client.rb begins using the WebSocket module provided by
the em-websocket gem instead of the correct top-level constant that
it expects, resulting in undefined method exceptions.

@DanKnox DanKnox Ensure ruby uses top-level WebSocket constant in client.rb
This commit enables compatibility with the em-websocket server gem.

The em-websocket gem adds a WebSocket module under the EventMachine
namespace. The client.rb file references the WebSocket constant while
executing within the EventMachine namespace. Once em-websocket is
required, client.rb begins using the WebSocket module provided by
the em-websocket gem instead of the correct top-level constant that
it expects, resulting in undefined method exceptions.
60ebcba
@imanel imanel merged commit 5bd9d86 into imanel:master
@imanel
Owner

Thanks - released as version 1.0.1 bugfix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 25, 2012
  1. @DanKnox

    Ensure ruby uses top-level WebSocket constant in client.rb

    DanKnox authored
    This commit enables compatibility with the em-websocket server gem.
    
    The em-websocket gem adds a WebSocket module under the EventMachine
    namespace. The client.rb file references the WebSocket constant while
    executing within the EventMachine namespace. Once em-websocket is
    required, client.rb begins using the WebSocket module provided by
    the em-websocket gem instead of the correct top-level constant that
    it expects, resulting in undefined method exceptions.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/websocket/eventmachine/client.rb
View
6 lib/websocket/eventmachine/client.rb
@@ -53,7 +53,7 @@ def initialize(args)
# @private
def post_init
@state = :connecting
- @handshake = WebSocket::Handshake::Client.new(@args)
+ @handshake = ::WebSocket::Handshake::Client.new(@args)
end
# Called by EventMachine after connecting.
@@ -67,11 +67,11 @@ def connection_completed
private
def incoming_frame
- WebSocket::Frame::Incoming::Client
+ ::WebSocket::Frame::Incoming::Client
end
def outgoing_frame
- WebSocket::Frame::Outgoing::Client
+ ::WebSocket::Frame::Outgoing::Client
end
public
Something went wrong with that request. Please try again.