diff options
author | Hiroshi SHIBATA <[email protected]> | 2024-02-28 12:49:03 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2024-02-28 13:30:16 +0900 |
commit | 75a4aa2052d5b34c1e6bb8085426e50ee627d89a () | |
tree | 9bdce92ebe0770f55b96671eaf80e40aab0d158f /tool/rbinstall.rb | |
parent | fe0b704df5553bdd59e90650ffbbfac785a2e48a (diff) |
Support file listing with IO.poepn style
-rwxr-xr-x | tool/rbinstall.rb | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -958,17 +958,20 @@ end def load_gemspec(file, base = nil) file = File.realpath(file) code = File.read(file, encoding: "utf-8:-") code.gsub!(/(?:`git[^\`]*`|%x\[git[^\]]*\])\.split\([^\)]*\)/m) do - files = [] - if base - Dir.glob("**/*", File::FNM_DOTMATCH, base: base) do |n| - case File.basename(n); when ".", ".."; next; end - next if File.directory?(File.join(base, n)) - files << n.dump - end - end "[" + files.join(", ") + "]" end spec = eval(code, binding, file) unless Gem::Specification === spec raise TypeError, "[#{file}] isn't a Gem::Specification (#{spec.class} instead)." |