squeese 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -77,6 +77,7 @@ Tidbits
77
77
  * The squeese binary is just for convenience, you can also run a worker with a straight Ruby command:
78
78
  $ ruby -r jobs -e Squeese.work
79
79
  * Hash keys at the root of the args level are also available as symbols through a minor cheat, but nested child hashes are not.
80
+ * You can select a particular SQS queue with Squeese.queue_name
80
81
 
81
82
  Meta
82
83
  ----
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
data/examples/enqueue.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  $LOAD_PATH.unshift '../lib'
2
2
  require 'squeese'
3
3
 
4
+ Squeese.queue_name = "example"
4
5
  Squeese.enqueue('send.email', :email => 'hello@example.com')
5
6
  Squeese.enqueue('cleanup.strays')
data/examples/jobs.rb CHANGED
@@ -3,6 +3,8 @@ require 'squeese'
3
3
 
4
4
  include Squeese
5
5
 
6
+ Squeese.queue_name = "example"
7
+
6
8
  job 'send.email' do |args|
7
9
  log "Sending email to #{args['email']}"
8
10
  end
data/lib/squeese.rb CHANGED
@@ -76,8 +76,12 @@ module Squeese
76
76
  @sqs ||= Aws::Sqs.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'], :logger => Logger.new(nil))
77
77
  end
78
78
 
79
+ def queue_name=(val)
80
+ @@queue_name = val
81
+ end
82
+
79
83
  def queue_name
80
- ENV["SQS_QUEUE"] || "squeese"
84
+ @@queue_name ||= "squeese"
81
85
  end
82
86
 
83
87
  def queue
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 0
9
- version: 0.2.0
8
+ - 1
9
+ version: 0.2.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Peter van Hardenberg
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-20 00:00:00 -07:00
17
+ date: 2010-06-04 00:00:00 -07:00
18
18
  default_executable: squeese
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency