iron_worker_ng 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -18,7 +18,7 @@ require 'active_record'
18
18
  ```ruby
19
19
  require 'iron_worker_ng'
20
20
 
21
- client = IronWorkerNG::Client.new('IRON_IO_PROJECT_ID', 'IRON_IO_TOKEN')
21
+ client = IronWorkerNG::Client.new('IRON_IO_TOKEN', 'IRON_IO_PROJECT_ID')
22
22
 
23
23
  code = IronWorkerNG::Code::Ruby.new
24
24
  code.merge_worker 'path/to/my_worker.rb'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
data/bin/iron_worker_ng CHANGED
@@ -14,12 +14,12 @@ end
14
14
  command = $*[0]
15
15
  $*.shift
16
16
 
17
- if ENV['IRON_IO_PROJECT_ID'].nil? || ENV['IRON_IO_TOKEN'].nil?
18
- puts "please set $IRON_IO_PROJECT_ID and $IRON_IO_TOKEN environment variables"
17
+ if ENV['IRON_IO_TOKEN'].nil? || ENV['IRON_IO_PROJECT_ID'].nil?
18
+ puts "please set $IRON_IO_TOKEN and $IRON_IO_PROJECT_ID environment variables"
19
19
  exit 1
20
20
  end
21
21
 
22
- client = IronWorkerNG::Client.new(ENV['IRON_IO_PROJECT_ID'], ENV['IRON_IO_TOKEN'])
22
+ client = IronWorkerNG::Client.new(ENV['IRON_IO_TOKEN'], ENV['IRON_IO_PROJECT_ID'])
23
23
 
24
24
  if command == 'upload'
25
25
  runtimes = IronWorkerNG::Code::Base.registered_types
@@ -7,12 +7,12 @@ require_relative 'api_client_error'
7
7
 
8
8
  module IronWorkerNG
9
9
  class APIClient
10
- attr_reader :project_id
11
10
  attr_reader :token
11
+ attr_reader :project_id
12
12
 
13
- def initialize(project_id, token, params = {})
14
- @project_id = project_id
13
+ def initialize(token, project_id, params = {})
15
14
  @token = token
15
+ @project_id = project_id
16
16
 
17
17
  @user_agent = params[:user_agent] || 'iron_worker_ng-' + IronWorkerNG.version
18
18
 
@@ -20,8 +20,8 @@ module IronWorkerNG
20
20
  class Client
21
21
  attr_reader :api
22
22
 
23
- def initialize(project_id, token, params = {})
24
- @api = IronWorkerNG::APIClient.new(project_id, token, params)
23
+ def initialize(token, project_id, params = {})
24
+ @api = IronWorkerNG::APIClient.new(token, project_id, params)
25
25
  end
26
26
 
27
27
  def method_missing(name, *args, &block)
@@ -37,8 +37,8 @@ require 'json'
37
37
 
38
38
  payload = JSON.load(File.open(payload_file))
39
39
 
40
- @iron_io_project_id = payload['project_id']
41
40
  @iron_io_token = payload['token']
41
+ @iron_io_project_id = payload['project_id']
42
42
  @iron_worker_task_id = task_id
43
43
  @params = payload['params']
44
44
 
@@ -55,14 +55,14 @@ unless worker_class.nil?
55
55
  worker_inst = worker_class.new
56
56
 
57
57
  class << worker_inst
58
- attr_accessor :iron_io_project_id
59
58
  attr_accessor :iron_io_token
59
+ attr_accessor :iron_io_project_id
60
60
  attr_accessor :iron_worker_task_id
61
61
  attr_accessor :params
62
62
  end
63
63
 
64
- worker_inst.iron_io_project_id = @iron_io_project_id
65
64
  worker_inst.iron_io_token = @iron_io_token
65
+ worker_inst.iron_io_project_id = @iron_io_project_id
66
66
  worker_inst.iron_worker_task_id = @iron_worker_task_id
67
67
  worker_inst.params = @params
68
68
 
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.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2012-02-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: zip
17
- requirement: &78109560 !ruby/object:Gem::Requirement
17
+ requirement: &78933470 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *78109560
25
+ version_requirements: *78933470
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rest-client
28
- requirement: &78109170 !ruby/object:Gem::Requirement
28
+ requirement: &78933170 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *78109170
36
+ version_requirements: *78933170
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rest
39
- requirement: &78108800 !ruby/object:Gem::Requirement
39
+ requirement: &78932880 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *78108800
47
+ version_requirements: *78932880
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: json
50
- requirement: &78108320 !ruby/object:Gem::Requirement
50
+ requirement: &78932460 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *78108320
58
+ version_requirements: *78932460
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: bundler
61
- requirement: &78108080 !ruby/object:Gem::Requirement
61
+ requirement: &78925690 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ~>
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: 1.0.0
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *78108080
69
+ version_requirements: *78925690
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: jeweler
72
- requirement: &78107730 !ruby/object:Gem::Requirement
72
+ requirement: &78925310 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ~>
@@ -77,7 +77,7 @@ dependencies:
77
77
  version: 1.8.3
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *78107730
80
+ version_requirements: *78925310
81
81
  description: New generation ruby client for IronWorker
82
82
  email: info@iron.io
83
83
  executables:
@@ -123,7 +123,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  segments:
125
125
  - 0
126
- hash: 211399279
126
+ hash: 670052751
127
127
  required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  none: false
129
129
  requirements: