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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 392e9d855319d4d23abbd43c12932480857be977
4
- data.tar.gz: 261063589e891676943f98a1429a984de59c11f9
3
+ metadata.gz: 97c5a20be7d8609e0189b266838385bf77752b6c
4
+ data.tar.gz: e33e3ebf5bb8ee35134109633b8124751e61467c
5
5
  SHA512:
6
- metadata.gz: 8b784e6a0f3f7d1b7de9fceececf8fb96baa10f2c34bcd78df6d0c8c86483a2e7edf5866add7357ab58e8e8b19b615effa9eb8633e743d39347ae62c04d52acd
7
- data.tar.gz: 112fb318896f313aaf75116ca135b33653a6bc0663dd33f77f5b5ec47c871ab1f3c9e44df0e6b2bf0ba2aafc7ae2d70097f62bab278ec237cb5bd3fdf4a92af8
6
+ metadata.gz: a59bb462b03b2370748f3f39ccb78a27f5babf8272bf1e08ede78fa985bafdf26c14c1eabaec75c7bcda8ec196dabb557825c75b33d3b8076675b9e2aaeffdac
7
+ data.tar.gz: ccb12a8ff6288e19e08bff59ff89bde6988fcad5c1403b9256f1c4d75d8f09a1af20e9665361e3ff62855c7b09467b882903dbc6e1ebc6113a0c261ea36a4179
data/Gemfile CHANGED
@@ -5,9 +5,9 @@ gemspec
5
5
 
6
6
  gem 'json'
7
7
  group :test do
8
- gem 'rack-test'
9
8
  gem 'rspec-its'
10
9
  gem 'timecop'
10
+ gem 'activesupport', '~> 4.2'
11
11
  gem 'awesome_print', '~> 1.6', '>= 1.6.1'
12
12
  gem "factory_girl", "~> 4.0"
13
13
  end
@@ -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.16", ">=0.16.0"
30
- spec.add_runtime_dependency "celluloid-io", "~> 0.16.0", ">=0.16.1"
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
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Banter
2
- VERSION = "2.1.0"
2
+ VERSION = "2.2.0"
3
3
  end
@@ -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
@@ -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.1.0
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-04-22 00:00:00.000000000 Z
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.16'
144
+ version: '0.17'
145
145
  - - ">="
146
146
  - !ruby/object:Gem::Version
147
- version: 0.16.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.16'
154
+ version: '0.17'
155
155
  - - ">="
156
156
  - !ruby/object:Gem::Version
157
- version: 0.16.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.16.0
164
+ version: 0.17.0
165
165
  - - ">="
166
166
  - !ruby/object:Gem::Version
167
- version: 0.16.1
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.16.0
174
+ version: 0.17.0
175
175
  - - ">="
176
176
  - !ruby/object:Gem::Version
177
- version: 0.16.1
177
+ version: 0.17.1
178
178
  description: Publish & subscribe to messages
179
179
  email:
180
180
  - webadmin@honest.com