watership 0.8.0.pre → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MThkNjNkYjBiNDBmMGQ4NzllNWE2YjgwMWJjMzc3MjMwMmQ2N2JhMw==
5
- data.tar.gz: !binary |-
6
- ZjA3OGE1MjdhOWM3M2ViZDlhN2FlN2Q4ZjRjMzkzZDlmNmZhNGQ3MQ==
2
+ SHA1:
3
+ metadata.gz: b81f52be62e1afd94b281b277db48de7b3b840e5
4
+ data.tar.gz: a2b662d3ab5fb052dd456391bea188e31a4f6eb2
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- OGQ4YmU0NTU0YTIxMWIwYzU2ZTY0MDdlMGM0MjZhODU1N2U3NWU4ZTg5MmNm
10
- MTA5ZTBhNWE0YzJjNTM3OTU2YmU5Y2Q2NTlhYjYxY2MxNjdlZjcxYmQ0YmZl
11
- NmU3OGRkYjRlNGQ5MTBlMjgyOTM3NzgxOTVkZTlkNmE3OGIzNzY=
12
- data.tar.gz: !binary |-
13
- NGE5ZDlkNjllMDg4MDFiYTc5ZWE2NjVkMWExNDFhMzE0MzgzNWYwYWU3ODFl
14
- NTljNTU1ZTYwZDA4NDRmYmNjNGM4NDkxNmYyNzdmNDRiY2Q3MDA4MjExOTYz
15
- MzBiYjFjYjVlMjFiNmE4MzY0OGViYzRiMDk3NzIwMTUzNGJlNjI=
6
+ metadata.gz: f150f7a740e51ffcb47bd4f5d2a7bc9c48410631bb2d3e4b651cdfab61d752249c971de930143e7cc77c3e121428bd33109024f0b25034410c794fa159fd845f
7
+ data.tar.gz: 6144a2c707403801ee66254461edaf46c7227b39957d832764c7d9f60fa96a9514dd9125604bd29dfa96ea89e1962ebd2da1929718a5e1e1aca1a2404d32bf1f
data/README.md CHANGED
@@ -24,17 +24,17 @@ This is meant for our specific use case, but if you want to give it a go....
24
24
 
25
25
  Once you've `require`d it, you configure Watership with:
26
26
 
27
- Watership.config = '[AMQP URI]'
27
+ postamt = Watership.register(:postamt, '[POSTAMT AMQP URI]')
28
28
 
29
29
  Optionally, you can set a logger (`Watership.logger = ...`) and specify the environment (`Watership.environment = ...`).
30
30
 
31
31
  Then, connect to your RabbitMQ instance with:
32
32
 
33
- Watership.reconnect
33
+ postamt.reconnect
34
34
 
35
35
  Finally, you push messages like this:
36
36
 
37
- Watership.enqueue(name: 'queue name', message: 'message to enqueue')
37
+ postamt.enqueue(queue: 'queue name', message: {message: :to_enque})
38
38
 
39
39
  ## Contributing
40
40
 
@@ -1,3 +1,3 @@
1
1
  module Watership
2
- VERSION = '0.8.0.pre'
2
+ VERSION = '0.8.1'
3
3
  end
data/lib/watership.rb CHANGED
@@ -18,6 +18,16 @@ module Watership
18
18
  @registered_instances ||= {}
19
19
  end
20
20
 
21
+ def self.reconnect(name)
22
+ if name == :all
23
+ registered.each do |(name, client)|
24
+ client.reconnect
25
+ end
26
+ else
27
+ registered.fetch(name).reconnect
28
+ end
29
+ end
30
+
21
31
  def self.logger=(logger)
22
32
  @logger = logger
23
33
  end
@@ -37,6 +47,10 @@ module Watership
37
47
  end
38
48
 
39
49
  def enqueue(options = {})
50
+ if options[:name]
51
+ raise ArgumentError, ":name is no longer valid. Use :queue instead"
52
+ end
53
+
40
54
  options = options.dup
41
55
  message = options.delete(:message)
42
56
  name = options.delete(:queue)
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watership
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0.pre
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Scofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-09 00:00:00.000000000 Z
11
+ date: 2014-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.5'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
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: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bunny
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: json
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: Wrapper around Bunny to better handle connection issues
@@ -73,7 +73,7 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gitignore
76
+ - ".gitignore"
77
77
  - CHANGELOG.md
78
78
  - Gemfile
79
79
  - LICENSE.txt
@@ -94,14 +94,14 @@ require_paths:
94
94
  - lib
95
95
  required_ruby_version: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - ! '>='
97
+ - - ">="
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ! '>'
102
+ - - ">="
103
103
  - !ruby/object:Gem::Version
104
- version: 1.3.1
104
+ version: '0'
105
105
  requirements: []
106
106
  rubyforge_project:
107
107
  rubygems_version: 2.2.2