{"id":26274,"date":"2014-12-28T13:49:25","date_gmt":"2014-12-28T04:49:25","guid":{"rendered":"http:\/\/www.softantenna.com\/wp\/?p=26274"},"modified":"2014-12-28T13:49:25","modified_gmt":"2014-12-28T04:49:25","slug":"streem-with-ruby","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/streem-with-ruby\/","title":{"rendered":"OKI\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3001\u300cRuby\u300d\u3067\u300cStreem\u300d\u3092\u5b9f\u88c5\u3059\u308b"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2014\/12\/Icommand2.png\" alt=\"Command\" title=\"command.png\" border=\"0\" width=\"546\" height=\"472\" \/><\/p>\n<p>\u300c<a href=\"https:\/\/github.com\/matz\/streem\">Streem<\/a>\u300d\u306f\u3001\u65e5\u672c\u304c\u8a87\u308b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u6280\u8853\u8005\u307e\u3064\u3082\u3068\u3086\u304d\u3072\u308d\u6c0f\u304c\u6700\u8fd1\u767a\u8868\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3067\u3059\u3002<\/p>\n<p>\u307e\u3064\u3082\u3068\u3086\u304d\u3072\u308d\u6c0f\u3068\u3044\u3048\u3070\u3082\u3061\u308d\u3093\u300cRuby\u300d\u306e\u4f5c\u8005\u3068\u3057\u3066\u6709\u540d\u306a\u308f\u3051\u3067\u3059\u304c\u3001\u4eca\u56de\u3053\u306eStreem\u3092Ruby\u3067\u5b9f\u88c5\u3057\u305f\u3089\u3069\u3046\u306a\u308b\u304b\uff1f\u3068\u3044\u3046\u5b9f\u88c5\u4f8b\u304cOKI\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u30a8\u30f3\u30b8\u30cb\u30a2\u30ea\u30f3\u30b0\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u30bb\u30f3\u30bf\u306e\u6280\u8853\u8cc7\u6599\u300c<a href=\"http:\/\/www.oki-osk.jp\/esc\/ruby\/streem.html\">Ruby \u306b\u3088\u308b Streem \u306e\u5b9f\u73fe<\/a>\u300d\u3068\u3057\u3066\u516c\u958b\u3055\u308c\u8a71\u984c\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u540c\u8cc7\u6599\u306b\u3088\u308b\u3068\u516c\u958b\u3055\u308c\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u300cRuby \u306b\u5143\u304b\u3089\u3042\u308b\u30af\u30e9\u30b9\u540d\u305d\u306e\u4ed6\u3068\u885d\u7a81\u305b\u305a\uff0c\u305d\u306e\u632f\u821e\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u306a\u3044 Ruby 2.0 \u306e\u884c\u5100\u306e\u3088\u3044 \uff11\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u3057\u3066 Streem \u3092\u5b9f\u73fe\u3057\u305f\u4f8b\u300d\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306bStreem\u306e\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066\u4f8b\u793a\u3055\u308c\u3066\u3044\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3068\u307b\u3068\u3093\u3069\u540c\u3058\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3067\u304d\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u300cstreem.rb\u300d\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre>\nseq(100) .| {|x|\n  if x % 15 == 0\n    \"FizzBuzz\"\n  elsif x % 3 == 0\n    \"Fizz\"\n  elsif x % 5 == 0\n    \"Buzz\"\n  else\n    x\n  end\n} | STD_OUT\n<\/pre>\n<p>\u3053\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092sample.txt\u3068\u3057\u3066\u4fdd\u5b58\u3057\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>\nruby  -r .\/streem.rb < sample.txt\n<\/pre>\n<p>\u540c\u30b5\u30a4\u30c8\u306b\u306f\u3001\u4ed6\u306b\u3082<a href=\"http:\/\/www.oki-osk.jp\/esc\/golang\/linq3.html\">Go\u8a00\u8a9e\u306b\u3088\u308bLINQ to Objects\u306e\u8a66\u4f5c<\/a>\u3084\u3001<a href=\"http:\/\/www.oki-osk.jp\/esc\/swift\/linq.html\">Swift \u306b\u3088\u308b LINQ to Objects \u306e\u8a66\u4f5c<\/a>\u306a\u3069\u8208\u5473\u6df1\u3044\u60c5\u5831\u304c\u3044\u304f\u3064\u3082\u63b2\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u53c2\u8003\u307e\u3067\u306b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u300cStreem\u300d\u306f\u3001\u65e5\u672c\u304c\u8a87\u308b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u6280\u8853\u8005\u307e\u3064\u3082\u3068\u3086\u304d\u3072\u308d\u6c0f\u304c\u6700\u8fd1\u767a\u8868\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3067\u3059\u3002 \u307e\u3064\u3082\u3068\u3086\u304d\u3072\u308d\u6c0f\u3068\u3044\u3048\u3070\u3082\u3061\u308d\u3093\u300cRuby\u300d\u306e\u4f5c\u8005\u3068\u3057\u3066\u6709\u540d\u306a\u308f\u3051\u3067\u3059\u304c\u3001\u4eca\u56de\u3053\u306eStreem\u3092Ruby\u3067\u5b9f\u88c5\u3057 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":26273,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[75],"tags":[154],"class_list":["post-26274","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-ruby"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/26274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=26274"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/26274\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/26273"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=26274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=26274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=26274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}