salesforce_streamer 2.0.0.rc1 → 2.0.0.rc2

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
  SHA256:
3
- metadata.gz: 980626b26a53a56e8fb6fd2028e538ffd667cbe938a1aa1011c4184813d2936d
4
- data.tar.gz: b6ece556e2e34186b9ad77f445c26ebf6532170e4a9f7a8d0662e309775c9427
3
+ metadata.gz: 62cda30f1dc4379de105485088cce3cb77a874c6b336465b05ebdc0976c46e60
4
+ data.tar.gz: 8c470f3301875a1926dfc68e8b40cc3862d8478bbd95c97fe4cdd154c0bd3c05
5
5
  SHA512:
6
- metadata.gz: 1920656978db1b707ba61bd90c7026988b99c9dfbb2c7489f4a8554df97f1ad9000885fa619bff884257fd5794225ba3c3ab23b3172b6753ea57ec8f76e6bb05
7
- data.tar.gz: '0099d97a9cb7774c0fe274b0ee46bb68da87dca38f6113310539248f309111341a4a3e917476e4ca686413cf8cd22e5551f6c917a774a60ffab6541f9ad04889'
6
+ metadata.gz: c8a7aee18710329e556852c68aeb626e587108f788acf880aa0810671b9c536517ee34798eb1e9a8fd03a67ff2e8171f59ddf1ab8da9b4f836f57b5cf3746015
7
+ data.tar.gz: 4c91a95c717ece055e22e05b487994293c2015f04633e0d46676f2a740986345762c8d263f40f57b981ebc18ab76553dbc7252ad2ebe95ea415ff6b533eba7f6
@@ -61,7 +61,7 @@ To retrieve the replayId before subscribing to a PushTopic,
61
61
  configure an adapter that returns an integer.
62
62
 
63
63
  SalesforceStreamer.config.replay_adapter = proc { |topic|
64
- MyStore.fetch_replay_id(topic.name) || -1
64
+ (MyStore.fetch_replay_id(topic.name) || -1).to_i
65
65
  }
66
66
 
67
67
  This will be used to set the replayId value when subscribing to the PushTopic.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- salesforce_streamer (2.0.0.rc1)
4
+ salesforce_streamer (2.0.0.rc2)
5
5
  dry-initializer (~> 3.0)
6
6
  faye (~> 1.4)
7
7
  restforce (>= 4.2, < 6.0)
data/README.md CHANGED
@@ -113,13 +113,15 @@ Configure the `SalesforceStreamer` module.
113
113
  ```ruby
114
114
  # config/initializers/salesforce_streamer.rb
115
115
 
116
- SalesforceStreamer.config.logger = Logger.new(STDERR, level: 'INFO')
117
- SalesforceStreamer.config.exception_adapter = proc { |e| puts e }
118
- SalesforceStreamer.config.replay_adapter = proc { |topic|
119
- topic.id || Store.get(topic.name) || topic.replay
120
- }
121
- SalesforceStreamer.config.use_middleware AfterMessageReceived
122
- SalesforceStreamer.config.manage_topics = true
116
+ SalesforceStreamer.configure do |config|
117
+ config.logger = Logger.new(STDERR, level: 'INFO')
118
+ config.exception_adapter = proc { |e| puts e }
119
+ config.replay_adapter = proc { |topic|
120
+ (Store.get(topic.name) || topic.replay).to_i
121
+ }
122
+ config.use_middleware AfterMessageReceived
123
+ config.manage_topics = true
124
+ end
123
125
  ```
124
126
 
125
127
  ### Launch The Streamer
@@ -58,4 +58,8 @@ module SalesforceStreamer
58
58
  def self.config
59
59
  Configuration.instance
60
60
  end
61
+
62
+ def self.configure
63
+ yield Configuration.instance
64
+ end
61
65
  end
@@ -7,10 +7,14 @@ module SalesforceStreamer
7
7
 
8
8
  class << self
9
9
  attr_writer :instance
10
- end
11
10
 
12
- def self.instance
13
- @instance ||= new
11
+ def configure
12
+ yield instance
13
+ end
14
+
15
+ def instance
16
+ @instance ||= new
17
+ end
14
18
  end
15
19
 
16
20
  def initialize
@@ -53,7 +53,7 @@ module SalesforceStreamer
53
53
  if constant.respond_to? :call
54
54
  constant
55
55
  elsif constant.respond_to? :perform_async
56
- proc { |message| handler_constant.perform_async message }
56
+ proc { |message| constant.perform_async message }
57
57
  else
58
58
  fail(UnprocessableHandlerError, constant)
59
59
  end
@@ -1,3 +1,3 @@
1
1
  module SalesforceStreamer
2
- VERSION = '2.0.0.rc1'.freeze
2
+ VERSION = '2.0.0.rc2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salesforce_streamer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc1
4
+ version: 2.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Serok