reactor 0.11.1 → 0.11.2

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: a676751a31b8f702d1cbd084a9363e6bfcc5cf26
4
- data.tar.gz: a67b5fdac18be4bb1b61a950af4e23e3d9e0d686
3
+ metadata.gz: 8252972581cc95bb4ac6cd93d5a99cc760c67b70
4
+ data.tar.gz: 8b95946e4f717c78d16ce36e5da4162cb3776fbe
5
5
  SHA512:
6
- metadata.gz: 0cafbfba4b07912a67188de843589fe97e5b7bc00a445803ef8f2b6836173336e37a46f9c9c7bcd0517f65cf0c5cdb9461db63e869b30504236dff2e0b9f8c31
7
- data.tar.gz: 41616d18f3ef3a6244d084aff2c326f389c061d8839b8fa33aff312c3ab41aefe9c327ac0c776bba18d0c386e45c399c8c4f968dec4a1b24272a1910bd395c75
6
+ metadata.gz: 9e09bf4d0cb61913a73877f9b71066c9bc2571ae8d762acb9bd4fda882395f11ec796af4d938e46406aa745bafec05b00a8e49c283bc63ef0bf51b9afce3d29b
7
+ data.tar.gz: 1f2399204102e398cd463c761d382d9b4633d6bfcc8f4e82dbfcd7b9326f9527cd6a8504484775daae05d0d1dccd53e82d47fa89690c86111cfe1c22dba0b140
data/Changes.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Reactor Change Log
2
2
 
3
+ 0.11.2
4
+ -----------
5
+ Safely handle bad UTF-8 encoded strings passed in as event arguments
6
+
3
7
  0.11.1
4
8
  -----------
5
9
  Bug fix for namespaced Subscribable objects
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- reactor (0.11.1)
4
+ reactor (0.11.2)
5
5
  activerecord (< 5.0)
6
6
  sidekiq
7
7
 
data/lib/reactor/event.rb CHANGED
@@ -7,6 +7,7 @@ class Reactor::Event
7
7
  def initialize(data = {})
8
8
  self.data = {}.with_indifferent_access
9
9
  data.each do |key, value|
10
+ value = value.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '') if value.is_a?(String)
10
11
  self.send("#{key}=", value)
11
12
  end
12
13
  end
@@ -1,3 +1,3 @@
1
1
  module Reactor
2
- VERSION = "0.11.1"
2
+ VERSION = "0.11.2"
3
3
  end
@@ -51,6 +51,12 @@ describe Reactor::Subscribable do
51
51
  Reactor::Event.publish(:bid_made, target: Auction.create!(start_at: 10.minutes.from_now))
52
52
  end
53
53
 
54
+ it 'protects against bad unicode characters in event attributes' do
55
+ expect {
56
+ Reactor::Event.publish(:bad_unicode, thing_one: "\xAD", thing_two: "\xAB" )
57
+ }.to_not raise_error
58
+ end
59
+
54
60
  describe 'building uniquely named subscriber handler classes' do
55
61
  it 'adds a static subscriber to the global lookup constant' do
56
62
  expect(Reactor::SUBSCRIBERS['puppy_delivered'][0]).to eq(Reactor::StaticSubscribers::Auction::PuppyDeliveredHandler)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reactor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - winfred
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-03-12 00:00:00.000000000 Z
14
+ date: 2016-03-18 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: sidekiq