iron_worker_ng 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14ba1843d8e0b87e267154dd0b8a62934c5d1176
4
- data.tar.gz: e6ec6cb7310ebfe92c2edf22f3d37cf2da1f7f71
3
+ metadata.gz: eac318a56ff54032909607e2e0830aa394e9f429
4
+ data.tar.gz: 6476cd2c649e6a2793349ef459c328b9c683789d
5
5
  SHA512:
6
- metadata.gz: 24782f8a3dffe6f358284751b8fafb7e617fa5acb4443950fca3f6506349ec51d58597c7f3433744943fc88f606533c254c1a8d9ba51c2f02f591a2e1b22d305
7
- data.tar.gz: 5f154138d150ca7121e066a82ac9161466018368f3a38589ae27dde9002a8c97fdf5414c801dc404aece9fd2e7c9ea248cfb0053f222496c3941f26b0bb16cd0
6
+ metadata.gz: bf3df9f5bf9ba572a4b92f7bc214e94afccba715b89b40ea2f1993d28b3e9d9a965d965ffd71d633e567c73b2db1f053b18ecf83acb1295cf484de7617b2559e
7
+ data.tar.gz: fe4200eacdcd5381076d1eed7191702e5df77c99c9a41edeea75b3182307945d33df1ee9a70503943deec9c5fc5956bc5158f1a8cb682747b5438d910969eec8
@@ -24,6 +24,7 @@ module IronWorkerNG
24
24
  attr_accessor :zip_package
25
25
 
26
26
  attr_accessor :use_local_iron_worker_ng
27
+ attr_accessor :use_build_cache
27
28
  attr_accessor :fix_params
28
29
 
29
30
  undef exec
@@ -145,6 +146,8 @@ module IronWorkerNG
145
146
  def stack(stack_name = nil)
146
147
  @stack = stack_name if stack_name
147
148
 
149
+ @use_local_iron_worker_ng = true if @stack == 'ruby-2.1'
150
+
148
151
  @stack
149
152
  end
150
153
 
@@ -298,6 +301,7 @@ RUNNER
298
301
  builder.builder_remote_build_command = @remote_build_command
299
302
 
300
303
  builder.use_local_iron_worker_ng = @use_local_iron_worker_ng
304
+ builder.stack(@stack)
301
305
 
302
306
  if @use_local_iron_worker_ng
303
307
  builder.gem('iron_worker_ng')
@@ -18,7 +18,7 @@ module IronWorkerNG
18
18
 
19
19
  @spec = spec
20
20
 
21
- if @spec.name == 'nokogiri' && @spec.version.to_s.start_with?('1.6.')
21
+ if @spec.name == 'nokogiri' && @spec.version.to_s.start_with?('1.6.') && (not code.use_build_cache)
22
22
  IronCore::Logger.warn 'IronWorkerNG', "WARNING: Building nokogiri version #{@spec.version} will take a lot of time. Switching to version '~> 1.5.9' should fix this"
23
23
  end
24
24
  end
@@ -44,6 +44,7 @@ module IronWorkerNG
44
44
  IronCore::Logger.info 'IronWorkerNG', 'Fixating gems dependencies'
45
45
 
46
46
  @features.reject! { |f| f.class == IronWorkerNG::Feature::Ruby::MergeGem::Feature }
47
+ @features.reject! { |f| f.class == IronWorkerNG::Feature::Common::MergeZip::Feature && f.path.start_with?('http://s3.amazonaws.com/iron_worker_ng_gems') }
47
48
 
48
49
  deps = @features.reject { |f| f.class != IronWorkerNG::Feature::Ruby::MergeGemDependency::Feature }
49
50
 
@@ -66,6 +67,18 @@ module IronWorkerNG
66
67
  spec_set.to_a.each do |spec|
67
68
  spec.__materialize__
68
69
 
70
+ if @use_build_cache
71
+ cache_url = "http://s3.amazonaws.com/iron_worker_ng_gems#{@stack.nil? ? '' : '-' + @stack}/#{spec.name}-#{spec.version}.zip"
72
+
73
+ if IronWorkerNG::Fetcher.exists?(cache_url)
74
+ IronCore::Logger.info 'IronWorkerNG', "Merging cached ruby gem with name='#{spec.name}' and version='#{spec.version}'"
75
+
76
+ @features << IronWorkerNG::Feature::Common::MergeZip::Feature.new(self, cache_url, '')
77
+
78
+ next
79
+ end
80
+ end
81
+
69
82
  IronCore::Logger.info 'IronWorkerNG', "Merging ruby gem with name='#{spec.name}' and version='#{spec.version}'"
70
83
 
71
84
  @features << IronWorkerNG::Feature::Ruby::MergeGem::Feature.new(self, spec)
@@ -9,6 +9,31 @@ module IronWorkerNG
9
9
  url.start_with?('http://') || url.start_with?('https://')
10
10
  end
11
11
 
12
+ def self.exists?(url)
13
+ if IronWorkerNG::Fetcher.remote?(url)
14
+ url = IronWorkerNG::Fetcher.fix_github_url(url)
15
+
16
+ uri = URI.parse(url)
17
+
18
+ http = Net::HTTP.new(uri.host, uri.port)
19
+
20
+ if uri.scheme == 'https'
21
+ http.use_ssl = true
22
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
23
+ end
24
+
25
+ response = http.request(Net::HTTP::Head.new(uri.request_uri))
26
+
27
+ if response.kind_of?(Net::HTTPRedirection)
28
+ return IronWorkerNG::Fetcher.exists?(response['location'])
29
+ end
30
+
31
+ return response.code.to_i == 200
32
+ else
33
+ File.exists?(url)
34
+ end
35
+ end
36
+
12
37
  def self.fix_github_url(url)
13
38
  if url.start_with?('http://github.com/') || url.start_with?('https://github.com/')
14
39
  fixed_url = url.sub('//github.com/', '//raw.github.com/').sub('/blob/', '/')
@@ -1,5 +1,5 @@
1
1
  module IronWorkerNG
2
- VERSION = '1.4.1'
2
+ VERSION = '1.4.2'
3
3
 
4
4
  def self.version
5
5
  VERSION
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: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kirilenko
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-12 00:00:00.000000000 Z
12
+ date: 2014-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: iron_core
@@ -175,48 +175,48 @@ extra_rdoc_files: []
175
175
  files:
176
176
  - lib/3rdparty/hashie/indifferent_access.rb
177
177
  - lib/3rdparty/hashie/merge_initializer.rb
178
- - lib/iron_worker_ng/api_client.rb
179
- - lib/iron_worker_ng/cli.rb
178
+ - lib/iron_worker_ng/fetcher.rb
179
+ - lib/iron_worker_ng/compat.rb
180
180
  - lib/iron_worker_ng/client.rb
181
- - lib/iron_worker_ng/code/base.rb
182
- - lib/iron_worker_ng/code/binary.rb
183
- - lib/iron_worker_ng/code/builder.rb
184
- - lib/iron_worker_ng/code/container/base.rb
185
- - lib/iron_worker_ng/code/container/dir.rb
186
- - lib/iron_worker_ng/code/container/zip.rb
187
- - lib/iron_worker_ng/code/go.rb
188
- - lib/iron_worker_ng/code/java.rb
189
- - lib/iron_worker_ng/code/mono.rb
190
- - lib/iron_worker_ng/code/node.rb
191
- - lib/iron_worker_ng/code/perl.rb
192
- - lib/iron_worker_ng/code/php.rb
181
+ - lib/iron_worker_ng/version.rb
193
182
  - lib/iron_worker_ng/code/python.rb
194
183
  - lib/iron_worker_ng/code/ruby.rb
195
- - lib/iron_worker_ng/code/runtime/binary.rb
196
- - lib/iron_worker_ng/code/runtime/go.rb
197
- - lib/iron_worker_ng/code/runtime/java.rb
184
+ - lib/iron_worker_ng/code/mono.rb
185
+ - lib/iron_worker_ng/code/node.rb
186
+ - lib/iron_worker_ng/code/base.rb
187
+ - lib/iron_worker_ng/code/java.rb
188
+ - lib/iron_worker_ng/code/runtime/python.rb
189
+ - lib/iron_worker_ng/code/runtime/ruby.rb
198
190
  - lib/iron_worker_ng/code/runtime/mono.rb
199
191
  - lib/iron_worker_ng/code/runtime/node.rb
192
+ - lib/iron_worker_ng/code/runtime/java.rb
200
193
  - lib/iron_worker_ng/code/runtime/perl.rb
194
+ - lib/iron_worker_ng/code/runtime/binary.rb
201
195
  - lib/iron_worker_ng/code/runtime/php.rb
202
- - lib/iron_worker_ng/code/runtime/python.rb
203
- - lib/iron_worker_ng/code/runtime/ruby.rb
204
- - lib/iron_worker_ng/compat.rb
196
+ - lib/iron_worker_ng/code/runtime/go.rb
197
+ - lib/iron_worker_ng/code/perl.rb
198
+ - lib/iron_worker_ng/code/builder.rb
199
+ - lib/iron_worker_ng/code/binary.rb
200
+ - lib/iron_worker_ng/code/container/zip.rb
201
+ - lib/iron_worker_ng/code/container/dir.rb
202
+ - lib/iron_worker_ng/code/container/base.rb
203
+ - lib/iron_worker_ng/code/php.rb
204
+ - lib/iron_worker_ng/code/go.rb
205
205
  - lib/iron_worker_ng/feature/base.rb
206
- - lib/iron_worker_ng/feature/common/merge_deb.rb
207
- - lib/iron_worker_ng/feature/common/merge_dir.rb
208
- - lib/iron_worker_ng/feature/common/merge_exec.rb
209
- - lib/iron_worker_ng/feature/common/merge_file.rb
210
- - lib/iron_worker_ng/feature/common/merge_zip.rb
211
- - lib/iron_worker_ng/feature/common/set_env.rb
212
- - lib/iron_worker_ng/feature/java/merge_jar.rb
213
206
  - lib/iron_worker_ng/feature/python/merge_pip.rb
214
207
  - lib/iron_worker_ng/feature/python/merge_pip_dependency.rb
215
- - lib/iron_worker_ng/feature/ruby/merge_gem.rb
208
+ - lib/iron_worker_ng/feature/java/merge_jar.rb
216
209
  - lib/iron_worker_ng/feature/ruby/merge_gem_dependency.rb
210
+ - lib/iron_worker_ng/feature/ruby/merge_gem.rb
217
211
  - lib/iron_worker_ng/feature/ruby/merge_gemfile.rb
218
- - lib/iron_worker_ng/fetcher.rb
219
- - lib/iron_worker_ng/version.rb
212
+ - lib/iron_worker_ng/feature/common/set_env.rb
213
+ - lib/iron_worker_ng/feature/common/merge_file.rb
214
+ - lib/iron_worker_ng/feature/common/merge_zip.rb
215
+ - lib/iron_worker_ng/feature/common/merge_deb.rb
216
+ - lib/iron_worker_ng/feature/common/merge_dir.rb
217
+ - lib/iron_worker_ng/feature/common/merge_exec.rb
218
+ - lib/iron_worker_ng/cli.rb
219
+ - lib/iron_worker_ng/api_client.rb
220
220
  - lib/iron_worker_ng.rb
221
221
  - README.md
222
222
  - LICENSE