bunnish 0.0.5 → 0.0.6

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
data/bunnish.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "bunnish"
8
- s.version = "0.0.5"
8
+ s.version = "0.0.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kenji Hara"]
12
- s.date = "2012-12-09"
12
+ s.date = "2012-12-11"
13
13
  s.description = "Command for AMQP access to Message Queue."
14
14
  s.email = "haracane@gmail.com"
15
15
  s.executables = ["bunnish"]
@@ -52,7 +52,7 @@ Gem::Specification.new do |s|
52
52
  s.homepage = "http://github.com/haracane/bunnish"
53
53
  s.licenses = ["MIT"]
54
54
  s.require_paths = ["lib"]
55
- s.rubygems_version = "1.8.17"
55
+ s.rubygems_version = "1.8.21"
56
56
  s.summary = "Command for AMQP access to Message Queue."
57
57
 
58
58
  if s.respond_to? :specification_version then
@@ -10,7 +10,12 @@ module Bunnish::Command
10
10
  password = params[:password]
11
11
  durable = params[:durable]
12
12
 
13
- queue_name = argv[0]
13
+ queue_name = argv.shift
14
+
15
+ if queue_name.nil?
16
+ Bunnish.logger.error("queue-name is not set")
17
+ return 1
18
+ end
14
19
 
15
20
  bunny = Bunny.new(:logging => false, :spec => '09', :host=>host, :port=>port, :user=>user, :pass=>password)
16
21
 
@@ -20,8 +20,14 @@ module Bunnish::Command
20
20
  log_label = params[:log_label]
21
21
 
22
22
  queue_name_list = argv.shift
23
+
24
+ if queue_name_list.nil?
25
+ Bunnish.logger.error("queue-name is not set")
26
+ return 1
27
+ end
23
28
 
24
- queue_name_list = queue_name_list.split(/[, \r\n]+/) if queue_name_list
29
+ queue_name_list = queue_name_list.split(/[, \r\n]/)
30
+ queue_name_list.delete('')
25
31
 
26
32
  bunny = Bunny.new(:logging => false, :spec => '09', :host=>host, :port=>port, :user=>user, :pass=>password)
27
33
 
@@ -19,7 +19,14 @@ module Bunnish::Command
19
19
  log_path = params[:log_path]
20
20
 
21
21
 
22
- queue_name_list = argv.shift.split(/[, \r\n]/)
22
+ queue_name_list = argv.shift
23
+
24
+ if queue_name_list.nil?
25
+ Bunnish.logger.error("queue-name is not set")
26
+ return 1
27
+ end
28
+
29
+ queue_name_list = queue_name_list.split(/[, \r\n]/)
23
30
  queue_name_list.delete('')
24
31
 
25
32
  if delimiter
@@ -17,7 +17,15 @@ module Bunnish::Command
17
17
  warn_flag = false
18
18
  error_flag = false
19
19
 
20
- queue_name_list = argv.shift.split(/[, ]+/)
20
+ queue_name_list = argv.shift
21
+
22
+ if queue_name_list.nil?
23
+ Bunnish.logger.error("queue-name is not set")
24
+ return 1
25
+ end
26
+
27
+ queue_name_list = queue_name_list.split(/[, \r\n]/)
28
+ queue_name_list.delete('')
21
29
 
22
30
  begin
23
31
  bunny = Bunny.new(:logging => false, :spec => '09', :host=>host, :port=>port, :user=>user, :pass=>password)
@@ -24,6 +24,11 @@ module Bunnish::Command
24
24
 
25
25
  queue_name = argv.shift
26
26
 
27
+ if queue_name.nil?
28
+ Bunnish.logger.error("queue-name is not set")
29
+ return 1
30
+ end
31
+
27
32
  log_stream = nil
28
33
 
29
34
  log_path = "#{log_dir}/#{queue_name.gsub(/[\/]/, "_")}.log" if log_dir
@@ -37,10 +42,12 @@ module Bunnish::Command
37
42
 
38
43
  bunny = Bunny.new(:logging => false, :spec => '09', :host=>host, :port=>port, :user=>user, :pass=>password)
39
44
 
40
-
41
45
  # start a communication session with the amqp server
42
46
  bunny.start
43
47
 
48
+ #
49
+ bunny.qos(:prefetch_count => 1)
50
+
44
51
  # create/get queue
45
52
  queue = bunny.queue(queue_name, :durable=>durable)
46
53
 
@@ -66,7 +73,7 @@ module Bunnish::Command
66
73
  return 0
67
74
  end
68
75
  else
69
- Bunnish::Core::Common.output_log [log_stream], "INFO", "#{log_label} subscribe from #{queue_name}(#{remain_count} messages, #{consumer_count} consumers)"
76
+ Bunnish::Core::Common.output_log [log_stream], "INFO", "#{log_label} subscribe to #{queue_name}(#{remain_count} messages, #{consumer_count} consumers)"
70
77
  end
71
78
 
72
79
  if !exchange_name.nil? && exchange_name != '' then
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunnish
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kenji Hara
@@ -15,11 +15,9 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-12-09 00:00:00 Z
18
+ date: 2012-12-11 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: json
22
- prerelease: false
23
21
  type: :runtime
24
22
  requirement: &id001 !ruby/object:Gem::Requirement
25
23
  none: false
@@ -31,9 +29,9 @@ dependencies:
31
29
  - 0
32
30
  version: "0"
33
31
  version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: bunny
32
+ name: json
36
33
  prerelease: false
34
+ - !ruby/object:Gem::Dependency
37
35
  type: :runtime
38
36
  requirement: &id002 !ruby/object:Gem::Requirement
39
37
  none: false
@@ -45,9 +43,9 @@ dependencies:
45
43
  - 0
46
44
  version: "0"
47
45
  version_requirements: *id002
48
- - !ruby/object:Gem::Dependency
49
- name: rspec
46
+ name: bunny
50
47
  prerelease: false
48
+ - !ruby/object:Gem::Dependency
51
49
  type: :development
52
50
  requirement: &id003 !ruby/object:Gem::Requirement
53
51
  none: false
@@ -61,9 +59,9 @@ dependencies:
61
59
  - 0
62
60
  version: 2.8.0
63
61
  version_requirements: *id003
64
- - !ruby/object:Gem::Dependency
65
- name: rdoc
62
+ name: rspec
66
63
  prerelease: false
64
+ - !ruby/object:Gem::Dependency
67
65
  type: :development
68
66
  requirement: &id004 !ruby/object:Gem::Requirement
69
67
  none: false
@@ -76,9 +74,9 @@ dependencies:
76
74
  - 12
77
75
  version: "3.12"
78
76
  version_requirements: *id004
79
- - !ruby/object:Gem::Dependency
80
- name: bundler
77
+ name: rdoc
81
78
  prerelease: false
79
+ - !ruby/object:Gem::Dependency
82
80
  type: :development
83
81
  requirement: &id005 !ruby/object:Gem::Requirement
84
82
  none: false
@@ -90,9 +88,9 @@ dependencies:
90
88
  - 0
91
89
  version: "0"
92
90
  version_requirements: *id005
93
- - !ruby/object:Gem::Dependency
94
- name: jeweler
91
+ name: bundler
95
92
  prerelease: false
93
+ - !ruby/object:Gem::Dependency
96
94
  type: :development
97
95
  requirement: &id006 !ruby/object:Gem::Requirement
98
96
  none: false
@@ -106,9 +104,9 @@ dependencies:
106
104
  - 4
107
105
  version: 1.8.4
108
106
  version_requirements: *id006
109
- - !ruby/object:Gem::Dependency
110
- name: rcov
107
+ name: jeweler
111
108
  prerelease: false
109
+ - !ruby/object:Gem::Dependency
112
110
  type: :development
113
111
  requirement: &id007 !ruby/object:Gem::Requirement
114
112
  none: false
@@ -120,6 +118,8 @@ dependencies:
120
118
  - 0
121
119
  version: "0"
122
120
  version_requirements: *id007
121
+ name: rcov
122
+ prerelease: false
123
123
  description: Command for AMQP access to Message Queue.
124
124
  email: haracane@gmail.com
125
125
  executables:
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  requirements: []
190
190
 
191
191
  rubyforge_project:
192
- rubygems_version: 1.8.17
192
+ rubygems_version: 1.8.21
193
193
  signing_key:
194
194
  specification_version: 3
195
195
  summary: Command for AMQP access to Message Queue.