nezu 0.6.69 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nezu (0.6.69)
5
- activerecord (~> 3.2.11)
6
- activesupport (~> 3.2.11)
4
+ nezu (0.7.0)
5
+ activerecord
6
+ activesupport
7
7
  amqp
8
8
  bunny (>= 0.9.0.pre8)
9
9
  configatron
@@ -34,10 +34,10 @@ GEM
34
34
  eventmachine
35
35
  arel (3.0.2)
36
36
  builder (3.0.4)
37
- bunny (0.9.0.rc1)
37
+ bunny (0.9.0.rc2)
38
38
  amq-protocol (>= 1.6.0)
39
39
  columnize (0.3.6)
40
- configatron (2.10.0)
40
+ configatron (2.13.0)
41
41
  yamler (>= 0.1.0)
42
42
  debugger (1.6.0)
43
43
  columnize (>= 0.3.1)
@@ -67,7 +67,7 @@ GEM
67
67
  rdoc (~> 3.10)
68
68
  term-ansicolor (1.2.2)
69
69
  tins (~> 0.8)
70
- tins (0.8.0)
70
+ tins (0.8.2)
71
71
  tzinfo (0.3.37)
72
72
  yamler (0.1.0)
73
73
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.69
1
+ 0.7.0
@@ -3,13 +3,16 @@ module Nezu
3
3
  class Producer
4
4
  extend Nezu::Runtime::Common
5
5
 
6
+ def self.inherited(subclass)
7
+ super
8
+ @@connection = Bunny.new(configatron.amqp.send(Nezu.env.to_sym).url)
9
+ @@connection.start
10
+ @@channel = @@connection.create_channel
11
+ end
12
+
6
13
  def self.push!(params = {})
7
- conn = Bunny.new(configatron.amqp.send(Nezu.env.to_sym).url)
8
- conn.start
9
- ch = conn.create_channel
10
- q = ch.queue(queue_name)
11
- q.publish(params.to_json, :content_type => 'application/json')
12
- conn.stop
14
+ @@queue ||= @@channel.queue(queue_name)
15
+ @@queue.publish(params.to_json, :content_type => 'application/json')
13
16
  end
14
17
  end
15
18
  end
data/lib/nezu.rb CHANGED
@@ -20,7 +20,7 @@ module Nezu
20
20
  end
21
21
 
22
22
  def respond_to?(meth, params=nil) #:nodoc:
23
- !!meth.to_s.match(/\?$/)
23
+ !!meth.to_s.match(/\?$/) || super
24
24
  end
25
25
  end
26
26
 
data/nezu.gemspec CHANGED
@@ -11,8 +11,8 @@ Gem::Specification.new do |s|
11
11
  s.add_dependency 'amqp'
12
12
  s.add_dependency 'mysql2'
13
13
  s.add_dependency 'bunny', '>= 0.9.0.pre8'
14
- s.add_dependency 'activerecord', '~>3.2.11'
15
- s.add_dependency 'activesupport', '~>3.2.11'
14
+ s.add_dependency 'activerecord'
15
+ s.add_dependency 'activesupport'
16
16
  s.add_dependency 'configatron'
17
17
  s.add_dependency 'term-ansicolor'
18
18
  s.add_development_dependency 'rake'
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.6.69
4
+ version: 0.7.0
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-06-17 00:00:00.000000000 Z
13
+ date: 2013-07-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: amqp
@@ -65,33 +65,33 @@ dependencies:
65
65
  requirement: !ruby/object:Gem::Requirement
66
66
  none: false
67
67
  requirements:
68
- - - ~>
68
+ - - ! '>='
69
69
  - !ruby/object:Gem::Version
70
- version: 3.2.11
70
+ version: '0'
71
71
  type: :runtime
72
72
  prerelease: false
73
73
  version_requirements: !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
- - - ~>
76
+ - - ! '>='
77
77
  - !ruby/object:Gem::Version
78
- version: 3.2.11
78
+ version: '0'
79
79
  - !ruby/object:Gem::Dependency
80
80
  name: activesupport
81
81
  requirement: !ruby/object:Gem::Requirement
82
82
  none: false
83
83
  requirements:
84
- - - ~>
84
+ - - ! '>='
85
85
  - !ruby/object:Gem::Version
86
- version: 3.2.11
86
+ version: '0'
87
87
  type: :runtime
88
88
  prerelease: false
89
89
  version_requirements: !ruby/object:Gem::Requirement
90
90
  none: false
91
91
  requirements:
92
- - - ~>
92
+ - - ! '>='
93
93
  - !ruby/object:Gem::Version
94
- version: 3.2.11
94
+ version: '0'
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: configatron
97
97
  requirement: !ruby/object:Gem::Requirement