iron_worker_ng 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -239,7 +239,7 @@ RUNNER
239
239
 
240
240
  if @remote_build_command || @full_remote_build
241
241
  IronCore::Logger.info 'IronWorkerNG', 'Creating builder'
242
-
242
+
243
243
  builder = IronWorkerNG::Code::Builder.new
244
244
  builder.builder_remote_build_command = @remote_build_command
245
245
 
@@ -249,10 +249,10 @@ RUNNER
249
249
  builder.bundle(container, local)
250
250
 
251
251
  container.get_output_stream(@name + '.worker') do |wf|
252
- wf.write(workerfile)
252
+ wf.write(build_workerfile)
253
253
  end
254
254
  end
255
-
255
+
256
256
  if @remote_build_command || @full_remote_build
257
257
  @dest_dir = ''
258
258
  end
@@ -265,7 +265,7 @@ RUNNER
265
265
 
266
266
  def run(params = {})
267
267
  container_name = create_container(true)
268
-
268
+
269
269
  payload = File.open("#{container_name}/__payload__", 'wb')
270
270
  payload.write(params.is_a?(String) ? params : params.to_json)
271
271
  payload.close
@@ -282,15 +282,15 @@ RUNNER
282
282
  def install(standalone = false)
283
283
  end
284
284
 
285
- def workerfile
285
+ def build_workerfile
286
286
  commands = []
287
287
 
288
288
  commands << "runtime '#{runtime}'"
289
289
  commands << "name '#{name}'"
290
290
 
291
- commands += @features.map { |f| f.command }
291
+ commands += @features.map { |f| f.build_command }
292
292
 
293
- commands.compact.join("\n")
293
+ commands.compact.uniq.join("\n")
294
294
  end
295
295
 
296
296
  def to_s
@@ -58,6 +58,8 @@ end
58
58
 
59
59
  code.install(true)
60
60
 
61
+ require 'bundler/setup'
62
+
61
63
  client = IronWorkerNG::Client.new(JSON.parse(params[:client_options]))
62
64
 
63
65
  res = client.codes.create(code, JSON.parse(params[:codes_create_options]))
@@ -118,9 +118,11 @@ RUN_CODE
118
118
 
119
119
  gemfile.close
120
120
 
121
- puts `cd #{gemfile_dir} && bundle install#{standalone ? ' --standalone' : ''}`
121
+ if standalone
122
+ puts `bundle install --standalone`
123
+ else
124
+ puts `cd #{gemfile_dir} && bundle install`
122
125
 
123
- unless gemfile_dir.nil?
124
126
  FileUtils.rm_r(gemfile_dir)
125
127
  end
126
128
  end
@@ -36,7 +36,7 @@ module IronWorkerNG
36
36
  def bundle(container)
37
37
  end
38
38
 
39
- def command
39
+ def build_command
40
40
  nil
41
41
  end
42
42
  end
@@ -31,7 +31,7 @@ module IronWorkerNG
31
31
  end
32
32
  end
33
33
 
34
- def command
34
+ def build_command
35
35
  if @code.remote_build_command || @code.full_remote_build
36
36
  if @code.full_remote_build && IronWorkerNG::Fetcher.remote?(rebase(@path))
37
37
  "dir '#{rebase(@path)}', '#{@dest}'"
@@ -39,7 +39,7 @@ module IronWorkerNG
39
39
  "dir '#{@code.dest_dir}#{@dest}#{File.basename(@path)}', '#{@dest}'"
40
40
  end
41
41
  else
42
- "dir '#{@path}', '#{@dest}'"
42
+ nil
43
43
  end
44
44
  end
45
45
  end
@@ -35,7 +35,7 @@ module IronWorkerNG
35
35
  end
36
36
  end
37
37
 
38
- def command
38
+ def build_command
39
39
  if @code.remote_build_command || @code.full_remote_build
40
40
  if @code.full_remote_build && IronWorkerNG::Fetcher.remote?(rebase(@path))
41
41
  "exec '#{rebase(@path)}', #{@args.inspect}"
@@ -43,7 +43,7 @@ module IronWorkerNG
43
43
  "exec '#{@code.dest_dir}#{File.basename(@path)}', #{@args.inspect}"
44
44
  end
45
45
  else
