Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/ci #1

Merged
merged 4 commits into from
Mar 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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