Красиво заполняем хэш данными
require 'pp'
DIRS = Hash[*%w{
~/Local\ Storage/TV TV
/media/Odeon/Cartoons Cartoons
/media/Odeon/TV TV
/media/Lightning/G/TV\ Storage TV
}]
pp DIRS
{"/media/Lightning/G/TV Storage"=>"TV",
"/media/Odeon/TV"=>"TV",
"~/Local Storage/TV"=>"TV",
"/media/Odeon/Cartoons"=>"Cartoons"}
Источник:
- 1 - gist.github.com