46
- "exec '#{@path}', #{@args.inspect}"
46
+ nil
47
47
  end
48
48
  end
49
49
  end
@@ -25,7 +25,7 @@ module IronWorkerNG
25
25
  end
26
26
  end
27
27
 
28
- def command
28
+ def build_command
29
29
  if @code.remote_build_command || @code.full_remote_build
30
30
  if @code.full_remote_build && IronWorkerNG::Fetcher.remote?(rebase(@path))
31
31
  "file '#{rebase(@path)}', '#{@dest}'"
@@ -33,7 +33,7 @@ module IronWorkerNG
33
33
  "file '#{@code.dest_dir}#{@dest}#{File.basename(@path)}', '#{@dest}'"
34
34
  end
35
35
  else
36
- "file '#{@path}', '#{@dest}'"
36
+ nil
37
37
  end
38
38
  end
39
39
  end
@@ -23,7 +23,7 @@ module IronWorkerNG
23
23
  end
24
24
  end
25
25
 
26
- def command
26
+ def build_command
27
27
  if @code.remote_build_command || @code.full_remote_build
28
28
  if @code.full_remote_build && IronWorkerNG::Fetcher.remote?(rebase(@path))
29
29
  "jar '#{rebase(@path)}'"
@@ -31,7 +31,7 @@ module IronWorkerNG
31
31
  "jar '#{@code.dest_dir}#{File.basename(@path)}'"
32
32
  end
33
33
  else
34
- "jar '#{@path}'"
34
+ nil
35
35
  end
36
36
  end
37
37
 
@@ -19,9 +19,11 @@ module IronWorkerNG
19
19
  Digest::MD5.hexdigest(@name + @version)
20
20
  end
21
21
 
22
- def command
22
+ def build_command
23
23
  if @code.full_remote_build
24
24
  "gem '#{@name}', '#{@version}'"
25
+ elsif @code.remote_build_command
26
+ "dir '__build__/__gems__'"
25
27
  else
26
28
  nil
27
29
  end
@@ -1,5 +1,5 @@
1
1
  module IronWorkerNG
2
- VERSION = "0.11.0"
2
+ VERSION = "0.11.1"
3
3
 
4
4
  def self.version
5
5
  VERSION
metadata CHANGED
@@ -1,137 +1,105 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: iron_worker_ng
3
- version: !ruby/object:Gem::Version
4
- version: 0.11.0
3
+ version: !ruby/object:Gem::Version
5
4
  prerelease:
5
+ version: 0.11.1
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Andrew Kirilenko
9
9
  - Iron.io, Inc
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-09-27 00:00:00.000000000 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
13
+
14
+ date: 2012-10-01 00:00:00 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
16
17
  name: iron_core
17
- requirement: !ruby/object:Gem::Requirement
18
- none: false
19
- requirements:
20
- - - ! '>='
21
- - !ruby/object:Gem::Version
22
- version: 0.4.2
23
- type: :runtime
24
18
  prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
19
+ requirement: &id001 !ruby/object:Gem::Requirement
26
20
  none: false
27
- requirements:
28
- - - ! '>='
29
- - !ruby/object:Gem::Version
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
30
24
  version: 0.4.2
31
- - !ruby/object:Gem::Dependency
32
- name: bundler
33
- requirement: !ruby/object:Gem::Requirement
34
- none: false
35
- requirements:
36
- - - ! '>='
37
- - !ruby/object:Gem::Version
38
- version: 1.0.0
39
25
  type: :runtime
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
40
29
  prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
30
+ requirement: &id002 !ruby/object:Gem::Requirement
42
31
  none: false
43
- requirements:
44
- - - ! '>='
45
- - !ruby/object:Gem::Version
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
46
35
  version: 1.0.0
47
- - !ruby/object:Gem::Dependency
48
- name: zip
49
- requirement: !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
36
  type: :runtime
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: zip
56
40
  prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
41
+ requirement: &id003 !ruby/object:Gem::Requirement
58
42
  none: false
59
- requirements:
60
- - - ! '>='
61
- - !ruby/object:Gem::Version
62
- version: '0'
63
- - !ruby/object:Gem::Dependency
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: "0"
47
+ type: :runtime
48
+ version_requirements: *id003
49
+ - !ruby/object:Gem::Dependency
64
50
  name: test-unit
