run_rabbit_run 0.0.7 → 0.0.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.
@@ -12,6 +12,7 @@ module RunRabbitRun
12
12
  pid: "#{application_path}/tmp/pids/run_rabbit_run.pid",
13
13
  environment: (ENV['RAKE_ENV'] || ENV['RAILS_ENV'] || 'development'),
14
14
  log: "log/run_rabbit_run.log",
15
+ rubbitmq: {}
15
16
  }
16
17
 
17
18
  load_from_file "#{application_path}/config/rrr.rb"
@@ -46,6 +47,23 @@ module RunRabbitRun
46
47
  options[:run] = workers
47
48
  end
48
49
 
50
+ def env value
51
+ options[:environment] = value
52
+ end
53
+
54
+ def rabbitmq rmqoptions
55
+ case rmqoptions
56
+ when String
57
+ when Hash
58
+ if rmqoptions.keys.find { | key | !key.is_a? Symbol }
59
+ raise "ERROR: Only symbol as a key is allowed for rabbitmq options!"
60
+ end
61
+ else
62
+ raise "Hash or String only is allowed as rabbitmq options"
63
+ end
64
+ options[:rabbitmq] = rmqoptions
65
+ end
66
+
49
67
  private
50
68
 
51
69
  def load_from_file(path)
@@ -48,7 +48,7 @@ module RunRabbitRun
48
48
  end
49
49
 
50
50
  def connection
51
- @connection ||= AMQP.connect(host: (ENV['RABBITMQ_HOST'] || '127.0.0.1'), username: "guest", password: "guest")
51
+ @connection ||= AMQP.connect(RunRabbitRun::Config.options[:rabbitmq])
52
52
  end
53
53
 
54
54
  def channel
@@ -1,3 +1,3 @@
1
1
  module RunRabbitRun
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: run_rabbit_run
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.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-04-15 00:00:00.000000000 Z
12
+ date: 2013-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake