Skip to content

Commit

Permalink
fake loading openssl as only gem packinging is needed
Browse files Browse the repository at this point in the history
fixes (#1)
  • Loading branch information
mkristian committed Oct 10, 2018
1 parent 58bce02 commit 843eec6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 7 additions & 5 deletions rubygems-tools/src/main/resources/nexus/gemspec_helper_impl.rb
Expand Up @@ -13,6 +13,8 @@

require 'nexus/rubygems_helper'
require 'maven/tools/pom'
# we do not need openssl, so let rubygems find the dummy
$LOAD_PATH.insert(0, '.')
require 'rubygems/package'

java_import org.torquebox.mojo.rubygems.GemspecHelper
Expand Down Expand Up @@ -43,7 +45,7 @@ class GemspecHelperImpl
# or gem file
def initialize( io, is_gem )
if is_gem
@gemspec = load_spec( io )
@gemspec = load_spec( io )
else
@gemspec = runzip( io )
end
Expand Down Expand Up @@ -76,7 +78,7 @@ def name
end

# generates the pom XML from the gemspec
# @param snapshot [boolean] whether or not to use a snapshot version.
# @param snapshot [boolean] whether or not to use a snapshot version.
# snapshot versions only works with prereleased
# gem version
# @return [String] pom XML
Expand Down Expand Up @@ -110,18 +112,18 @@ def load_spec( gemfile )
# this part if basically copied from rubygems/package.rb
Gem::Package::TarReader.new( io ) do |reader|
reader.each do |entry|
case entry.full_name
case entry.full_name
when 'metadata' then
return Gem::Specification.from_yaml entry.read
when 'metadata.gz' then
args = [entry]
args << { :external_encoding => Encoding::UTF_8 } if
Object.const_defined?(:Encoding) &&
Zlib::GzipReader.method(:wrap).arity != 1

Zlib::GzipReader.wrap(*args) do |gzio|
return Gem::Specification.from_yaml gzio.read
end
end
end
end
end
Expand Down
1 change: 1 addition & 0 deletions rubygems-tools/src/main/resources/nexus/openssl.rb
@@ -0,0 +1 @@
# dummy so needed bits of rubygems loads without openssl

0 comments on commit 843eec6

Please sign in to comment.