65
- requirement: !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - ! '>='
69
- - !ruby/object:Gem::Version
70
- version: '0'
71
- type: :development
72
51
  prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - ! '>='
77
- - !ruby/object:Gem::Version
78
- version: '0'
79
- - !ruby/object:Gem::Dependency
80
- name: minitest
81
- requirement: !ruby/object:Gem::Requirement
52
+ requirement: &id004 !ruby/object:Gem::Requirement
82
53
  none: false
83
- requirements:
84
- - - ! '>='
85
- - !ruby/object:Gem::Version
86
- version: '0'
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: "0"
87
58
  type: :development
59
+ version_requirements: *id004
60
+ - !ruby/object:Gem::Dependency
61
+ name: minitest
88
62
  prerelease: false
89
- version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
- requirements:
92
- - - ! '>='
93
- - !ruby/object:Gem::Version
94
- version: '0'
95
- - !ruby/object:Gem::Dependency
96
- name: minitest-reporters
97
- requirement: !ruby/object:Gem::Requirement
63
+ requirement: &id005 !ruby/object:Gem::Requirement
98
64
  none: false
99
- requirements:
100
- - - ! '>='
101
- - !ruby/object:Gem::Version
102
- version: 0.5.0
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: "0"
103
69
  type: :development
70
+ version_requirements: *id005
71
+ - !ruby/object:Gem::Dependency
72
+ name: minitest-reporters
104
73
  prerelease: false
105
- version_requirements: !ruby/object:Gem::Requirement
74
+ requirement: &id006 !ruby/object:Gem::Requirement
106
75
  none: false
107
- requirements:
108
- - - ! '>='
109
- - !ruby/object:Gem::Version
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
110
79
  version: 0.5.0
111
- - !ruby/object:Gem::Dependency
112
- name: rake
113
- requirement: !ruby/object:Gem::Requirement
114
- none: false
115
- requirements:
116
- - - ! '>='
117
- - !ruby/object:Gem::Version
118
- version: '0'
119
80
  type: :development
81
+ version_requirements: *id006
82
+ - !ruby/object:Gem::Dependency
83
+ name: rake
120
84
  prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
85
+ requirement: &id007 !ruby/object:Gem::Requirement
122
86
  none: false
123
- requirements:
124
- - - ! '>='
125
- - !ruby/object:Gem::Version
126
- version: '0'
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: "0"
91
+ type: :development
92
+ version_requirements: *id007
127
93
  description: New generation ruby client for IronWorker
128
- email:
94
+ email:
129
95
  - info@iron.io
130
- executables:
96
+ executables:
131
97
  - iron_worker
132
98
  extensions: []
99
+
133
100
  extra_rdoc_files: []
134
- files:
101
+
102
+ files:
135
103
  - lib/3rdparty/hashie/indifferent_access.rb
136
104
  - lib/3rdparty/hashie/merge_initializer.rb
137
105
  - lib/iron_worker_ng/fetcher.rb
@@ -176,27 +144,31 @@ files:
176
144
  - bin/iron_worker
177
145
  homepage: https://github.com/iron-io/iron_worker_ruby_ng
178
146
  licenses: []
147
+
179
148
  post_install_message:
180
149
  rdoc_options: []
181
- require_paths:
150
+
151
+ require_paths:
182
152
  - lib
183
- required_ruby_version: !ruby/object:Gem::Requirement
153
+ required_ruby_version: !ruby/object:Gem::Requirement
184
154
  none: false
185
- requirements:
186
- - - ! '>='
187
- - !ruby/object:Gem::Version
188
- version: '1.9'
189
- required_rubygems_version: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: "1.9"
159
+ required_rubygems_version: !ruby/object:Gem::Requirement
190
160
  none: false
191
- requirements:
192
- - - ! '>='
193
- - !ruby/object:Gem::Version
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
194
164
  version: 1.3.6
195
165
  requirements: []
166
+
196
167
  rubyforge_project:
197
168
  rubygems_version: 1.8.24
198
169
  signing_key:
199
170
  specification_version: 3
200
171
  summary: New generation ruby client for IronWorker
201
172
  test_files: []
173
+
202
174
  has_rdoc: