-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
78 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem| | |
|
||
gem.add_runtime_dependency 'iron_core', '>= 1.0.0' | ||
gem.add_runtime_dependency 'bundler' | ||
gem.add_runtime_dependency 'rubyzip', '>= 1.0.0' | ||
gem.add_runtime_dependency 'rubyzip', '= 0.9.9' | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
akshayrawat
|
||
|
||
gem.add_development_dependency 'test-unit' | ||
gem.add_development_dependency 'minitest' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
module IronWorkerNG | ||
module Feature | ||
module Common | ||
module MergeZip | ||
class Feature < IronWorkerNG::Feature::Base | ||
attr_reader :path | ||
attr_reader :dest | ||
|
||
def initialize(code, path, dest) | ||
super(code) | ||
|
||
@path = path | ||
@dest = dest + (dest.empty? || dest.end_with?('/') ? '' : '/') | ||
end | ||
|
||
def bundle(container) | ||
IronCore::Logger.debug 'IronWorkerNG', "Bundling zip with path='#{@path}' and dest='#{@dest}'" | ||
|
||
if (not @code.full_remote_build) || (not IronWorkerNG::Fetcher.remote?(rebase(@path))) | ||
tmp_dir_name = ::Dir.tmpdir + '/' + ::Dir::Tmpname.make_tmpname('iron-worker-ng-', 'zip') | ||
|
||
::Dir.mkdir(tmp_dir_name) | ||
|
||
IronWorkerNG::Fetcher.fetch_to_file(rebase(@path)) do |zip| | ||
zipf = ::Zip::ZipFile.open(zip) | ||
zipf.restore_permissions = true | ||
|
||
zipf.each do |f| | ||
next if zipf.get_entry(f).ftype == :directory | ||
|
||
zipf.get_entry(f).extract(tmp_dir_name + '/' + File.basename(f.name)) | ||
|
||
container_add(container, @dest + f.name, tmp_dir_name + '/' + File.basename(f.name), true) | ||
|
||
FileUtils.rm(tmp_dir_name + '/' + File.basename(f.name)) | ||
end | ||
end | ||
|
||
FileUtils.rm_rf(tmp_dir_name) | ||
end | ||
end | ||
|
||
def build_command | ||
if @code.remote_build_command || @code.full_remote_build | ||
if @code.full_remote_build && IronWorkerNG::Fetcher.remote?(rebase(@path)) | ||
"zip '#{rebase(@path)}', '#{@dest}'" | ||
else | ||
"zip '#{@code.dest_dir}#{@dest}#{File.basename(@path)}', '#{@dest}'" | ||
end | ||
else | ||
nil | ||
end | ||
end | ||
end | ||
|
||
module InstanceMethods | ||
def merge_zip(path, dest = '') | ||
IronCore::Logger.info 'IronWorkerNG', "Merging zip with path='#{path}' and dest='#{dest}'" | ||
|
||
@features << IronWorkerNG::Feature::Common::MergeZip::Feature.new(self, path, dest) | ||
end | ||
|
||
alias :zip :merge_zip | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module IronWorkerNG | ||
VERSION = '1.2.0' | ||
VERSION = '1.3.0' | ||
|
||
def self.version | ||
VERSION | ||
|
This is nasty. You've downgraded and fixed the RubyZip version to an exact one which was released 2 years ago. Most newer gems have installation problems with this, since they need RubyZip >= 1.0.0 (released a year ago).
Issue raised