msgr 0.12.3 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -4
- data/CHANGELOG.md +4 -0
- data/gemfiles/{Gemfile.rails-3-2 → Gemfile.rails-4-2} +1 -1
- data/lib/msgr/railtie.rb +13 -7
- data/lib/msgr/version.rb +2 -2
- data/msgr.gemspec +1 -1
- data/spec/integration/msgr/railtie_spec.rb +12 -0
- data/spec/integration/msgr_spec.rb +0 -5
- data/spec/integration/spec_helper.rb +4 -0
- data/spec/msgr/msgr_spec.rb +0 -5
- metadata +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e94aa29e884fd4e1b008efe5076f213243a33677
|
4
|
+
data.tar.gz: c88508a57afd05a6bdce91c847e444a2372eb375
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73224563fc200eb0774e4c93fe8f15f7c60a4a87af0ee2838f41797d5eca5ab6d4cddb96b0002ec9f73cf9388dec690c1f7c2466f9a98fd3e31d0f4f6911f407
|
7
|
+
data.tar.gz: f0d8baa1b8f99cea91e0d7a4a85b1d716271793234328017f3cfc58e5c63c8ef8d81f1699cfcfb91b6a04f55a1cd894a3ac5c635260d77cce3337e9fbbdc42e0
|
data/.travis.yml
CHANGED
@@ -1,20 +1,21 @@
|
|
1
|
+
sudo : false
|
1
2
|
language: ruby
|
2
3
|
bundler_args: --without development
|
3
4
|
services:
|
4
5
|
- rabbitmq
|
5
6
|
rvm:
|
7
|
+
- '2.2'
|
6
8
|
- '2.1'
|
7
9
|
- '2.0'
|
8
|
-
- '1.9.3'
|
9
10
|
- jruby
|
10
11
|
- rbx
|
11
12
|
gemfile:
|
13
|
+
- gemfiles/Gemfile.rails-4-2
|
12
14
|
- gemfiles/Gemfile.rails-4-1
|
13
15
|
- gemfiles/Gemfile.rails-4-0
|
14
|
-
- gemfiles/Gemfile.rails-3-2
|
15
16
|
env:
|
16
|
-
- BUNNY_VERSION="~>
|
17
|
-
- BUNNY_VERSION="~> 1.5
|
17
|
+
- BUNNY_VERSION="~> 2.0"
|
18
|
+
- BUNNY_VERSION="~> 1.5"
|
18
19
|
- BUNNY_VERSION="~> 1.4.0"
|
19
20
|
matrix:
|
20
21
|
allow_failures:
|
data/CHANGELOG.md
CHANGED
data/lib/msgr/railtie.rb
CHANGED
@@ -8,10 +8,6 @@ module Msgr
|
|
8
8
|
app.config.msgr.logger ||= Rails.logger
|
9
9
|
end
|
10
10
|
|
11
|
-
initializer 'msgr.rabbitmq_config' do
|
12
|
-
config.msgr.rabbitmq_config ||= Rails.root.join *%w(config rabbitmq.yml)
|
13
|
-
end
|
14
|
-
|
15
11
|
# Start msgr
|
16
12
|
initializer 'msgr.start' do
|
17
13
|
config.after_initialize do |app|
|
@@ -23,7 +19,7 @@ module Msgr
|
|
23
19
|
|
24
20
|
class << self
|
25
21
|
def load(rails_config)
|
26
|
-
cfg = parse_config load_config rails_config
|
22
|
+
cfg = parse_config load_config rails_config
|
27
23
|
return unless cfg # no config given -> does not load Msgr
|
28
24
|
|
29
25
|
Msgr.config = cfg
|
@@ -69,8 +65,18 @@ module Msgr
|
|
69
65
|
cfg
|
70
66
|
end
|
71
67
|
|
72
|
-
def load_config(
|
73
|
-
|
68
|
+
def load_config(options)
|
69
|
+
if options.rabbitmq_config || !Rails.application.respond_to?(:config_for)
|
70
|
+
load_file options.rabbitmq_config || Rails.root.join(*%w(config rabbitmq.yml))
|
71
|
+
else
|
72
|
+
conf = Rails.application.config_for :rabbitmq
|
73
|
+
|
74
|
+
{Rails.env.to_s => conf}
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def load_file(path)
|
79
|
+
YAML.load ERB.new(File.read(path)).result
|
74
80
|
end
|
75
81
|
end
|
76
82
|
end
|
data/lib/msgr/version.rb
CHANGED
data/msgr.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
21
|
spec.add_dependency 'activesupport'
|
22
|
-
spec.add_dependency 'bunny', '
|
22
|
+
spec.add_dependency 'bunny', '>= 1.4', '< 3.0'
|
23
23
|
spec.add_dependency 'multi_json'
|
24
24
|
|
25
25
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
@@ -101,4 +101,16 @@ describe Msgr::Railtie do
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
end
|
104
|
+
|
105
|
+
# describe '#load_config'
|
106
|
+
# let(:options) { {} }
|
107
|
+
|
108
|
+
# subject { Msgr::Railtie.load_config options }
|
109
|
+
|
110
|
+
# if Rails::Application.methods.include(:config_for)
|
111
|
+
# it 'should use config_for' do
|
112
|
+
|
113
|
+
# end
|
114
|
+
# end
|
115
|
+
# end
|
104
116
|
end
|
data/spec/msgr/msgr_spec.rb
CHANGED
@@ -15,11 +15,6 @@ class MsgrTestConsumer < Msgr::Consumer
|
|
15
15
|
end
|
16
16
|
|
17
17
|
describe Msgr do
|
18
|
-
before do
|
19
|
-
Msgr.logger = nil
|
20
|
-
Msgr.logger.level = Logger::Severity::DEBUG if Msgr.logger
|
21
|
-
end
|
22
|
-
|
23
18
|
let(:queue) { Queue.new }
|
24
19
|
let(:client) { Msgr::Client.new size: 1, prefix: SecureRandom.hex(2) }
|
25
20
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: msgr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Graichen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -28,16 +28,22 @@ dependencies:
|
|
28
28
|
name: bunny
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.4'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '3.0'
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
|
-
- - "
|
41
|
+
- - ">="
|
39
42
|
- !ruby/object:Gem::Version
|
40
43
|
version: '1.4'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '3.0'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: multi_json
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,9 +87,9 @@ files:
|
|
81
87
|
- LICENSE.txt
|
82
88
|
- README.md
|
83
89
|
- Rakefile
|
84
|
-
- gemfiles/Gemfile.rails-3-2
|
85
90
|
- gemfiles/Gemfile.rails-4-0
|
86
91
|
- gemfiles/Gemfile.rails-4-1
|
92
|
+
- gemfiles/Gemfile.rails-4-2
|
87
93
|
- lib/msgr.rb
|
88
94
|
- lib/msgr/binding.rb
|
89
95
|
- lib/msgr/client.rb
|
@@ -176,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
176
182
|
version: '0'
|
177
183
|
requirements: []
|
178
184
|
rubyforge_project:
|
179
|
-
rubygems_version: 2.4.
|
185
|
+
rubygems_version: 2.4.8
|
180
186
|
signing_key:
|
181
187
|
specification_version: 4
|
182
188
|
summary: 'Msgr: Rails-like Messaging Framework'
|