Last active
August 29, 2015 14:08
-
-
Save campanalbero/9cbcc394afb84ffd2096 to your computer and use it in GitHub Desktop.
引数フォルダ以下にあるファイルの拡張子を重複なしで表示
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'set' | |
set = Set.new() | |
Dir.glob(File.expand_path(ARGV[0]) + '/**/*') do |f| | |
if File.ftype(f) == "file" | |
ext = File.extname(f) | |
set.add(ext) | |
end | |
end | |
set.each do |item| | |
puts item | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment