pubsubstub 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.1
6
+ script: rspec spec
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Pubsubstub
2
2
 
3
+ [![Build Status](https://travis-ci.org/gmalette/pubsubstub.svg?branch=master)](https://travis-ci.org/gmalette/pubsubstub)
4
+
3
5
  Pubsubstub is a rack middleware to add Pub/Sub
4
6
 
5
7
  ## Installation
@@ -8,10 +8,10 @@ module Pubsubstub
8
8
  @connections = []
9
9
  end
10
10
 
11
- def subscribe(connection, last_event_id: nil)
11
+ def subscribe(connection, options = {})
12
12
  listen if @connections.empty?
13
13
  @connections << connection
14
- scrollback(connection, last_event_id)
14
+ scrollback(connection, options[:last_event_id])
15
15
  end
16
16
 
17
17
  def subscribed?(connection)
@@ -2,9 +2,9 @@ module Pubsubstub
2
2
  class Event
3
3
  attr_reader :id, :name, :data
4
4
 
5
- def initialize(data, name: nil, id: nil)
6
- @id = id || time_now
7
- @name = name
5
+ def initialize(data, options = {})
6
+ @id = options[:id] || time_now
7
+ @name = options[:name]
8
8
  @data = data
9
9
  end
10
10
 
@@ -1,3 +1,3 @@
1
1
  module Pubsubstub
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/pubsubstub.gemspec CHANGED
@@ -23,11 +23,9 @@ Gem::Specification.new do |spec|
23
23
  spec.add_dependency 'redis', "~> 3.0"
24
24
  spec.add_dependency 'eventmachine', "~> 1.0"
25
25
 
26
- spec.add_development_dependency "bundler", "~> 1.6"
26
+ spec.add_development_dependency "bundler", "~> 1.5"
27
27
  spec.add_development_dependency "rake", "~> 10.2"
28
28
  spec.add_development_dependency "rspec", "~> 2.14"
29
- spec.add_development_dependency "em-rspec", "~> 0.1"
30
29
  spec.add_development_dependency "pry", "~> 0.9"
31
30
  spec.add_development_dependency "thin", "~> 1.6"
32
-
33
31
  end
@@ -18,12 +18,6 @@ describe Pubsubstub::RedisPubSub do
18
18
  subject.publish("test", event)
19
19
  end
20
20
  end
21
-
22
- describe "#sub" do
23
- it "memoizes the connection" do
24
- expect(subject.send(:sub)).to be == subject.send(:sub)
25
- end
26
- end
27
21
  end
28
22
 
29
23
  context "pubsub" do
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'em-rspec'
2
- require 'pry'
3
1
  require_relative '../lib/pubsubstub'
4
2
  # This file was generated by the `rspec --init` command. Conventionally, all
5
3
  # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pubsubstub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Guillaume Malette
@@ -13,141 +14,145 @@ dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: sinatra
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - "~>"
19
+ - - ~>
18
20
  - !ruby/object:Gem::Version
19
21
  version: '1.4'
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - "~>"
27
+ - - ~>
25
28
  - !ruby/object:Gem::Version
26
29
  version: '1.4'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: em-hiredis
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - "~>"
35
+ - - ~>
32
36
  - !ruby/object:Gem::Version
33
37
  version: '0.2'
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - "~>"
43
+ - - ~>
39
44
  - !ruby/object:Gem::Version
40
45
  version: '0.2'
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: redis
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
- - - "~>"
51
+ - - ~>
46
52
  - !ruby/object:Gem::Version
47
53
  version: '3.0'
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
- - - "~>"
59
+ - - ~>
53
60
  - !ruby/object:Gem::Version
54
61
  version: '3.0'
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: eventmachine
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
- - - "~>"
67
+ - - ~>
60
68
  - !ruby/object:Gem::Version
61
69
  version: '1.0'
62
70
  type: :runtime
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - "~>"
75
+ - - ~>
67
76
  - !ruby/object:Gem::Version
68
77
  version: '1.0'
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: bundler
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
- - - "~>"
83
+ - - ~>
74
84
  - !ruby/object:Gem::Version
75
- version: '1.6'
85
+ version: '1.5'
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
- - - "~>"
91
+ - - ~>
81
92
  - !ruby/object:Gem::Version
82
- version: '1.6'
93
+ version: '1.5'
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: rake
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
- - - "~>"
99
+ - - ~>
88
100
  - !ruby/object:Gem::Version
89
101
  version: '10.2'
90
102
  type: :development
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
- - - "~>"
107
+ - - ~>
95
108
  - !ruby/object:Gem::Version
96
109
  version: '10.2'
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: rspec
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
- - - "~>"
115
+ - - ~>
102
116
  - !ruby/object:Gem::Version
103
117
  version: '2.14'
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
107
122
  requirements:
108
- - - "~>"
123
+ - - ~>
109
124
  - !ruby/object:Gem::Version
110
125
  version: '2.14'
111
- - !ruby/object:Gem::Dependency
112
- name: em-rspec
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '0.1'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '0.1'
125
126
  - !ruby/object:Gem::Dependency
126
127
  name: pry
127
128
  requirement: !ruby/object:Gem::Requirement
129
+ none: false
128
130
  requirements:
129
- - - "~>"
131
+ - - ~>
130
132
  - !ruby/object:Gem::Version
131
133
  version: '0.9'
132
134
  type: :development
133
135
  prerelease: false
134
136
  version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
135
138
  requirements:
136
- - - "~>"
139
+ - - ~>
137
140
  - !ruby/object:Gem::Version
138
141
  version: '0.9'
139
142
  - !ruby/object:Gem::Dependency
140
143
  name: thin
141
144
  requirement: !ruby/object:Gem::Requirement
145
+ none: false
142
146
  requirements:
143
- - - "~>"
147
+ - - ~>
144
148
  - !ruby/object:Gem::Version
145
149
  version: '1.6'
146
150
  type: :development
147
151
  prerelease: false
148
152
  version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
149
154
  requirements:
150
- - - "~>"
155
+ - - ~>
151
156
  - !ruby/object:Gem::Version
152
157
  version: '1.6'
153
158
  description: Pubsubstub can be added to a rack Application or deployed standalone.
@@ -158,8 +163,9 @@ executables: []
158
163
  extensions: []
159
164
  extra_rdoc_files: []
160
165
  files:
161
- - ".gitignore"
162
- - ".rspec"
166
+ - .gitignore
167
+ - .rspec
168
+ - .travis.yml
163
169
  - Gemfile
164
170
  - LICENSE.txt
165
171
  - README.md
@@ -178,30 +184,30 @@ files:
178
184
  homepage: https://github.com/gmalette/pubsubstub
179
185
  licenses:
180
186
  - MIT
181
- metadata: {}
182
187
  post_install_message:
183
188
  rdoc_options: []
184
189
  require_paths:
185
190
  - lib
186
191
  required_ruby_version: !ruby/object:Gem::Requirement
192
+ none: false
187
193
  requirements:
188
- - - ">="
194
+ - - ! '>='
189
195
  - !ruby/object:Gem::Version
190
196
  version: '0'
191
197
  required_rubygems_version: !ruby/object:Gem::Requirement
198
+ none: false
192
199
  requirements:
193
- - - ">="
200
+ - - ! '>='
194
201
  - !ruby/object:Gem::Version
195
202
  version: '0'
196
203
  requirements: []
197
204
  rubyforge_project:
198
- rubygems_version: 2.2.2
205
+ rubygems_version: 1.8.23
199
206
  signing_key:
200
- specification_version: 4
207
+ specification_version: 3
201
208
  summary: Pubsubstub is a rack middleware to add Pub/Sub
202
209
  test_files:
203
210
  - spec/channel_spec.rb
204
211
  - spec/event_spec.rb
205
212
  - spec/redis_pub_sub_spec.rb
206
213
  - spec/spec_helper.rb
207
- has_rdoc:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 88ea9eade9037b07b2c4692f4ecc33589b5ac76c
4
- data.tar.gz: 60575d29603abe6749b46bacbfbb6ef81cc03334
5
- SHA512:
6
- metadata.gz: 4e9b0d5967e309750bca8675f49ac64f36b1a5f899f561ea7ceefce96acc523cfb3d84cd72328e626d1ceb9fa1ad74c2393c7b9d52493ed84f7d2cbfa6c61699
7
- data.tar.gz: 1fa0683a8cdf8510c922c08cb8f1ab83daaf499dc4622a3d3f2551e6b3403a06ba9d17594fe94f07c2a6b77b2ad2edb57fa3cd2e7a90fb7b4dcce6c2fc8b6e7f