{"blog_url":"https://obelisk.hatenablog.com/","published":"2018-01-17 14:43:40","author_url":"https://blog.hatena.ne.jp/obelisk2/","image_url":null,"version":"1.0","categories":["Ruby"],"width":"100%","url":"https://obelisk.hatenablog.com/entry/2018/01/17/144340","provider_name":"Hatena Blog","description":"\u3068\u601d\u3063\u305f\u3051\u3069\u7c21\u5358\u3060\u3063\u305f\u2014 JI@\u308f\u3093\u308f\u3093\u30b3\u30f3\u30b5\u30eb (@jaialkdanel) 2018\u5e741\u670816\u65e5 \u3078\u30fc\u3001Ruby \u3067\u306f\u3069\u3046\u3084\u308b\u304b\u306a\u3068\u3061\u3087\u3063\u3068\u8003\u3048\u3066\u307f\u305f\u3002 require 'find' def get_filenames_randomly(directory) Find.find(directory).select {|x| File.file?(x)}.shuffle.to_enum end puts get_filenames_randomly(\"/usr/lib\").take(10) \u3053\u3093\u306a\u611f\u3058\uff1f Ruby \u3060\u304b\u3089 Enumerator \u3092\u8fd4\u3059\u3053\u3068\u306b\u3059\u308b\u3002\u5b9f\u8cea\u4e00\u884c\u3060\u306a\u3002\u7d50\u679c\u3002 /usr\u2026","blog_title":"Camera Obscura","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fobelisk.hatenablog.com%2Fentry%2F2018%2F01%2F17%2F144340\" title=\"\u6307\u5b9a\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u304b\u3089\u518d\u5e30\u7684\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u30e9\u30f3\u30c0\u30e0\u306b\u53d6\u3063\u3066\u304f\u308b - Camera Obscura\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","height":"190","type":"rich","author_name":"obelisk2","title":"\u6307\u5b9a\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u304b\u3089\u518d\u5e30\u7684\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u30e9\u30f3\u30c0\u30e0\u306b\u53d6\u3063\u3066\u304f\u308b"}