iron_worker_ng 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.5
1
+ 0.3.6
@@ -77,7 +77,7 @@ module IronWorkerNG
77
77
  end
78
78
 
79
79
  def tasks_create(code_name, params = {}, options = {})
80
- res = @api.tasks_create(code_name, {:token => @api.token, :project_id => @api.project_id, :params => params}.to_json, options)
80
+ res = @api.tasks_create(code_name, params.class == String ? params : params.to_json, options)
81
81
 
82
82
  OpenStruct.new(res['tasks'][0])
83
83
  end
@@ -127,7 +127,7 @@ module IronWorkerNG
127
127
  end
128
128
 
129
129
  def schedules_create(code_name, params = {}, options = {})
130
- res = @api.schedules_create(code_name, {:token => @api.token, :project_id => @api.project_id, :params => params}.to_json, options)
130
+ res = @api.schedules_create(code_name, params.class == String ? params : params.to_json, options)
131
131
 
132
132
  OpenStruct.new(res['schedules'][0])
133
133
  end
@@ -45,16 +45,12 @@ require 'json'
45
45
 
46
46
  @payload = File.read(payload_file)
47
47
 
48
- parsed_payload = {}
48
+ @params = {}
49
49
  begin
50
- parsed_payload = JSON.parse(@payload)
50
+ @params = JSON.parse(@payload)
51
51
  rescue
52
52
  end
53
53
 
54
- @iron_token = parsed_payload['token'] || nil
55
- @iron_project_id = parsed_payload['project_id'] || nil
56
- @params = parsed_payload['params'] || {}
57
-
58
54
  keys = @params.keys
59
55
  keys.each do |key|
60
56
  @params[key.to_sym] = @params[key]
@@ -64,22 +60,14 @@ def payload
64
60
  @payload
65
61
  end
66
62
 
67
- def iron_task_id
68
- @iron_task_id
69
- end
70
-
71
- def iron_token
72
- @iron_token
73
- end
74
-
75
- def iron_project_id
76
- @iron_project_id
77
- end
78
-
79
63
  def params
80
64
  @params
81
65
  end
82
66
 
67
+ def iron_task_id
68
+ @iron_task_id
69
+ end
70
+
83
71
  require '#{File.basename(@exec.path)}'
84
72
 
85
73
  exec_class = nil
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.3.5
4
+ version: 0.3.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -156,7 +156,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
156
156
  version: '0'
157
157
  segments:
158
158
  - 0
159
- hash: 133870369
159
+ hash: -4205457
160
160
  required_rubygems_version: !ruby/object:Gem::Requirement
161
161
  none: false
162
162
  requirements: