Created
December 27, 2015 08:03
-
-
Save katryo/5a16e6ae6edc8c58bf40 to your computer and use it in GitHub Desktop.
ファイル名を取得してyamlにするRubyスクリプト
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 'yaml' | |
names = [] | |
Dir::glob('*.jpg').each do |filename| | |
names.push filename | |
end | |
names_hash = { 'names' => names } | |
names_yaml = names_hash.to_yaml | |
File.write('photo_names.yml', names_yaml.to_s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment