diff --git a/ext/json/json.gemspec b/ext/json/json.gemspec index 07426363ac..5575731025 100644 --- a/ext/json/json.gemspec +++ b/ext/json/json.gemspec @@ -44,8 +44,7 @@ spec = Gem::Specification.new do |s| "LEGAL", "README.md", "json.gemspec", - *Dir["lib/**/*.rb"], - ] + ] + Dir.glob("lib/**/*.rb", base: File.expand_path("..", __FILE__)) if java_ext s.platform = 'java' diff --git a/ext/openssl/openssl.gemspec b/ext/openssl/openssl.gemspec index 9f7c718592..2ec1551885 100644 --- a/ext/openssl/openssl.gemspec +++ b/ext/openssl/openssl.gemspec @@ -13,7 +13,8 @@ Gem::Specification.new do |spec| spec.files = [] spec.add_runtime_dependency('jruby-openssl', '~> 0.14') else - spec.files = Dir["lib/**/*.rb", "ext/**/*.{c,h,rb}", "*.md", "BSDL", "COPYING"] + spec.files = Dir.glob(["lib/**/*.rb", "ext/**/*.{c,h,rb}", "*.md"], base: File.expand_path("..", __FILE__)) + + ["BSDL", "COPYING"] spec.require_paths = ["lib"] spec.extensions = ["ext/openssl/extconf.rb"] end