warren 0.8.9 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,4 @@
1
+ v0.9.0. Adding a logger
1
2
  v0.8.9. Fixing a StackTooDeep bug.
2
3
  v0.8.8. Bumping for github
3
4
  v0.8.7. Added a TestAdapter
data/Manifest CHANGED
@@ -1,4 +1,7 @@
1
1
  CHANGELOG
2
+ LICENSE
3
+ Manifest
4
+ Rakefile
2
5
  examples/authed/receiver.rb
3
6
  examples/authed/secret.rb
4
7
  examples/authed/sender.rb
@@ -7,6 +10,7 @@ examples/simple/amqp_receiver.rb
7
10
  examples/simple/amqp_sender.rb
8
11
  examples/simple/bunny_receiver.rb
9
12
  examples/simple/bunny_sender.rb
13
+ lib/warren.rb
10
14
  lib/warren/adapters/amqp_adapter.rb
11
15
  lib/warren/adapters/bunny_adapter.rb
12
16
  lib/warren/adapters/dummy_adapter.rb
@@ -16,10 +20,6 @@ lib/warren/filters/shared_secret.rb
16
20
  lib/warren/filters/yaml.rb
17
21
  lib/warren/message_filter.rb
18
22
  lib/warren/queue.rb
19
- lib/warren.rb
20
- LICENSE
21
- Manifest
22
- Rakefile
23
23
  readme.rdoc
24
24
  spec/spec.opts
25
25
  spec/spec_helper.rb
@@ -1,12 +1,12 @@
1
1
  require "rubygems"
2
2
 
3
3
  class DummyAdapter < Warren::Queue
4
+
4
5
  def self.publish queue_name, payload, &blk
5
- puts "publishing #{payload.inspect} to #{queue_name}"
6
+ logger.info "publishing #{payload.inspect} to #{queue_name}"
6
7
  end
7
8
 
8
9
  def self.subscribe queue_name, &block
9
- puts "subscribing to #{queue_name}"
10
+ logger.info "subscribing to #{queue_name}"
10
11
  end
11
12
  end
12
-
data/lib/warren/queue.rb CHANGED
@@ -2,6 +2,7 @@ module Warren
2
2
  class Queue
3
3
  @@connection = nil
4
4
  @@adapter = nil
5
+ @@logger = nil
5
6
 
6
7
  #
7
8
  # Raised if no connection has been defined yet.
@@ -88,4 +88,26 @@ describe Warren::Queue do
88
88
  Warren::Queue.subscribe("foo", "bar", block).should == "subscribe"
89
89
  end
90
90
  end
91
+
92
+ describe "logger" do
93
+
94
+ before(:each) do
95
+ Warren::Queue.logger = nil
96
+ end
97
+
98
+ it "should have a default logger" do
99
+ Warren::Queue.logger.should_not be_nil
100
+ Warren::Queue.logger.should be_a_kind_of(Logger)
101
+ end
102
+
103
+ it "should allow you to set a custom logger" do
104
+ log = mock(Logger)
105
+
106
+ Warren::Queue.logger = log
107
+
108
+ Warren::Queue.logger.should_not be_nil
109
+ Warren::Queue.logger.should == log
110
+ end
111
+
112
+ end
91
113
  end
data/warren.gemspec CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{warren}
5
- s.version = "0.8.9"
5
+ s.version = "0.9.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Caius Durling, David Smalley"]
9
- s.date = %q{2009-10-15}
9
+ s.date = %q{2009-11-05}
10
10
  s.description = %q{Library for pushing messages onto and off RabbitMQ queues}
11
11
  s.email = %q{support@brightbox.co.uk}
12
- s.extra_rdoc_files = ["CHANGELOG", "lib/warren/adapters/amqp_adapter.rb", "lib/warren/adapters/bunny_adapter.rb", "lib/warren/adapters/dummy_adapter.rb", "lib/warren/adapters/test_adapter.rb", "lib/warren/connection.rb", "lib/warren/filters/shared_secret.rb", "lib/warren/filters/yaml.rb", "lib/warren/message_filter.rb", "lib/warren/queue.rb", "lib/warren.rb", "LICENSE", "tasks/rdoc.rake", "tasks/rspec.rake"]
13
- s.files = ["CHANGELOG", "examples/authed/receiver.rb", "examples/authed/secret.rb", "examples/authed/sender.rb", "examples/simple/amqp_mass_sender.rb", "examples/simple/amqp_receiver.rb", "examples/simple/amqp_sender.rb", "examples/simple/bunny_receiver.rb", "examples/simple/bunny_sender.rb", "lib/warren/adapters/amqp_adapter.rb", "lib/warren/adapters/bunny_adapter.rb", "lib/warren/adapters/dummy_adapter.rb", "lib/warren/adapters/test_adapter.rb", "lib/warren/connection.rb", "lib/warren/filters/shared_secret.rb", "lib/warren/filters/yaml.rb", "lib/warren/message_filter.rb", "lib/warren/queue.rb", "lib/warren.rb", "LICENSE", "Manifest", "Rakefile", "readme.rdoc", "spec/spec.opts", "spec/spec_helper.rb", "spec/warren/adapters/test_adapter_spec.rb", "spec/warren/connection_spec.rb", "spec/warren/queue_spec.rb", "spec/warren/warren_spec.rb", "tasks/rdoc.rake", "tasks/rspec.rake", "warren.gemspec"]
12
+ s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "lib/warren.rb", "lib/warren/adapters/amqp_adapter.rb", "lib/warren/adapters/bunny_adapter.rb", "lib/warren/adapters/dummy_adapter.rb", "lib/warren/adapters/test_adapter.rb", "lib/warren/connection.rb", "lib/warren/filters/shared_secret.rb", "lib/warren/filters/yaml.rb", "lib/warren/message_filter.rb", "lib/warren/queue.rb", "tasks/rdoc.rake", "tasks/rspec.rake"]
13
+ s.files = ["CHANGELOG", "LICENSE", "Manifest", "Rakefile", "examples/authed/receiver.rb", "examples/authed/secret.rb", "examples/authed/sender.rb", "examples/simple/amqp_mass_sender.rb", "examples/simple/amqp_receiver.rb", "examples/simple/amqp_sender.rb", "examples/simple/bunny_receiver.rb", "examples/simple/bunny_sender.rb", "lib/warren.rb", "lib/warren/adapters/amqp_adapter.rb", "lib/warren/adapters/bunny_adapter.rb", "lib/warren/adapters/dummy_adapter.rb", "lib/warren/adapters/test_adapter.rb", "lib/warren/connection.rb", "lib/warren/filters/shared_secret.rb", "lib/warren/filters/yaml.rb", "lib/warren/message_filter.rb", "lib/warren/queue.rb", "readme.rdoc", "spec/spec.opts", "spec/spec_helper.rb", "spec/warren/adapters/test_adapter_spec.rb", "spec/warren/connection_spec.rb", "spec/warren/queue_spec.rb", "spec/warren/warren_spec.rb", "tasks/rdoc.rake", "tasks/rspec.rake", "warren.gemspec"]
14
14
  s.homepage = %q{http://github.com/brightbox/warren}
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Warren", "--main", "readme.rdoc"]
16
16
  s.require_paths = ["lib"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warren
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.9
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caius Durling, David Smalley
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-15 00:00:00 +01:00
12
+ date: 2009-11-05 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -30,6 +30,8 @@ extensions: []
30
30
 
31
31
  extra_rdoc_files:
32
32
  - CHANGELOG
33
+ - LICENSE
34
+ - lib/warren.rb
33
35
  - lib/warren/adapters/amqp_adapter.rb
34
36
  - lib/warren/adapters/bunny_adapter.rb
35
37
  - lib/warren/adapters/dummy_adapter.rb
@@ -39,12 +41,13 @@ extra_rdoc_files:
39
41
  - lib/warren/filters/yaml.rb
40
42
  - lib/warren/message_filter.rb
41
43
  - lib/warren/queue.rb
42
- - lib/warren.rb
43
- - LICENSE
44
44
  - tasks/rdoc.rake
45
45
  - tasks/rspec.rake
46
46
  files:
47
47
  - CHANGELOG
48
+ - LICENSE
49
+ - Manifest
50
+ - Rakefile
48
51
  - examples/authed/receiver.rb
49
52
  - examples/authed/secret.rb
50
53
  - examples/authed/sender.rb
@@ -53,6 +56,7 @@ files:
53
56
  - examples/simple/amqp_sender.rb
54
57
  - examples/simple/bunny_receiver.rb
55
58
  - examples/simple/bunny_sender.rb
59
+ - lib/warren.rb
56
60
  - lib/warren/adapters/amqp_adapter.rb
57
61
  - lib/warren/adapters/bunny_adapter.rb
58
62
  - lib/warren/adapters/dummy_adapter.rb
@@ -62,10 +66,6 @@ files:
62
66
  - lib/warren/filters/yaml.rb
63
67
  - lib/warren/message_filter.rb
64
68
  - lib/warren/queue.rb
65
- - lib/warren.rb
66
- - LICENSE
67
- - Manifest
68
- - Rakefile
69
69
  - readme.rdoc
70
70
  - spec/spec.opts
71
71
  - spec/spec_helper.rb