Skip to content

Commit

Permalink
Merge 36e693a into 43ada29
Browse files Browse the repository at this point in the history
  • Loading branch information
genaromadrid committed Mar 26, 2018
2 parents 43ada29 + 36e693a commit 653ff99
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Metrics/ModuleLength:
Style/Documentation:
Enabled: false

Style/HashSyntax:
EnforcedStyle: ruby19

RSpec/ExampleLength:
Max: 10

Style/SafeNavigation:
Enabled: false
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: ruby
sudo: false
rvm:
- 2.1
- 2.2
- 2.3.0
- 2.5.0
notifications:
email:
on_success: change
on_failure: always
script:
- bundle exec rubocop
- bundle exec rspec
9 changes: 5 additions & 4 deletions em-pusher-client.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Gem::Specification.new do |spec|
spec.authors = ['Genaro Madrid']
spec.email = ['genmadrid@gmail.com']

spec.summary = 'Write a short summary, because RubyGems requires one.'
spec.description = 'Write a longer description or delete this line.'
spec.homepage = "TODO: Put your gem's website or public repo URL here."
spec.summary = 'Eventmachine pusher.com client'
spec.description = 'Subscribe to channels with eventmachine'
spec.homepage = 'https://github.com/genaromadrid/em-pusher-client'

# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
# to allow pushing to a single host or delete this section to allow pushing to any host.
Expand All @@ -34,10 +34,11 @@ Gem::Specification.new do |spec|
spec.add_dependency 'websocket', '~> 1.2.5'

spec.add_development_dependency 'bundler', '~> 1.16'
spec.add_development_dependency 'coveralls', '0.8.21'
spec.add_development_dependency 'pry', '~> 0.11'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.7'
spec.add_development_dependency 'rubocop', '~> 0.54'
spec.add_development_dependency 'rubocop-rspec', '~> 1.24'
spec.add_development_dependency 'simplecov', '~> 0.16'
spec.add_development_dependency 'simplecov', '~> 0.14'
end
6 changes: 3 additions & 3 deletions lib/em/pusher/client/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def post_init
end

def connection_completed
@connect&.yield
@connect.yield if @connect
@hs = ::WebSocket::Handshake::Client.new(
url: @url,
origin: @origin,
Expand Down Expand Up @@ -90,15 +90,15 @@ def send_msg(data, args = {})

def unbind
super
@disconnect&.call
@disconnect.call if @disconnect
end

private

def handle_received_data(data)
@frame << data
while (msg = @frame.next)
@stream&.call(EM::Pusher::Client::MsgParser.new(msg))
@stream.call(EM::Pusher::Client::MsgParser.new(msg)) if @stream
end
end
end
Expand Down
6 changes: 5 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# frozen_string_literal: true

require 'simplecov'
SimpleCov.start
require 'coveralls'
SimpleCov.start do
add_filter '/spec/'
end
Coveralls.wear!

require 'pry'
require 'em/pusher/client'
Expand Down

0 comments on commit 653ff99

Please sign in to comment.