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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eac9602dee7cbdefdc6bdd4868cf960cd0c1e8b3
4
- data.tar.gz: 86214eaeb5714d13af4dfe81978c28a41b89ce6a
3
+ metadata.gz: e94aa29e884fd4e1b008efe5076f213243a33677
4
+ data.tar.gz: c88508a57afd05a6bdce91c847e444a2372eb375
5
5
  SHA512:
6
- metadata.gz: 069c7a49eb5051cb30c415b812abd0ac9f609d1b7d06ca59982af6f7b28ac389797f87f20eb76ebd9d6d795b7b18ed3d672fbf3180edb61388fb1eaceaeb33df
7
- data.tar.gz: d3bd35f6b8d4130ce26689f4f1f657fe340befb1e31e84ec3f5a5c8ad4389725772e1ef96de4dcef31d10de132d3bfeb9f8cb1244bfa3d6224c67cf1518e1684
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="~> 1.6"
17
- - BUNNY_VERSION="~> 1.5.0"
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
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.0
4
+
5
+ * Use `Rails.application.config_for` if available.
6
+
3
7
  ## 0.12.2
4
8
 
5
9
  * Do not delete the exchange on stop delete:true - as the exchange is changed
@@ -3,5 +3,5 @@ source 'https://rubygems.org'
3
3
  # Load root Gemfile
4
4
  self.instance_eval Bundler.read_file 'Gemfile'
5
5
 
6
- gem 'activesupport', '~> 3.2.0'
6
+ gem 'activesupport', '~> 4.2.0'
7
7
  gem 'bunny', ENV['BUNNY_VERSION']
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.rabbitmq_config.to_s
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(file)
73
- YAML.load ERB.new(File.read(file)).result
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
@@ -1,8 +1,8 @@
1
1
  module Msgr
2
2
  module VERSION
3
3
  MAJOR = 0
4
- MINOR = 12
5
- PATCH = 3
4
+ MINOR = 13
5
+ PATCH = 0
6
6
  STAGE = nil
7
7
  STRING = [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join('.')
8
8
 
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', '~> 1.4'
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
@@ -1,11 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe TestController do
4
- before do
5
- Msgr.logger = nil;
6
- Msgr.logger.level = Logger::Severity::DEBUG if Msgr.logger
7
- end
8
-
9
4
  it 'should send messages on :index' do
10
5
  get '/'
11
6
  end
@@ -45,4 +45,8 @@ RSpec.configure do |config|
45
45
  # Only allow expect syntax
46
46
  c.syntax = :expect
47
47
  end
48
+
49
+ config.before do
50
+ Msgr.logger = false
51
+ end
48
52
  end
@@ -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.12.3
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-17 00:00:00.000000000 Z
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.5
185
+ rubygems_version: 2.4.8
180
186
  signing_key:
181
187
  specification_version: 4
182
188
  summary: 'Msgr: Rails-like Messaging Framework'