thunderer 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/lib/thunderer.rb +2 -2
- data/lib/thunderer/controller_additions.rb +3 -3
- data/lib/thunderer/version.rb +1 -1
- data/spec/thunderer/controller_aditions_spec.rb +1 -1
- data/spec/thunderer_spec.rb +26 -4
- data/thunderer.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09270fb7610f4fbcfdbda00b6fe0e9ce8c51c333
|
4
|
+
data.tar.gz: 273eb8060f8c36be3fbe24e93b1c97c408fb0c1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d795f5469af98e5e717b22b91566a3cc550d48912aef1a0ce64368cd52bef83f3b7554f451cc000a93145d9e21b8b3b6e9255cf4cfb16d126f24accaeaa79564
|
7
|
+
data.tar.gz: 76126101884aa5c6a8952bd18fb0a83fac8b3157097f742430e89f8e0d8eb85b4f87695b461033d96fd8e0e56a60b3ee394ac3cc9f7bd4a06de96a8ba18aea86
|
data/Gemfile
CHANGED
data/lib/thunderer.rb
CHANGED
@@ -34,9 +34,9 @@ module Thunderer
|
|
34
34
|
def publish_message(message)
|
35
35
|
raise Error, 'No server specified, ensure thunderer.yml was loaded properly.' unless config.server
|
36
36
|
if config.async
|
37
|
-
Thunderer::Messages::Base.new(message)
|
38
|
-
else
|
39
37
|
Thunderer::Messages::AsyncMessage.new(message)
|
38
|
+
else
|
39
|
+
Thunderer::Messages::Base.new(message)
|
40
40
|
end.deliver
|
41
41
|
end
|
42
42
|
|
@@ -4,14 +4,14 @@ module Thunderer
|
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
6
|
included do
|
7
|
-
cattr_accessor :
|
7
|
+
cattr_accessor :_channels, :interpolation_object
|
8
8
|
|
9
9
|
before_action :add_channels_header,only: [:index]
|
10
10
|
|
11
11
|
private
|
12
12
|
|
13
13
|
def add_channels_header
|
14
|
-
headers['channels'] = (self.class.
|
14
|
+
headers['channels'] = (self.class._channels || []).map do |channel|
|
15
15
|
new_str = if self.class.interpolation_object && channel
|
16
16
|
object = send(self.class.interpolation_object)
|
17
17
|
Thunderer::ChannelParser.interpolate_channel channel, object
|
@@ -29,7 +29,7 @@ module Thunderer
|
|
29
29
|
options = args.extract_options!
|
30
30
|
options.assert_valid_keys(:object)
|
31
31
|
self.interpolation_object = options[:object]
|
32
|
-
self.
|
32
|
+
self._channels = Array.wrap(args)
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|
data/lib/thunderer/version.rb
CHANGED
@@ -28,7 +28,7 @@ describe Thunderer::ControllerAdditions do
|
|
28
28
|
|
29
29
|
it 'should affect channels class variable' do
|
30
30
|
controller_class.thunderer_channels('hello')
|
31
|
-
expect(controller_class.
|
31
|
+
expect(controller_class._channels).to include('hello')
|
32
32
|
end
|
33
33
|
|
34
34
|
it 'should affect interpolation_object of class' do
|
data/spec/thunderer_spec.rb
CHANGED
@@ -4,9 +4,11 @@ describe Thunderer do
|
|
4
4
|
before { Thunderer.reset_config }
|
5
5
|
let(:config_file_path) { 'spec/fixtures/thunderer.yml' }
|
6
6
|
let(:environment) { 'production' }
|
7
|
+
let(:async) {false}
|
7
8
|
let(:load_config) do
|
8
9
|
Thunderer.configure do |config|
|
9
10
|
config.environment = environment
|
11
|
+
config.async = async
|
10
12
|
config.config_file_path = config_file_path
|
11
13
|
end
|
12
14
|
end
|
@@ -109,11 +111,31 @@ describe Thunderer do
|
|
109
111
|
subject { Thunderer.publish_message(message) }
|
110
112
|
|
111
113
|
context 'when config are loaded' do
|
112
|
-
|
114
|
+
context 'when config with async false' do
|
115
|
+
before { load_config }
|
116
|
+
|
117
|
+
before do
|
118
|
+
expect_any_instance_of(Thunderer::Messages::Base).to receive(:deliver)
|
119
|
+
end
|
120
|
+
|
121
|
+
specify do
|
122
|
+
subject
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
context 'when config with async parameter' do
|
127
|
+
let(:async) { true}
|
128
|
+
before { load_config }
|
129
|
+
|
130
|
+
before do
|
131
|
+
expect_any_instance_of(Thunderer::Messages::AsyncMessage).to receive(:deliver).and_call_original
|
132
|
+
expect(Thunderer::Messages::AsyncMessage::Job).to receive(:perform_later).with(message) {true}
|
133
|
+
end
|
134
|
+
|
135
|
+
specify do
|
136
|
+
subject
|
137
|
+
end
|
113
138
|
|
114
|
-
specify do
|
115
|
-
expect_any_instance_of(Thunderer::Messages::Base).to receive(:deliver)
|
116
|
-
subject
|
117
139
|
end
|
118
140
|
end
|
119
141
|
|
data/thunderer.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
|
16
16
|
spec.add_dependency 'faye'
|
17
17
|
|
18
|
-
spec.add_runtime_dependency 'activesupport', '4.2.0'
|
18
|
+
spec.add_runtime_dependency 'activesupport', '>=4.2.0'
|
19
19
|
|
20
20
|
spec.files = `git ls-files -z`.split("\x0")
|
21
21
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thunderer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Chubarov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faye
|
@@ -28,14 +28,14 @@ dependencies:
|
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 4.2.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 4.2.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
141
|
rubyforge_project:
|
142
|
-
rubygems_version: 2.4.
|
142
|
+
rubygems_version: 2.4.5
|
143
143
|
signing_key:
|
144
144
|
specification_version: 4
|
145
145
|
summary: pub/sub messaging in Rails application
|