thunderer 1.1.1 → 1.1.3

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: d9a1ce5c6987af0fc2372414c4ace3a2e1989ceb
4
- data.tar.gz: f95c81355aa214c6532d3746805ea3b30dbcaa6f
3
+ metadata.gz: 09270fb7610f4fbcfdbda00b6fe0e9ce8c51c333
4
+ data.tar.gz: 273eb8060f8c36be3fbe24e93b1c97c408fb0c1b
5
5
  SHA512:
6
- metadata.gz: b1afb358bd5f5798cab5951cb6671994338a1064388115be26b742fad2091c7ee6450214fe95f6a08e8413666f5e79540e0f27d753978978154eaf71dbc04e2a
7
- data.tar.gz: 1ea8a4ab0b98c61cfdd2c631754d25ae3ebc4f0472a4fe1a3cdfce08ff9380fb348b81f06a622217680598279c6329def21e17783852306172ad140342af8dd7
6
+ metadata.gz: d795f5469af98e5e717b22b91566a3cc550d48912aef1a0ce64368cd52bef83f3b7554f451cc000a93145d9e21b8b3b6e9255cf4cfb16d126f24accaeaa79564
7
+ data.tar.gz: 76126101884aa5c6a8952bd18fb0a83fac8b3157097f742430e89f8e0d8eb85b4f87695b461033d96fd8e0e56a60b3ee394ac3cc9f7bd4a06de96a8ba18aea86
data/Gemfile CHANGED
@@ -10,7 +10,6 @@ gem 'jasmine'
10
10
  group :development do
11
11
  gem 'guard-rspec', require: false
12
12
  gem 'guard-jasmine'
13
- gem 'rsense'
14
13
  gem 'sucker_punch'
15
14
  end
16
15
 
@@ -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 :channels, :interpolation_object
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.channels || []).map do |channel|
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.channels = Array.wrap(args)
32
+ self._channels = Array.wrap(args)
33
33
  end
34
34
 
35
35
  end
@@ -1,3 +1,3 @@
1
1
  module Thunderer
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.3'
3
3
  end
@@ -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.channels).to include('hello')
31
+ expect(controller_class._channels).to include('hello')
32
32
  end
33
33
 
34
34
  it 'should affect interpolation_object of class' do
@@ -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
- before { load_config }
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
 
@@ -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.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: 2015-08-13 00:00:00.000000000 Z
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.6
142
+ rubygems_version: 2.4.5
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: pub/sub messaging in Rails application