nezu 0.5.25 → 0.6.67

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/Rakefile CHANGED
@@ -43,7 +43,7 @@ namespace :version do
43
43
 
44
44
  def store_version(major, minor, patch)
45
45
  version = "#{major}.#{minor}.#{patch}"
46
- f= File.new(File.join(File.dirname(__FILE__), 'VERSION'), File::WRONLY)
46
+ f= File.new(File.join(File.dirname(__FILE__), 'VERSION'), File::WRONLY|File::TRUNC)
47
47
  f.write(version)
48
48
  f.close
49
49
  puts "version is now #{version}"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.25
1
+ 0.6.67
@@ -7,8 +7,10 @@ module Nezu
7
7
  Nezu.logger.debug("NEZU Consumer[#{self.class}] payload: #{payload}")
8
8
  params = JSON.parse(payload.to_s)
9
9
  action = params.delete('__action')
10
- reply_to = params['__reply_to']
10
+
11
11
  result = self.send(action.to_sym, params)
12
+ reply_to = result[:end] == 'true' ? nil : params['__reply_to']
13
+
12
14
  if reply_to
13
15
  result.reverse_merge!('__action' => "#{action}_result")
14
16
  recipient = Nezu::Runtime::Recipient.new(reply_to)
@@ -9,7 +9,6 @@ module Nezu
9
9
  ch = conn.create_channel
10
10
  q = ch.queue(queue_name)
11
11
  q.publish(params.to_json, :content_type => 'application/json')
12
- conn.stop
13
12
  end
14
13
  end
15
14
  end
@@ -8,11 +8,12 @@ module Nezu
8
8
 
9
9
  class RecipientError < RuntimeError
10
10
  def self.does_not_exist(q)
11
+ klass = q.sub(/^#{configatron.amqp.development.queue_prefix}./, '').sub(/.#{configatron.amqp.development.queue_postfix}$/,'').classify
11
12
  message = %Q(
12
- The class "#{q.classify}" doesn`t exist or is not a child of "Nezu::Runtime::Producer".
13
- Please create one in \"app/producers/#{q}.rb\" with the content of at least:
13
+ The class "#{klass}" doesn`t exist or is not a child of "Nezu::Runtime::Producer".
14
+ Please create one in \"app/producers/#{klass.underscore}.rb\" with the content of at least:
14
15
 
15
- class #{q.classify} < Nezu::Runtime::Producer
16
+ class #{klass} < Nezu::Runtime::Producer
16
17
  end
17
18
  ).gsub(/^\s*/, '')
18
19
  self.new(message)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nezu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.25
4
+ version: 0.6.67
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-25 00:00:00.000000000 Z
13
+ date: 2013-06-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: amqp