iron_worker_ng 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/bin/iron_worker +15 -1
  3. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.2
1
+ 0.8.3
data/bin/iron_worker CHANGED
@@ -71,6 +71,7 @@ elsif command == 'tasks.create' || command == 'schedules.create'
71
71
 
72
72
  name = nil
73
73
  payload = nil
74
+ payload_file = nil
74
75
 
75
76
  priority = nil
76
77
  timeout = nil
@@ -94,6 +95,10 @@ elsif command == 'tasks.create' || command == 'schedules.create'
94
95
  payload = v
95
96
  end
96
97
 
98
+ opts.on('-f', '--payload-file PAYLOAD_FILE', String, 'payload file to pass') do |v|
99
+ payload_file = v
100
+ end
101
+
97
102
  opts.on('--priority PRIORITY', Integer, '0 (default), 1, 2') do |v|
98
103
  priority = v
99
104
  end
@@ -141,6 +146,10 @@ elsif command == 'tasks.create' || command == 'schedules.create'
141
146
  exit 1
142
147
  end
143
148
 
149
+ if payload.nil? and (not payload_file.nil?)
150
+ payload = File.read(payload_file)
151
+ end
152
+
144
153
  options = {}
145
154
 
146
155
  options[:priority] = priority unless priority.nil?
@@ -172,6 +181,7 @@ elsif command == 'tasks.log'
172
181
 
173
182
  task_id = nil
174
183
  live = false
184
+ wait = false
175
185
 
176
186
  opts = OptionParser.new do |opts|
177
187
  opts.banner = "usage: iron_worker #{command} [OPTIONS]"
@@ -181,7 +191,7 @@ elsif command == 'tasks.log'
181
191
  end
182
192
 
183
193
  opts.on('-w', '--wait', 'wait for task') do |v|
184
- live = true
194
+ wait = true
185
195
  end
186
196
  end
187
197
 
@@ -207,6 +217,10 @@ elsif command == 'tasks.log'
207
217
  rescue IronCore::Error
208
218
  end
209
219
  else
220
+ if wait
221
+ client.tasks.wait_for(task_id)
222
+ end
223
+
210
224
  log = client.tasks.log(task_id)
211
225
  end
212
226
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron_worker_ng
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
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: 2012-07-11 00:00:00.000000000 Z
13
+ date: 2012-07-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: iron_core
@@ -163,7 +163,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
163
163
  version: '0'
164
164
  segments:
165
165
  - 0
166
- hash: 493722205
166
+ hash: 377459699
167
167
  required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  none: false
169
169
  requirements: