asir_beanstalk 1.2.7 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Changelog CHANGED
@@ -1,6 +1,12 @@
1
1
  2012-03-14 Kurt A. Stephens <ks.github@kurtstephens.com>
2
2
 
3
- * v1.2.7: renamed #status to #conduit_status.
3
+ * v1.2.8: New Version: Additional functionality.
4
+ * Support #conduit_host.
5
+
6
+ 2012-03-14 Kurt A. Stephens <ks.github@kurtstephens.com>
7
+
8
+ * v1.2.7: New Version: changed API
9
+ * Renamed #status to #conduit_status.
4
10
 
5
11
  2012-03-13 Kurt A. Stephens <ks.github@kurtstephens.com>
6
12
 
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
19
  gem.require_paths = ["lib"]
20
20
 
21
- gem.add_dependency "asir", "~> 1.2.6"
21
+ gem.add_dependency "asir", "~> 1.2.8"
22
22
 
23
23
  gem.add_development_dependency 'rake', '>= 0.9.0'
24
24
  gem.add_development_dependency 'rspec', '~> 2.12.0'
@@ -236,9 +236,12 @@ module ASIR
236
236
  end
237
237
 
238
238
  def _start_conduit!
239
+ host = conduit_host
239
240
  opt = host ? "-l #{host} " : ""
240
241
  cmd = "beanstalkd #{opt}-p #{port} -z #{1 * 1024 * 1024} #{@conduit_options[:beanstalkd_options]}"
241
- $stderr.puts " #{cmd}" rescue nil if @conduit_options[:verbose]
242
+ if @conduit_options[:verbose]
243
+ $stderr.puts " #{cmd}" rescue nil
244
+ end
242
245
  exec(cmd)
243
246
  end
244
247
  end
@@ -1,3 +1,3 @@
1
1
  module AsirBeanstalk
2
- VERSION = "1.2.7"
2
+ VERSION = "1.2.8"
3
3
  end
@@ -10,7 +10,9 @@ describe "ASIR::Transport::Beanstalk" do
10
10
  :encoder => ASIR::Coder::Marshal.new,
11
11
  :uri => "beanstalk://localhost:31033/spec",
12
12
  :conduit_options => {
13
+ :bind_host => '127.0.0.1',
13
14
  :pid_file => "/tmp/asir-beanstalk-test.pid",
15
+ :verbose => 1,
14
16
  },
15
17
  :verbose => 9,
16
18
  :_logger => $stderr,
@@ -22,8 +24,9 @@ describe "ASIR::Transport::Beanstalk" do
22
24
  ASIR::Transport::Beanstalk.new
23
25
  end
24
26
 
25
- it "should default to localhost:11300" do
27
+ it "should default to 127.0.0.1:11300" do
26
28
  t.host.should == '127.0.0.1'
29
+ t.conduit_host.should == t.host
27
30
  t.host_default.should == '127.0.0.1'
28
31
  t.port.should == 11300
29
32
  t.port_default.should == 11300
@@ -37,6 +40,7 @@ describe "ASIR::Transport::Beanstalk" do
37
40
  t.uri = "beanstalk://host:12345/tube"
38
41
  t.scheme.should == 'beanstalk'
39
42
  t.host.should == 'host'
43
+ t.conduit_host.should == t.host
40
44
  t.port.should == 12345
41
45
  t.tube.should == 'tube'
42
46
  t.path.should == '/tube'
@@ -48,11 +52,25 @@ describe "ASIR::Transport::Beanstalk" do
48
52
  t.tube = 'tube'
49
53
  t.uri.should == "beanstalk://host:12345/tube"
50
54
  end
55
+
56
+ it "should handle an alternate conduit_host" do
57
+ t.uri = "beanstalk://host:12345/tube"
58
+ t.conduit_host = '0.0.0.0'
59
+ t.host.should == 'host'
60
+ t.conduit_host.should == '0.0.0.0'
61
+ end
51
62
  end
52
63
 
53
- context "with started beanstalk server" do
64
+ context "with started beanstalk conduit" do
54
65
  before :all do
55
66
  $transport ||= t
67
+ t.port.should == 31033
68
+ t.conduit_options = {
69
+ :bind_host => '127.0.0.1',
70
+ :verbose => 1,
71
+ }
72
+ t.conduit_host.should == '127.0.0.1'
73
+ t.conduit_host.should_not == t.host
56
74
  t.start_conduit!
57
75
  sleep 1
58
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asir_beanstalk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.7
4
+ version: 1.2.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-14 00:00:00.000000000 Z
12
+ date: 2013-03-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: asir
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 1.2.6
21
+ version: 1.2.8
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 1.2.6
29
+ version: 1.2.8
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rake
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -117,18 +117,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
117
  - - ! '>='
118
118
  - !ruby/object:Gem::Version
119
119
  version: '0'
120
- segments:
121
- - 0
122
- hash: 2838955884663425346
123
120
  required_rubygems_version: !ruby/object:Gem::Requirement
124
121
  none: false
125
122
  requirements:
126
123
  - - ! '>='
127
124
  - !ruby/object:Gem::Version
128
125
  version: '0'
129
- segments:
130
- - 0
131
- hash: 2838955884663425346
132
126
  requirements: []
133
127
  rubyforge_project:
134
128
  rubygems_version: 1.8.25