diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index 9c0b68957947d0..3d913a396844cf 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -2196,9 +2196,12 @@ ossl_ssl_write(VALUE self, VALUE str) /* * call-seq: * ssl.syswrite_nonblock(string) => Integer + * ssl.syswrite_nonblock(string, opts) => Integer * * Writes _string_ to the SSL connection in a non-blocking manner. Raises an - * SSLError if writing would block. + * SSLError if writing would block. If "exception: false" is passed, this + * method returns a symbol of :wait_readable or :wait_writable, rather than + * raising an exception. */ static VALUE ossl_ssl_write_nonblock(int argc, VALUE *argv, VALUE self) diff --git a/tool/lib/bundled_gem.rb b/tool/lib/bundled_gem.rb index ca9b40875c2fa5..ad103825bc985e 100644 --- a/tool/lib/bundled_gem.rb +++ b/tool/lib/bundled_gem.rb @@ -131,10 +131,26 @@ def checkout(gemdir, repo, rev, git: $git) system(command, chdir: gemdir) or raise "failed: #{command}" end + class GemspecLoader + module NoPipe + refine IO.singleton_class do + def popen(...) ""; end + end + end + using NoPipe + + def `(command) ""; end + + def load_gemspec(file) + code = File.read(file, encoding: "utf-8:-") + eval(code, binding, file) + rescue + nil + end + end + def load_gemspec(g) - dir, base = File.split(g) - spec = Dir.chdir(dir) {Gem::Specification.load(base)} || Gem::Specification.load(g) or - return false + spec = GemspecLoader.new.load_gemspec(g) spec.files.clear spec.extensions.clear src = spec.to_ruby