message_bus-client 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.hound.yml +2 -0
- data/.idea/message_bus-client.iml +9 -0
- data/.rspec +2 -0
- data/.rubocop.unhound.yml +244 -0
- data/.rubocop.yml +26 -0
- data/.travis.yml +6 -0
- data/Gemfile +4 -0
- data/README.md +55 -0
- data/Rakefile +6 -0
- data/lib/message_bus/client.rb +18 -0
- data/lib/message_bus/client/configuration.rb +15 -0
- data/lib/message_bus/client/connection.rb +120 -0
- data/lib/message_bus/client/message_handler.rb +94 -0
- data/lib/message_bus/client/version.rb +5 -0
- data/message_bus-client.gemspec +30 -0
- metadata +157 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 081e7cf743bcaaeaec287c69ea3e1788bc74a100
|
4
|
+
data.tar.gz: 3faec5f183ce24c022714bb0777d09146e8e3f72
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b47054d7731d6287cf42bdcd04bce993ff8cad3b6906473c76c5ab6e2a09993b497beff9592d2f857632d18ef1da9acc64e16711e377f0c4eeca2ec9edfd1a7f
|
7
|
+
data.tar.gz: 5f476af55289c22304c970081c1c22e285fbdcc9e420dace673f807cb5b7282982ff65dfc753db66a0c369b57114547c996b1a2754f1176b3bbef7066460f0f5
|
data/.gitignore
ADDED
data/.hound.yml
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
3
|
+
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
4
|
+
<exclude-output />
|
5
|
+
<content url="file://$MODULE_DIR$" />
|
6
|
+
<orderEntry type="inheritedJdk" />
|
7
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
8
|
+
</component>
|
9
|
+
</module>
|
data/.rspec
ADDED
@@ -0,0 +1,244 @@
|
|
1
|
+
AccessorMethodName:
|
2
|
+
Enabled: true
|
3
|
+
|
4
|
+
ActionFilter:
|
5
|
+
Enabled: true
|
6
|
+
|
7
|
+
Alias:
|
8
|
+
Enabled: true
|
9
|
+
|
10
|
+
ArrayJoin:
|
11
|
+
Enabled: true
|
12
|
+
|
13
|
+
AsciiComments:
|
14
|
+
Enabled: true
|
15
|
+
|
16
|
+
AsciiIdentifiers:
|
17
|
+
Enabled: true
|
18
|
+
|
19
|
+
Attr:
|
20
|
+
Enabled: true
|
21
|
+
|
22
|
+
BlockNesting:
|
23
|
+
Enabled: true
|
24
|
+
|
25
|
+
CaseEquality:
|
26
|
+
Enabled: true
|
27
|
+
|
28
|
+
CharacterLiteral:
|
29
|
+
Enabled: true
|
30
|
+
|
31
|
+
ClassAndModuleChildren:
|
32
|
+
Enabled: true
|
33
|
+
EnforcedStyle: compact
|
34
|
+
|
35
|
+
ClassLength:
|
36
|
+
Enabled: true
|
37
|
+
|
38
|
+
ClassVars:
|
39
|
+
Enabled: true
|
40
|
+
|
41
|
+
CollectionMethods:
|
42
|
+
Enabled: true
|
43
|
+
PreferredMethods:
|
44
|
+
reduce:
|
45
|
+
inject: 'reduce'
|
46
|
+
find:
|
47
|
+
detect: 'find'
|
48
|
+
|
49
|
+
ColonMethodCall:
|
50
|
+
Enabled: true
|
51
|
+
|
52
|
+
CommentAnnotation:
|
53
|
+
Enabled: true
|
54
|
+
|
55
|
+
CyclomaticComplexity:
|
56
|
+
Enabled: true
|
57
|
+
|
58
|
+
Delegate:
|
59
|
+
Enabled: true
|
60
|
+
|
61
|
+
DeprecatedHashMethods:
|
62
|
+
Enabled: true
|
63
|
+
|
64
|
+
DoubleNegation:
|
65
|
+
Enabled: true
|
66
|
+
|
67
|
+
EachWithObject:
|
68
|
+
Enabled: true
|
69
|
+
|
70
|
+
EmptyLiteral:
|
71
|
+
Enabled: true
|
72
|
+
|
73
|
+
Encoding:
|
74
|
+
Enabled: false
|
75
|
+
|
76
|
+
EvenOdd:
|
77
|
+
Enabled: true
|
78
|
+
|
79
|
+
ExtraSpacing:
|
80
|
+
Enabled: false
|
81
|
+
|
82
|
+
FileName:
|
83
|
+
Enabled: true
|
84
|
+
|
85
|
+
FlipFlop:
|
86
|
+
Enabled: true
|
87
|
+
|
88
|
+
FormatString:
|
89
|
+
Enabled: true
|
90
|
+
|
91
|
+
GlobalVars:
|
92
|
+
Enabled: true
|
93
|
+
|
94
|
+
GuardClause:
|
95
|
+
Enabled: true
|
96
|
+
|
97
|
+
IfUnlessModifier:
|
98
|
+
Enabled: true
|
99
|
+
|
100
|
+
IfWithSemicolon:
|
101
|
+
Enabled: true
|
102
|
+
|
103
|
+
InlineComment:
|
104
|
+
Enabled: false
|
105
|
+
|
106
|
+
Lambda:
|
107
|
+
Enabled: true
|
108
|
+
|
109
|
+
LambdaCall:
|
110
|
+
Enabled: true
|
111
|
+
|
112
|
+
LineEndConcatenation:
|
113
|
+
Enabled: true
|
114
|
+
|
115
|
+
MethodLength:
|
116
|
+
Enabled: true
|
117
|
+
|
118
|
+
ModuleFunction:
|
119
|
+
Enabled: true
|
120
|
+
|
121
|
+
NegatedIf:
|
122
|
+
Enabled: true
|
123
|
+
|
124
|
+
NegatedWhile:
|
125
|
+
Enabled: true
|
126
|
+
|
127
|
+
Next:
|
128
|
+
Enabled: true
|
129
|
+
|
130
|
+
NilComparison:
|
131
|
+
Enabled: true
|
132
|
+
|
133
|
+
Not:
|
134
|
+
Enabled: true
|
135
|
+
|
136
|
+
NumericLiterals:
|
137
|
+
Enabled: true
|
138
|
+
|
139
|
+
OneLineConditional:
|
140
|
+
Enabled: true
|
141
|
+
|
142
|
+
OpMethod:
|
143
|
+
Enabled: true
|
144
|
+
|
145
|
+
ParameterLists:
|
146
|
+
Enabled: true
|
147
|
+
|
148
|
+
PercentLiteralDelimiters:
|
149
|
+
Enabled: true
|
150
|
+
|
151
|
+
PerlBackrefs:
|
152
|
+
Enabled: true
|
153
|
+
|
154
|
+
PredicateName:
|
155
|
+
NamePrefixBlacklist: []
|
156
|
+
|
157
|
+
Proc:
|
158
|
+
Enabled: true
|
159
|
+
|
160
|
+
RaiseArgs:
|
161
|
+
Enabled: true
|
162
|
+
|
163
|
+
RegexpLiteral:
|
164
|
+
Enabled: true
|
165
|
+
|
166
|
+
SelfAssignment:
|
167
|
+
Enabled: true
|
168
|
+
|
169
|
+
SingleLineBlockParams:
|
170
|
+
Enabled: true
|
171
|
+
|
172
|
+
SingleLineMethods:
|
173
|
+
Enabled: true
|
174
|
+
|
175
|
+
SignalException:
|
176
|
+
Enabled: true
|
177
|
+
|
178
|
+
SpecialGlobalVars:
|
179
|
+
Enabled: true
|
180
|
+
|
181
|
+
VariableInterpolation:
|
182
|
+
Enabled: true
|
183
|
+
|
184
|
+
TrailingComma:
|
185
|
+
Enabled: true
|
186
|
+
|
187
|
+
TrivialAccessors:
|
188
|
+
Enabled: true
|
189
|
+
|
190
|
+
VariableInterpolation:
|
191
|
+
Enabled: true
|
192
|
+
|
193
|
+
WhenThen:
|
194
|
+
Enabled: true
|
195
|
+
|
196
|
+
WhileUntilModifier:
|
197
|
+
Enabled: true
|
198
|
+
|
199
|
+
# Lint
|
200
|
+
|
201
|
+
AmbiguousOperator:
|
202
|
+
Enabled: true
|
203
|
+
|
204
|
+
AmbiguousRegexpLiteral:
|
205
|
+
Enabled: true
|
206
|
+
|
207
|
+
AssignmentInCondition:
|
208
|
+
Enabled: true
|
209
|
+
|
210
|
+
ConditionPosition:
|
211
|
+
Enabled: true
|
212
|
+
|
213
|
+
DeprecatedClassMethods:
|
214
|
+
Enabled: true
|
215
|
+
|
216
|
+
ElseLayout:
|
217
|
+
Enabled: true
|
218
|
+
|
219
|
+
HandleExceptions:
|
220
|
+
Enabled: true
|
221
|
+
|
222
|
+
InvalidCharacterLiteral:
|
223
|
+
Enabled: true
|
224
|
+
|
225
|
+
LiteralInCondition:
|
226
|
+
Enabled: true
|
227
|
+
|
228
|
+
LiteralInInterpolation:
|
229
|
+
Enabled: true
|
230
|
+
|
231
|
+
Loop:
|
232
|
+
Enabled: true
|
233
|
+
|
234
|
+
ParenthesesAsGroupedExpression:
|
235
|
+
Enabled: true
|
236
|
+
|
237
|
+
RequireParentheses:
|
238
|
+
Enabled: true
|
239
|
+
|
240
|
+
UnderscorePrefixedVariableName:
|
241
|
+
Enabled: true
|
242
|
+
|
243
|
+
Void:
|
244
|
+
Enabled: true
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
inherit_from:
|
2
|
+
- .rubocop.unhound.yml
|
3
|
+
|
4
|
+
Metrics/LineLength:
|
5
|
+
Max: 100
|
6
|
+
|
7
|
+
Style/DotPosition:
|
8
|
+
EnforcedStyle: trailing
|
9
|
+
|
10
|
+
Style/Documentation:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
Style/IndentHash:
|
14
|
+
EnforcedStyle: consistent
|
15
|
+
|
16
|
+
Style/StringLiterals:
|
17
|
+
EnforcedStyle: single_quotes
|
18
|
+
|
19
|
+
Style/WordArray:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
Style/RegexpLiteral:
|
23
|
+
AllowInnerSlashes: true
|
24
|
+
|
25
|
+
Style/ClassAndModuleChildren:
|
26
|
+
EnforcedStyle: compact
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# MessageBus::Client
|
2
|
+
[![Build Status](https://travis-ci.org/lowjoel/message_bus-client.svg?branch=master)](https://travis-ci.org/lowjoel/message_bus-client)[![Coverage Status](https://coveralls.io/repos/github/lowjoel/message_bus-client/badge.svg?branch=master)](https://coveralls.io/github/lowjoel/message_bus-client?branch=master)[![Code Climate](https://codeclimate.com/github/lowjoel/message_bus-client/badges/gpa.svg)](https://codeclimate.com/github/lowjoel/message_bus-client)[![security](https://hakiri.io/github/lowjoel/message_bus-client/master.svg)](https://hakiri.io/github/lowjoel/message_bus-client/master)[![Inline docs](http://inch-ci.org/github/lowjoel/message_bus-client.svg?branch=master)](http://inch-ci.org/github/lowjoel/message_bus-client)
|
3
|
+
|
4
|
+
This is a Ruby implementation of the client for
|
5
|
+
[message_bus](https://github.com/samsaffron/message_bus).
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'message_bus-client'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install message_bus-client
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
The API is mostly equivalent with the JavaScript client:
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
client = MessageBus::Client.new('http://chat.samsaffron.com/')
|
29
|
+
subject.subscribe('/message') do |payload|
|
30
|
+
# Do stuff
|
31
|
+
end
|
32
|
+
|
33
|
+
client.start
|
34
|
+
client.pause
|
35
|
+
client.resume
|
36
|
+
client.stop
|
37
|
+
```
|
38
|
+
|
39
|
+
Both Long Polling and normal polling are supported:
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
MessageBus::Client.long_polling = true # false to disable
|
43
|
+
MessageBus::Client.poll_interval = 15 # seconds
|
44
|
+
```
|
45
|
+
|
46
|
+
## Development
|
47
|
+
|
48
|
+
After checking out the repo, run `bundle install` to install dependencies. Then, run `rake spec` to
|
49
|
+
run the tests.
|
50
|
+
|
51
|
+
## Contributing
|
52
|
+
|
53
|
+
Bug reports and pull requests are welcome on GitHub at
|
54
|
+
https://github.com/lowjoel/message_bus-client.
|
55
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'excon'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
require 'message_bus/client/version'
|
5
|
+
require 'message_bus/client/configuration'
|
6
|
+
require 'message_bus/client/connection'
|
7
|
+
require 'message_bus/client/message_handler'
|
8
|
+
|
9
|
+
class MessageBus::Client
|
10
|
+
include MessageBus::Client::Configuration
|
11
|
+
include MessageBus::Client::Connection
|
12
|
+
include MessageBus::Client::MessageHandler
|
13
|
+
|
14
|
+
def initialize(base_url)
|
15
|
+
super
|
16
|
+
@client_id = SecureRandom.uuid
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module MessageBus::Client::Configuration
|
2
|
+
def self.included(module_)
|
3
|
+
module_.extend(ClassMethods)
|
4
|
+
end
|
5
|
+
|
6
|
+
module ClassMethods
|
7
|
+
attr_accessor :long_polling
|
8
|
+
attr_accessor :poll_interval
|
9
|
+
|
10
|
+
def self.extended(module_)
|
11
|
+
module_.long_polling = true
|
12
|
+
module_.poll_interval = 15
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
module MessageBus::Client::Connection
|
2
|
+
# The connection is in the initialised state.
|
3
|
+
INITIALISED = 0
|
4
|
+
|
5
|
+
# The connection is in the started state.
|
6
|
+
STARTED = 1
|
7
|
+
|
8
|
+
# The connection is in the paused state.
|
9
|
+
PAUSED = 2
|
10
|
+
|
11
|
+
# The connection is in the stopping state.
|
12
|
+
STOPPING = 3
|
13
|
+
|
14
|
+
# The connection is in the stopped state.
|
15
|
+
STOPPED = 4
|
16
|
+
|
17
|
+
def initialize(base_url)
|
18
|
+
@connection = nil
|
19
|
+
@runner = nil
|
20
|
+
@base_url = base_url
|
21
|
+
@state = INITIALISED
|
22
|
+
|
23
|
+
@statistics = { total_calls: 0, failed_calls: 0 }
|
24
|
+
end
|
25
|
+
|
26
|
+
def diagnostics
|
27
|
+
end
|
28
|
+
|
29
|
+
def start
|
30
|
+
return unless @state == INITIALISED || stopped?
|
31
|
+
@state = STARTED
|
32
|
+
|
33
|
+
@connection = Excon.new(server_endpoint, persistent: true)
|
34
|
+
@runner = Thread.new { runner }
|
35
|
+
@runner.abort_on_exception = true
|
36
|
+
end
|
37
|
+
|
38
|
+
def pause
|
39
|
+
return unless @state == STARTED
|
40
|
+
|
41
|
+
@state = PAUSED
|
42
|
+
end
|
43
|
+
|
44
|
+
def paused?
|
45
|
+
@state == PAUSED
|
46
|
+
end
|
47
|
+
|
48
|
+
def resume
|
49
|
+
return unless @state == PAUSED
|
50
|
+
|
51
|
+
@state = STARTED
|
52
|
+
handle_messages
|
53
|
+
end
|
54
|
+
|
55
|
+
def stop
|
56
|
+
return unless @state == STARTED || @state == PAUSED
|
57
|
+
|
58
|
+
@state = STOPPING
|
59
|
+
@connection.reset
|
60
|
+
@runner.join
|
61
|
+
end
|
62
|
+
|
63
|
+
def stopped?
|
64
|
+
@state == STOPPED
|
65
|
+
end
|
66
|
+
|
67
|
+
private
|
68
|
+
|
69
|
+
# The runner handling polling over the connection.
|
70
|
+
def runner
|
71
|
+
poll until @state == STOPPING
|
72
|
+
rescue Excon::Errors::Error
|
73
|
+
@statistics[:failed_calls] += 1
|
74
|
+
retry
|
75
|
+
ensure
|
76
|
+
@state = STOPPED
|
77
|
+
end
|
78
|
+
|
79
|
+
# Polls the server for messages.
|
80
|
+
def poll
|
81
|
+
@statistics[:total_calls] += 1
|
82
|
+
|
83
|
+
response = @connection.post(request_parameters)
|
84
|
+
handle_connection_response(response) unless self.class.long_polling
|
85
|
+
end
|
86
|
+
|
87
|
+
# The request parameters when connecting to the server with Excon.
|
88
|
+
def request_parameters
|
89
|
+
request_body = URI.encode_www_form(subscribed_channel_indices.
|
90
|
+
merge(__seq: @statistics[:total_calls]))
|
91
|
+
request_parameters = { body: request_body, headers: headers, read_timeout: 360 }
|
92
|
+
request_parameters[:response_block] = method(:handle_chunk).to_proc if self.class.long_polling
|
93
|
+
|
94
|
+
request_parameters
|
95
|
+
end
|
96
|
+
|
97
|
+
# The headers to send when polling
|
98
|
+
def headers
|
99
|
+
headers = {}
|
100
|
+
headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
101
|
+
headers['X-SILENCE-LOGGER'] = 'true'
|
102
|
+
headers['Dont-Chunk'] = 'true' unless self.class.long_polling
|
103
|
+
|
104
|
+
headers
|
105
|
+
end
|
106
|
+
|
107
|
+
# Gets the URI to poll the server with
|
108
|
+
def server_endpoint
|
109
|
+
endpoint = "#{@base_url}/message-bus/#{@client_id}/poll"
|
110
|
+
endpoint << "?dlp=t" unless self.class.long_polling
|
111
|
+
|
112
|
+
endpoint
|
113
|
+
end
|
114
|
+
|
115
|
+
# Handles the response from the connection.
|
116
|
+
def handle_connection_response(response)
|
117
|
+
handle_response(response.body)
|
118
|
+
sleep(self.class.poll_interval)
|
119
|
+
end
|
120
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
module MessageBus::Client::MessageHandler
|
2
|
+
SubscribedChannel = Struct.new(:callbacks, :last_id) do
|
3
|
+
def initialize(last_id = -1)
|
4
|
+
self.callbacks = []
|
5
|
+
self.last_id = last_id
|
6
|
+
end
|
7
|
+
|
8
|
+
def callback(payload)
|
9
|
+
callbacks.each do |callback|
|
10
|
+
callback.call(payload)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# The chunk separator for chunked messages.
|
16
|
+
CHUNK_SEPARATOR = "\r\n|\r\n"
|
17
|
+
|
18
|
+
def initialize(base_url)
|
19
|
+
super
|
20
|
+
|
21
|
+
@pending_messages = []
|
22
|
+
@subscribed_channels = {}
|
23
|
+
@subscribed_channels.default_proc = proc do |hash, key|
|
24
|
+
hash[key] = SubscribedChannel.new
|
25
|
+
end
|
26
|
+
@payload = String.new
|
27
|
+
end
|
28
|
+
|
29
|
+
def subscribe(channel, &callback)
|
30
|
+
@subscribed_channels[channel].callbacks << callback
|
31
|
+
end
|
32
|
+
|
33
|
+
def unsubscribe
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def subscribed_channel_indices
|
39
|
+
result = {}
|
40
|
+
@subscribed_channels.each do |channel, subscription|
|
41
|
+
result[channel] = subscription.last_id
|
42
|
+
end
|
43
|
+
|
44
|
+
result
|
45
|
+
end
|
46
|
+
|
47
|
+
def handle_chunk(chunk, _remaining_bytes, _total_bytes)
|
48
|
+
@payload << chunk
|
49
|
+
try_consume_message
|
50
|
+
end
|
51
|
+
|
52
|
+
def handle_response(body)
|
53
|
+
handle_messages(JSON.parse(body))
|
54
|
+
end
|
55
|
+
|
56
|
+
def try_consume_message
|
57
|
+
index = @payload.index(CHUNK_SEPARATOR)
|
58
|
+
return unless index
|
59
|
+
|
60
|
+
message = @payload[0..index]
|
61
|
+
@payload = @payload[(index + CHUNK_SEPARATOR.length)..-1]
|
62
|
+
|
63
|
+
handle_response(message)
|
64
|
+
end
|
65
|
+
|
66
|
+
def handle_messages(messages = nil)
|
67
|
+
if paused?
|
68
|
+
@pending_messages.concat(messages)
|
69
|
+
else
|
70
|
+
handle_message_method = method(:handle_message)
|
71
|
+
@pending_messages.each(&handle_message_method)
|
72
|
+
messages.each(&handle_message_method) if messages
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
|
77
|
+
def handle_message(message)
|
78
|
+
return handle_status_message(message) if message['channel'] == '/__status'
|
79
|
+
|
80
|
+
subscription = @subscribed_channels[message['channel']]
|
81
|
+
return unless subscription
|
82
|
+
|
83
|
+
subscription.last_id = message['message_id']
|
84
|
+
subscription.callback(message['data'])
|
85
|
+
end
|
86
|
+
|
87
|
+
def handle_status_message(message)
|
88
|
+
message['data'].each do |channel, last_id|
|
89
|
+
next unless @subscribed_channels.key?(channel)
|
90
|
+
|
91
|
+
@subscribed_channels[channel].last_id = last_id
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'message_bus/client/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'message_bus-client'
|
8
|
+
spec.version = MessageBus::Client::VERSION
|
9
|
+
spec.authors = ['Joel Low']
|
10
|
+
spec.email = ['joel@joelsplace.sg']
|
11
|
+
|
12
|
+
spec.summary = 'Ruby client for Message Bus'
|
13
|
+
spec.description = 'Implements a client for Message Bus, with communication over HTTP'
|
14
|
+
spec.homepage = 'https://github.com/lowjoel/message_bus-client'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").
|
17
|
+
reject { |f| f.match(/^(test|spec|features)\//) }
|
18
|
+
spec.bindir = 'bin'
|
19
|
+
spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ['lib']
|
21
|
+
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.11'
|
23
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
24
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
25
|
+
spec.add_development_dependency 'simplecov'
|
26
|
+
spec.add_development_dependency 'coveralls'
|
27
|
+
spec.add_development_dependency 'codeclimate-test-reporter'
|
28
|
+
|
29
|
+
spec.add_dependency 'excon', '~> 0.45'
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,157 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: message_bus-client
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Joel Low
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-01-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.11'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.11'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: simplecov
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: coveralls
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: codeclimate-test-reporter
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: excon
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.45'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.45'
|
111
|
+
description: Implements a client for Message Bus, with communication over HTTP
|
112
|
+
email:
|
113
|
+
- joel@joelsplace.sg
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- ".gitignore"
|
119
|
+
- ".hound.yml"
|
120
|
+
- ".idea/message_bus-client.iml"
|
121
|
+
- ".rspec"
|
122
|
+
- ".rubocop.unhound.yml"
|
123
|
+
- ".rubocop.yml"
|
124
|
+
- ".travis.yml"
|
125
|
+
- Gemfile
|
126
|
+
- README.md
|
127
|
+
- Rakefile
|
128
|
+
- lib/message_bus/client.rb
|
129
|
+
- lib/message_bus/client/configuration.rb
|
130
|
+
- lib/message_bus/client/connection.rb
|
131
|
+
- lib/message_bus/client/message_handler.rb
|
132
|
+
- lib/message_bus/client/version.rb
|
133
|
+
- message_bus-client.gemspec
|
134
|
+
homepage: https://github.com/lowjoel/message_bus-client
|
135
|
+
licenses: []
|
136
|
+
metadata: {}
|
137
|
+
post_install_message:
|
138
|
+
rdoc_options: []
|
139
|
+
require_paths:
|
140
|
+
- lib
|
141
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - ">="
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
151
|
+
requirements: []
|
152
|
+
rubyforge_project:
|
153
|
+
rubygems_version: 2.4.8
|
154
|
+
signing_key:
|
155
|
+
specification_version: 4
|
156
|
+
summary: Ruby client for Message Bus
|
157
|
+
test_files: []
|