squeese 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +3 -2
  2. data/VERSION +1 -1
  3. data/lib/squeese.rb +1 -0
  4. metadata +4 -4
data/README.md CHANGED
@@ -23,7 +23,7 @@ In a standalone file, typically jobs.rb or worker.rb:
23
23
  include Squeese
24
24
 
25
25
  job 'email.send' do |args|
26
- Pony.send(:to => args['to'], :subject => "Hello there")
26
+ Pony.send(:to => args[:to], :subject => "Hello there")
27
27
  end
28
28
 
29
29
  job 'post.cleanup.all' do |args|
@@ -33,7 +33,7 @@ In a standalone file, typically jobs.rb or worker.rb:
33
33
  end
34
34
 
35
35
  job 'post.cleanup' do |args|
36
- Post.find(args['id']).cleanup
36
+ Post.find(args[:id]).cleanup
37
37
  end
38
38
 
39
39
  Running
@@ -76,6 +76,7 @@ Tidbits
76
76
  * The default queue name used by squeese is "squeese", but you can select a different queue with ENV['SQUEESE_QUEUE'].
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
+ * Hash keys at the root of the args level are also available as symbols through a minor cheat, but nested child hashes are not.
79
80
 
80
81
  Meta
81
82
  ----
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.2.0
data/lib/squeese.rb CHANGED
@@ -50,6 +50,7 @@ module Squeese
50
50
  end
51
51
 
52
52
  name, args = JSON.parse msg.body
53
+ args = Hash.new {|h,k| h[k.to_s] if h.keys.include? k.to_s}.merge(args)
53
54
  log_job(name, args)
54
55
  handler = @@handlers[name]
55
56
  raise(NoSuchJob, name) unless handler
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
8
- - 1
9
- version: 0.1.1
7
+ - 2
8
+ - 0
9
+ version: 0.2.0
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-19 00:00:00 -07:00
17
+ date: 2010-05-20 00:00:00 -07:00
18
18
  default_executable: squeese
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency