lib/gem-wrappers.rb in gem-wrappers-1.3.1 vs lib/gem-wrappers.rb in gem-wrappers-1.3.2
- old
+ new
@@ -41,11 +41,13 @@
end
private
def self.ruby_executables
- Dir.chdir(RbConfig::CONFIG["bindir"]) {
- Dir["*"].select{ |file| File.executable?(file) }
- }
+ bindir = RbConfig::CONFIG["bindir"].sub(/\/+\z/, '')
+ Dir.entries(bindir).select do |file|
+ path = "#{bindir}/#{file}"
+ !File.directory?(path) && File.executable?(path)
+ end
end
end