banter 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/banter.gemspec +2 -2
- data/lib/banter/message.rb +9 -0
- data/lib/banter/version.rb +1 -1
- data/spec/banter/message_spec.rb +13 -0
- data/spec/spec_helper.rb +0 -7
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97c5a20be7d8609e0189b266838385bf77752b6c
|
4
|
+
data.tar.gz: e33e3ebf5bb8ee35134109633b8124751e61467c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a59bb462b03b2370748f3f39ccb78a27f5babf8272bf1e08ede78fa985bafdf26c14c1eabaec75c7bcda8ec196dabb557825c75b33d3b8076675b9e2aaeffdac
|
7
|
+
data.tar.gz: ccb12a8ff6288e19e08bff59ff89bde6988fcad5c1403b9256f1c4d75d8f09a1af20e9665361e3ff62855c7b09467b882903dbc6e1ebc6113a0c261ea36a4179
|
data/Gemfile
CHANGED
data/banter.gemspec
CHANGED
@@ -26,6 +26,6 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_runtime_dependency "bunny", "~> 1.5.1"
|
27
27
|
spec.add_runtime_dependency "hashie", "~> 1.2", ">=1.2.0"
|
28
28
|
spec.add_runtime_dependency "json", "~> 1.8", ">=1.8.0"
|
29
|
-
spec.add_runtime_dependency "celluloid", "~> 0.
|
30
|
-
spec.add_runtime_dependency "celluloid-io", "~> 0.
|
29
|
+
spec.add_runtime_dependency "celluloid", "~> 0.17", ">=0.17.0"
|
30
|
+
spec.add_runtime_dependency "celluloid-io", "~> 0.17.0", ">=0.17.1"
|
31
31
|
end
|
data/lib/banter/message.rb
CHANGED
@@ -31,6 +31,15 @@ module Banter
|
|
31
31
|
contents = Hashie::Mash.new(::JSON.parse(envelope))
|
32
32
|
from_hash(contents)
|
33
33
|
to_hash
|
34
|
+
rescue => e
|
35
|
+
::Hashie::Mash.new({
|
36
|
+
ts: Time.now.to_f,
|
37
|
+
pub: "unknown",
|
38
|
+
v: "unknown",
|
39
|
+
payload: envelope,
|
40
|
+
context: { "format" => "invalid" }.as_json
|
41
|
+
})
|
42
|
+
|
34
43
|
end
|
35
44
|
|
36
45
|
def from_hash(contents)
|
data/lib/banter/version.rb
CHANGED
data/spec/banter/message_spec.rb
CHANGED
@@ -66,6 +66,19 @@ describe Banter::Message do
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
+
context "non-banter message" do
|
70
|
+
let(:payload) { "non_banter_message" }
|
71
|
+
let(:result) { subject.parse(payload) }
|
72
|
+
|
73
|
+
it "should not fail" do
|
74
|
+
expect{ result }.not_to raise_error
|
75
|
+
expect(result.payload).to eq(payload)
|
76
|
+
expect(result.context["format"]).to eq("invalid")
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
end
|
81
|
+
|
69
82
|
context "dead lettered message" do
|
70
83
|
let(:complete_val) { 1 }
|
71
84
|
let(:payload) do
|
data/spec/spec_helper.rb
CHANGED
@@ -11,23 +11,16 @@ require 'banter/server'
|
|
11
11
|
require 'support/test_notifier'
|
12
12
|
ENV['RAILS_ENV'] ||= "test"
|
13
13
|
ENV['RACK_ENV'] ||= "test"
|
14
|
-
require 'rack/test'
|
15
14
|
require 'timecop'
|
16
15
|
require 'factory_girl'
|
17
16
|
require 'rspec/its'
|
18
17
|
|
19
|
-
module RSpecMixin
|
20
|
-
include Rack::Test::Methods
|
21
|
-
def app() Banter::Web::Application end
|
22
|
-
end
|
23
|
-
|
24
18
|
FactoryGirl.find_definitions
|
25
19
|
|
26
20
|
RSpec.configure do |config|
|
27
21
|
config.run_all_when_everything_filtered = true
|
28
22
|
config.filter_run :focus
|
29
23
|
config.order = 'random'
|
30
|
-
config.include RSpecMixin
|
31
24
|
|
32
25
|
config.before(:each) {
|
33
26
|
t = Time.new
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: banter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Honest Company
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-
|
14
|
+
date: 2016-07-19 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -141,40 +141,40 @@ dependencies:
|
|
141
141
|
requirements:
|
142
142
|
- - "~>"
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version: '0.
|
144
|
+
version: '0.17'
|
145
145
|
- - ">="
|
146
146
|
- !ruby/object:Gem::Version
|
147
|
-
version: 0.
|
147
|
+
version: 0.17.0
|
148
148
|
type: :runtime
|
149
149
|
prerelease: false
|
150
150
|
version_requirements: !ruby/object:Gem::Requirement
|
151
151
|
requirements:
|
152
152
|
- - "~>"
|
153
153
|
- !ruby/object:Gem::Version
|
154
|
-
version: '0.
|
154
|
+
version: '0.17'
|
155
155
|
- - ">="
|
156
156
|
- !ruby/object:Gem::Version
|
157
|
-
version: 0.
|
157
|
+
version: 0.17.0
|
158
158
|
- !ruby/object:Gem::Dependency
|
159
159
|
name: celluloid-io
|
160
160
|
requirement: !ruby/object:Gem::Requirement
|
161
161
|
requirements:
|
162
162
|
- - "~>"
|
163
163
|
- !ruby/object:Gem::Version
|
164
|
-
version: 0.
|
164
|
+
version: 0.17.0
|
165
165
|
- - ">="
|
166
166
|
- !ruby/object:Gem::Version
|
167
|
-
version: 0.
|
167
|
+
version: 0.17.1
|
168
168
|
type: :runtime
|
169
169
|
prerelease: false
|
170
170
|
version_requirements: !ruby/object:Gem::Requirement
|
171
171
|
requirements:
|
172
172
|
- - "~>"
|
173
173
|
- !ruby/object:Gem::Version
|
174
|
-
version: 0.
|
174
|
+
version: 0.17.0
|
175
175
|
- - ">="
|
176
176
|
- !ruby/object:Gem::Version
|
177
|
-
version: 0.
|
177
|
+
version: 0.17.1
|
178
178
|
description: Publish & subscribe to messages
|
179
179
|
email:
|
180
180
|
- webadmin@honest.com
|