ld-celluloid-eventsource 0.8.0 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8be57755b8e9109f162424b0bfc717494646820b
4
- data.tar.gz: 4e99b0dfcca684ffc8b7f5404834c76dbf2bbc60
3
+ metadata.gz: 288de259557b7071ab952b7df40df3e2b8587f19
4
+ data.tar.gz: 3edd6ecf59ea11f86e6566694097803fe74b70bd
5
5
  SHA512:
6
- metadata.gz: 7ba0c333067e2bcb0eda60c5df2d73bf75112bbc80f776f09cc33febd7700d977c034552c3fafad7daa4f7fb35b8277d8ffaf3f4f5238dc7b5644d6fc5d093dc
7
- data.tar.gz: 3066e8834456d81e6f3a8191d922331e313f18f21522b9a0bfc39560eeb372734b1f518aa13a641edacf0d3ace029649139cf55f611ddd3b11fecc06067ad7b3
6
+ metadata.gz: 91a01ad04de73834ccf18831b1acb5d784de31e2101c995082004e3c41b901adecbb31eef9f0a234059fae879093007aa76b67a3e1b313e508b4b366add12b5d
7
+ data.tar.gz: 039ddf8432791cefed4e82e6b60457fc984277373f42c284747acf62633b15a3f493b4b8c9ff6f9499de62fbe5496f1bfa14ce80ae94d70dfc90079b212077ec
data/Contributing.md ADDED
@@ -0,0 +1,8 @@
1
+ # Celluloid::Eventsource
2
+
3
+ To release:
4
+ 1. Bump version in version.rb
5
+ 1. Commit changes and tag with version: ie 0.9.0
6
+ 1. `gem build ld-celluloid-eventsource.gemspec`
7
+ 1. `gem push ld-celluloid-eventsource-<version>.gem`
8
+ 1. Release on Github
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'ld_celluloid_eventsource/version'
4
+ require 'celluloid/eventsource/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "ld-celluloid-eventsource"
@@ -19,8 +19,9 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency 'celluloid-io', '~> 0.17.3'
22
+ spec.add_dependency 'nio4r', '~> 1.1'
22
23
  spec.add_dependency 'http_parser.rb', '~> 0.6.0'
23
- spec.add_dependency 'concurrent-ruby', '~> 1.0.4'
24
+ spec.add_dependency 'concurrent-ruby', '~> 1.0'
24
25
  spec.add_dependency 'retries', '~> 0.0.5'
25
26
 
26
27
  spec.add_development_dependency "rspec", '~> 3.0'
@@ -1,5 +1,5 @@
1
1
  module Celluloid
2
2
  class EventSource
3
- VERSION = "0.8.0"
3
+ VERSION = "0.8.3"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  require 'celluloid/current'
2
- require "celluloid/eventsource/version"
2
+ require 'celluloid/eventsource/version'
3
3
  require 'celluloid/io'
4
4
  require 'celluloid/eventsource/response_parser'
5
5
  require 'concurrent'
@@ -41,7 +41,7 @@ module Celluloid
41
41
  @last_event_id = String.new
42
42
 
43
43
  @reconnect_timeout = 1
44
- @on = { open: ->{}, message: ->(_) {}}
44
+ @on = { open: ->{}, message: ->(_) {}, error: ->(_) {}}
45
45
  @parser = ResponseParser.new
46
46
 
47
47
  @chunked = false
@@ -103,6 +103,10 @@ module Celluloid
103
103
  @on[:message] = action
104
104
  end
105
105
 
106
+ def on_error(&action)
107
+ @on[:error] = action
108
+ end
109
+
106
110
  private
107
111
 
108
112
  MessageEvent = Struct.new(:type, :data, :last_event_id)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ld-celluloid-eventsource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leo Correa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-11 00:00:00.000000000 Z
11
+ date: 2017-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: celluloid-io
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.17.3
27
+ - !ruby/object:Gem::Dependency
28
+ name: nio4r
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: http_parser.rb
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +58,14 @@ dependencies:
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: 1.0.4
61
+ version: '1.0'
48
62
  type: :runtime
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: 1.0.4
68
+ version: '1.0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: retries
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -133,14 +147,15 @@ files:
133
147
  - ".gitignore"
134
148
  - ".rspec"
135
149
  - ".travis.yml"
150
+ - Contributing.md
136
151
  - Gemfile
137
152
  - LICENSE
138
153
  - README.md
139
154
  - Rakefile
140
155
  - ld-celluloid-eventsource.gemspec
141
- - lib/ld_celluloid_eventsource/eventsource.rb
142
- - lib/ld_celluloid_eventsource/response_parser.rb
143
- - lib/ld_celluloid_eventsource/version.rb
156
+ - lib/celluloid/eventsource.rb
157
+ - lib/celluloid/eventsource/response_parser.rb
158
+ - lib/celluloid/eventsource/version.rb
144
159
  - log/.gitignore
145
160
  - spec/celluloid/eventsource/response_parser_spec.rb
146
161
  - spec/celluloid/eventsource_spec.rb