Coming Soon…💎 / coming soon

Coming Soon…💎 / coming soon

Kaigi on Rails 2020 の基調講演「Coming Soon...💎」の発表スライド https://kaigionrails.org/ #kaigionrails

76a777ff80f30bd3b390e275cce625bc?s=128

Akira Matsuda

October 03, 2020
Tweet

Transcript

  1. @amatsuda Coming Soon... @amatsuda

  2. ಥવͰ͕͢ɺ

  3. OSS΍Γ͍ͨʂ Α͍͘ΖΜͳͱ͜ΖͰ૬ஊ͞ΕΔ

  4. ͍ΖΜͳͱ͜Ζ Asakusa.rb Ӭ࿨γεςϜϚωδϝϯτ͞ΜͷOSSύονձ ͍ΖΜͳձࣾ Πϯλʔωοτ

  5. None
  6. ʮ΍Γ͍ͨͳΒ΍Ε͹͍͍ͷ Ͱ͸ʁʯ ʮύονΛॻ͘ʯҎ֎ʹ΍Δ΂͖͜ͱ͸ͳ͍ ύονΛॻ͘ର৅ͷιϑτ΢ΣΞ͸ੈͷதʹແ਺ʹ ͋Δ

  7. None
  8. ͨͿΜࠓ͙͢ύονΛॻ͔ͳ͍ ཧ༝͸ٕज़ྗෆ଍ͱ͔Ͱ͸ͳ͍ ࢓૊Έ Ϟνϕʔγϣϯ ετʔϦʔ ͖͔͚ͬ

  9. ͖͔͚ͬ͸͞·͟· ࠓ೔͸ɺ͍ΖΜͳϓϩμΫτΛ঺հ͠ͳ͕ΒɺͦΕ Λॻ͍͖͔͚ͨͬ΍ͦͷͱ͖ߟ͍͑ͯͨ͜ͱͳͲΛ ͝঺հ OSS։ൃʹڵຯ͕͋Δ͚Ͳ࢝Ί͔͕ͨΘ͔Βͳ ͍ɺܧଓͰ͖ͳ͍ɺͱ͍͏ํͷࢀߟʹͳΕ͹

  10. ͱ͍͏ײ͡Ͱɺࠓ೔͸ࣗຫΛ
 ͠ʹདྷ·ͨ͠ʂ ࣗຫͱࣗըࣗࢍ RubyKaigiͰ͍ͭ΋εϐʔΧʔͷօ͞Μʹ͓ئ͍
 ͯ͠Δ΍ͭ

  11. self name: Akira Matsuda GitHub: @amatsuda Twitter: @a_matsuda

  12. ੈքతʹ༗໊ͳϓϩάϥϚʔ
 ͸͡Ί·ͨ͠

  13. ոจॻ

  14. https://jp.quora.com/ϓϩάϥϛϯάʹ͓͍ͯ- ੈքతʹ༗໊ͳ೔ຊਓ͸͍/answers/141576838

  15. https://twitter.com/joker1007/ status/1157578882184183808

  16. ͦΜͳ͜ͱͳ͍Ͱ͢ʼʻ ݺ͹ΕΕ͹Ͳ͜Ͱ΋ߦ͘ؾຬʑͳͷʹࠃ಺͔Β͸
 ͥΜͥΜ੠͔͚ͯ΋Β͑ͳ͍͚ͩͳΜͰ

  17. Rubyίϛολʔ

  18. Railsίϛολʔ

  19. ͔ͤͬ͘ͷୈ1ճKaigi on RailsͳͷͰ ͪΐͬͱ͚ͩRailsͷ࿩

  20. Railsͱࢲ

  21. ݹגίϯτϦϏϡʔλʔ https://contributors.rubyonrails.org/

  22. https:// contributors.rubyonrails.org/

  23. SinceͷཝΛݟΔͱΘ͔Δ

  24. 13೥໨

  25. ͜ͷதͰɺݱ໾Ͱίϛοτ
 ͯ͠Δਓ ҾୀΛද໌ͨ͠΋͘͠͸3೥Ҏ্ίϛοτͯ͠ͳ͍ ਓΛফ͜͠ΜͰΈΔ

  26. ݱ໾

  27. Railsίϛολʔ͸ͲΜͲΜਓ͕
 ೖΕସΘ͍ͬͯΔ͜ͱ͕Θ͔Δ ྺͷઙ͍ϝϯόʔ͕ͨͪ׆༂͍ͯ͠Δ

  28. RailsϓϩδΣΫτ͸ɺ௕೥ଓ͍͍ͯΔΘΓ ʹɺ͔ͳΓ݈શʹӡӦ͞Ε͍ͯΔͷͰ͸ͳ͍͔

  29. Ruby΍Railsͷपลͷ͍Ζ͍Ζ

  30. Asakusa.rbओ࠵ͯ͠·͢

  31. Asakusa.rbओ࠵ͯ͠·͢

  32. ΦϯϥΠϯͰຖिՐ༵೔ʹ΍ͬͯΔ ͷͰ͓ؾܰʹ༡ͼʹདྷ͍ͯͩ͘͞

  33. RubyKaigiͷ
 νʔϑΦʔΨφΠβʔ΍ͬͯ·͢

  34. RubyKaigi Takeout 2020͝ࢀՃ ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ

  35. RubyKaigi 2021 https://rubykaigi.org/2021

  36. Kaigi on Railsͱࢲ

  37. ͳΜ͔RailsͷΠϕϯτ΍Γ͍ͨͬͯݴͬͯΔେ૔͞Μ Λogijun͞ΜʹҾ͖߹ΘͤͯKaigi on Railsͷ໊લΛ ݱ୅ʹોΒͤͨͷΦϨΦϨ ͱ͍͏࿩͸ઌिͷۜ࠲RailsͰ΋͏΍ͬͨͷͰলུ

  38. झຯͰΑ͘ύονΛ
 ॻ͍͍ͯ·͢

  39. ࠓिɺͱ͋Δ͓࢓ࣄͷRailsΞϓϦ ͷϦϙδτϦͰूܭͯ͠Έͨ݁Ռ Railsຊମ͓ΑͼrailsΦʔΨχθʔγϣϯͰϝϯς͍ͯ͠Δgemͨͪ (16ݸ) ࣗ෼͕࡞ͬͨ΋ͷ (6ݸ) ϝϯςφΛ΍ͬͯΔ(= ίϛοτݖΛ͍࣋ͬͯΔ)΋ͷ (4ݸ) ্هҎ֎ͷ͏ͪɺաڈʹ1ͭҎ্Կ͔Λίϛοτͨ͜͠ͱ͕͋Δ΋ͷ

    (86ݸ) ະίϛοτͷ΋ͷ (211ݸ)
  40. ΞϓϦͰbundle͍ͯ͠Δgemͷ͏ͪ 112/323 ʹ͸Կ͔͠Βίϛοτͯͨ͠ 3෼ͷ1ڧ͙Β͍ ͜Μͳײ͡Ͱɺͱʹ͔͍͘ΖΜͳgemΛಡΈॻ͖
 ͠·͘ΔελΠϧ

  41. ͍ΖΜͳਓ͕ॻ͍͍ͨΖΜͳίʔυΛ ಡΈॻ͖͢Δͷ͸ָ͍͠ͷͰ͓͢͢Ί

  42. ͦͷͨΊʹ͸ɺ೔ࠒ͔Β͍ΖΜͳίʔυΛಡΈ ॻ͖͢Δ·ͰͷϋʔυϧΛԼ͓͛ͯ͘ͷ͕େࣄ ಡΈ͍ͨɺͱࢥͬͨ࣍ͷॠؒʹ͸αοͱಡΈ࢝ΊΒ ΕΔΑ͏ʹ ͦͷ৔Ͱ͙͢ʹύονΛॻ͖࢝ΊΒΕΔΑ͏ʹ

  43. OSSϥΠϒϥϦͷίʔυΛಡΜͰ ύονΛॻ͘ϋʔυϧΛԼ͛Δʹ͸ ·ͣ͸gem-src

  44. gem-src ͍ΖΜͳgemͷιʔείʔυ͕ϞϦϞϦऩूͰ͖Δ ΍ͭ gem installίϚϯυΛ֦ுͯ͠ɺΠϯετʔϧͷ ͍ͭͰʹgemͷιʔείʔυΛউखʹखݩʹclone ͯ͘͠ΕΔΑ͏ʹ͢Δ

  45. ࠓேɺେ͖ͳػೳ௥ՃΛ
 ͠·ͨ͠

  46. gem-src as a Bundler Plugin! % bundler plugin install gem-src

  47. ࠓ೔·Ͱࠔ͍ͬͯͨ͜ͱ ͠͹Β͘લͷBundlerͷ࢓༷มߋͷ͍ͤͰɺ Bundlerܦ༝ͰΠϯετʔϧ͞ΕͨgemͰ͸after- install hook͕૸Βͳ͘ͳ͍ͬͯͨ

  48. BundlerϓϥάΠϯԽ͢Δ͜ͱͰɺBundlerܦ༝ͰΠϯ ετʔϧ͞Εͨgemʹ΋gem-src͕ޮ͘Α͏ʹͳͬͨ

  49. RubyGemsϓϥάΠϯ݉
 rbenvϓϥάΠϯ݉BundlerϓϥάΠϯ 1ϦϙδτϦͰτϦϓϧϓϥάΠϯʂ ͜ΜͳϓϩμΫτ͸ͨͿΜੈքॳͩͱࢥΘΕΔ ͱ͍͏͔RubyGemsϓϥάΠϯ΋rbenvϓϥάΠϯ ΋BundlerϓϥάΠϯ΋ϚΠφʔ͗ͯ͢୭΋࡞ͬͯ ͳ͍

  50. ࠓ೔͔Β͸ɺrbenvͱbundlerͷ྆ํ ͱ΋ʹ૊ΈࠐΜͰ͓͘ͷ͕ਪ঑ઃఆ % git clone https://github.com/amatsuda/gem-src.git "$(rbenv root)/plugins/gem-src" 
 %

    bundler plugin install gem-src
  51. ར༻͍ͯ͠Δgemͷιʔείʔυ͸શͯखݩʹ
 ஔ͍͓͚ͯΔΑ͏ʹͳͬͯɺύονΛൃࣹ͢Δ·Ͱ ͷϦʔυλΠϜ͕ܶతʹॖ·Δ ๻ͷखݩͰ͸ਪఆ2000ݸఔ౓͕cloneࡁΈͰɺ
 ͍ͭͰ΋ύον͕ॻ͚Δঢ়ଶʹͳ͍ͬͯΔ ͜Ε͕ແ͍ͱOSS׆ಈ͕Ͱ͖ͳ͘ͳΔ͘Β͍ศར

  52. ͜ΕͰࠓ೔͔Βύον͕ૉૣ͘ ॻ͚ΔΑ͏ʹͳΔ͸ͣͰ͢

  53. None
  54. ࠓ೔͔ΒύονΛͨ͘͞Μ
 ॻ͍͍͖ͯ·͠ΐ͏

  55. ͦΕ͔Βɺ๻ͷ৔߹ɺଞਓͷϓϩμΫτʹύονΛ ౤͛Δ͚ͩ͡Όͳͯ͘ɺझຯͰΑࣗ͘࡞ͷgemΛ ࡞͍ͬͯ·͢

  56. ࢓ࣄฑɺओʹʮRailsϓϥΪϯʯ

  57. "Rails Plugin" ࢮޠʁ ࠷ۙͰ͸୯ʹ"gem"ͬͯݴΘΕͯΔʁ

  58. gem != Rails Plugin

  59. ౰ͨΓલ͚ͩͲɺੈͷதʹ͸Railsͷ֦ ுҎ֎ͷgem΋͋Δ

  60. rfd

  61. rfd RubyͰ࡞ͬͨFD(ϑΝΠϥʔ)ͷΫϩʔϯ

  62. ݟͲ͜Ζ rfd/commands.rb Կ͔Ωʔ͕ԡ͞ΕΔͱɺͱʹ͔ͦ͘ͷΩʔͷ໊લͷ ϝιου͕࣮ߦ͞ΕΔ

  63. ͖͔͚ͬ ͜ͷcommands.rbͷ࢓૊ΈΛࢥ͍͍ͭͯ͠·ͬͨ ͷͰ࣮૷ͯ͠Έͨ͘ͳͬͯ࡞ͬͨ

  64. ϝϯς 2ը໘ରԠͱ͔͍ͨ͠ͱࢥ͍ଓ͚ͯ਺೥ؒ์ஔத…… ։ൃΛख఻ͬͯ͘ΕΔํืूத

  65. gem != Rails Plugin ࠓ౓͸ٯʹɺgemͰ͸ͳ͍Rails pluginͷύλʔϯ

  66. ੲ͸Railsͷ֦ு͸gem͡Ό
 ͳ͔ͬͨ

  67. i18n_generators

  68. i18n_generators Rails I18nͷϦιʔεϑΝΠϧΛࣗಈ຋༁Ͱੜ੒͠·͘Δ΍ͭ ๻͕ॳΊͯࣗ෼Ͱ࡞ͬͨRails plugin (ͦΕҎલʹ͸ଞਓ͕࡞ͬͨ΋ͷΛforkͯ͠ϝϯςͱ͔͙ͯͨ͠Β͍) 2008೥ GitHubͱ͔Asakusa.rbͱ͔͕Ͱ͖ͨ೥

  69. First CommitΛݟͯΈΔͱ…… https://github.com/amatsuda/ i18n_generators/commit/7a9b45c

  70. Installation

  71. gem install ͱ͔ bundle install ͡Όͳ͍ʂ ౰࣌͸gem͡Όͳ͔ͬͨ͜ͱ͕Θ͔Δ

  72. Rails pluginͱͯ͠͸ൺֱతྺ࢙ ͕௕ͯͣͬ͘ͱϝϯςͯ͠ΔͷͰ Ruby 1.8ʙ3.0ͷશͯͷόʔδϣϯRubyͰಈ͘ Rails 3.0ʙ6.1ͷશͯͷόʔδϣϯRailsͰಈ͘ ݱଘ͢ΔRails I18nؔ࿈ϓϩμΫτͱͯ͠͸࠷ݹͷ ΋ͷ͔΋͠Εͳ͍

  73. ࡞͖͔͚ͬͨͬ Rails I18nϓϩδΣΫτʹ࠷ॳ͔ΒؔΘͬͨ೔ຊਓͩͬͨ ౰࣌޿͘࢖ΘΕ͍ͯͨ gettext-rails ͷϦιʔεΛϕʔεʹͯ͠ɺຊମଆ ͷ ja.yml Λॻ͍ͨ ΞϓϦ಺ͷYAML͸Ωʔͷ໋໊نଇ͕ܾ·ͬͯΔΜ͔ͩΒࣗಈੜ੒Ͱ͖

    ΔͷͰ͸ʁͱࢥͬͨͷͰ΍ͬͯΈͨ Rails I18n͢ΔͳΒ͜͏͍͏΋ͷ͕ඞਢͰ͸ʁͱࢥͬͯ࡞͚ͬͨͲɺ
 ҙ֎ͱ޿·Βͳ͔ͬͨ
  74. ٯʹɺ࡞ऀ͕ࢥͬͨҎ্ʹ
 ޿·ͬͯ͠·ͬͨ΋ͷ

  75. kaminari

  76. kaminari ϖʔδωʔγϣϯ͢Δ΍ͭ 2011೥

  77. ࡞͖͔͚ͬͨͬ ౰࣌σϑΝΫτͩͬͨwill_paginate͕Rails 3ʹ
 ͳ͔ͳ͔ରԠͯ͘͠Εͳͯ͘ࠔͬͯͨ ͦͷ͜Ζ࡞ऀͨͪ͸GitHub͍ͬͯ͏ελʔτΞοϓ Λ૑ۀͯͯ͠๩͔ͬͨ͠ Rails 3ͷ৽ػೳΛ࢖͑͹΋ͬͱ͏·͘࡞ΕΔؾ͕ͨ͠

  78. Rails 3ͷ৽ػೳ Active RecordͷϝιουνΣΠϯํࣜͷ৽API Rails Engine

  79. Rails 3ͷ৽ػೳʹ͍ͭͯͷৄ͍͜͠ͱ͸ ౰࣌ WEB+DB Press Vol. 58 ʹॻ͍ͨ ૯ूฤͷDVDΛങ͑͹ࠓͰ΋ಡΊ·͢

  80. ݱଘ͢ΔதͰ͸ੈքͰԿ൪໨͔ʹ ݹ͍Rails Engine͔΋͠Εͳ͍

  81. kaminari͍ͬͯ͏;໊͚ͨ͟લ ίʔυ͸ॻ͚ͨΜ͚ͩͲɺ໊લ͕ܾΊΒΕͳͯ͘
 2ि͙ؒΒ͍ϦϦʔεͰ͖ͳ͔ͬͨ ౦ژRubyձ͔ٞͳΜ͔Ͱhsbt͞Μʹ͖ͯͱ͏ʹ
 ܾΊͯ΋Βͬͨ

  82. ڞಉϝϯςφ @yuki24 ౰࣌Issue͕100ݸͱ͔ཷ·ͬͯΔͷΛݟΔʹݟ͔Ͷ ͯɺAsakusa.rbͷmeetupͰʮख఻͍·͠ΐ͏ ͔ʁʯͬͯݴͬͯ͘Εͨ

  83. ͻͲ͍ίʔυ ·͍͋Ζ͍Ζྺ࢙తܦҢ͕͋ΔΜͰ͢Α ࠓͱͳͬͯ͸ݟͲ͜Ζ͸ಛʹͳ͍͠ɺίʔυ͸৭ʑ ͻͲ͍ΜͰಛʹಡΉඞཁ͸ͳ͍

  84. 2011೥ͭͳ͕Γ 2011೥ʹ࡞ͬͨଞͷgem

  85. action_args

  86. action_args Railsͷίϯτϩʔϥʔ͕MerbΈ͍ͨʹͳΔ΍ͭ ͜ΕφγͰ͸RailsͳΜ͔࢖͑ͳ͘ͳΔ͙Β͍ศར ͳ΍ͭ

  87. ࣗ෼͕࡞ͬͨgemͷதͰҰ൪޷͖ ͳ΍͔ͭ΋͠Εͳ͍

  88. ࡞͖͔͚ͬͨͬ Rails 3ͷίϯτϩʔϥʔͷίʔυ͕ؾʹ৯Θͳ ͔͔ͬͨΒ

  89. Rails 2 + Merb = Rails 3 ίϯτϩʔϥʔʹؔͯ͠͸ɺྑ͘ͳ͍ํͷAPIΛ
 બ୒ͯ͠͠·ͬͨ ͜͜ͰMerbํࣜΛαϙʔτͰ͖ͳ͔ͬͨͷ͸Rails

    ͷྺ্࢙਺গͳ͍DHHͷ൑அϛεͩͱࢥ͏
  90. ݟͲ͜Ζ https://github.com/asakusarb/action_args/ commit/895b1ad

  91. "using Refinements in order not to reveal our plugin internal

    methods"
  92. ͜ͷgemͷதͰ͔͠࢖Θͳ͍௒ϓϥΠϕʔτͳ ϝιουΛੜ΍ͨ͢ΊʹrefinementsΛ׆༻ ͜͜Ͱ͸ɺActionController::Base ʹϓϥΪϯ಺ ෦༻ͷϩδοΫΛ௥Ճ͍ͯ͠ΔΜ͚ͩͲɺͦΜͳ΋ ͷ͕ϢʔβʔͷΞϓϦʹ࿙Εग़ͪ͠Ό͏ͱΧοίѱ ͍ ͦ͜ͰɺϑΝΠϧείʔϓͳϝιουΛݺͼ͍ͨͱ ͜ΖͰ͚ͩੜ΍͢Α͏ʹ͢Δ

  93. 2015೥8݄ ͜ͷίϛοτ͕ߦΘΕͨ2015೥8݄ʹԿ͕͋ͬͨͷ ͔ʁ

  94. ͖͔͚ͬ͸ @_ksss_ ͞Μͷπ Πʔτ

  95. https://twitter.com/_ksss_/ status/631458253688340480

  96. https://twitter.com/a_matsuda/ status/631470723974873093

  97. https://twitter.com/_ksss_/ status/631478188414144512

  98. https://twitter.com/_ksss_/ status/631589269283303424

  99. https://twitter.com/a_matsuda/ status/631608168175415296

  100. ͪͳΈʹཌ೥ʹ͸Railsʹ΋ೖΕͨ https://github.com/rails/rails/commit/ 571f0f32 ͜Ε͕Rails্࢙ॳrefinements

  101. https://github.com/rails/ rails/commit/571f0f32

  102. Refinements ͓࢓ࣄͷRailsΞϓϦͰ͸΄ͱΜͲ࢖͍ಓ͕ͳ͍͚ ͲɺϥΠϒϥϦ΍ϑϨʔϜϫʔΫͷ։ൃʹ͸͛͢ʔ ศར

  103. ͓ͦΒ͘͜ͷػೳΛ͏·͘࢖͏ͱɺΊͪΌΊ ͪΌ៉ྷͳϑϨʔϜϫʔΫΛ࡞Δ͜ͱ΋Մೳ͔΋ public APIϝιουҎ֎͸ϢʔβʔʹԿ΋ݟ͑ͯͳ ͍Έ͍ͨͳ Ͱ΋Rails͸͍·͞Βແཧ͔ͳ……

  104. ͦΕ͔Βɺ2011೥ʹ࡞ͬͨ΋ͷΛ ΋͏ͻͱͭ

  105. active_decorator

  106. active_decorator ͍ΘΏΔσίϨʔλʔ Active Model͕஀ੜͨ͜͠ͱ΋͋ͬͯɺ Presenterύλʔϯͱ͔ͦ͏͍͏ͷ͕ྲྀߦͯͨ͠ Draper͕Ͱ͖ͨͷ΋͜ͷ͜Ζ

  107. ͖͔͚ͬ Draperͷख৮Γ͕͋·Γʹ΋RubyΒ͘͠ͳͯ͘
 ؾ࣋ͪѱ͍ͷͰɺࣗ෼Ͱ΋ͬͱײ৮ͷྑ͍΋ͷΛ ࡞ͬͨ ਖ਼͍͠ઃܭͱਖ਼͍࣮͠૷Λࢥ͍͍ͭͯ͠·ͬͨ

  108. ਖ਼͍͠ઃܭͱਖ਼͍࣮͠૷ view helperͳΜ͔ͩΒɺhelperͱಉ༷viewͷதͰ
 ͚ͩ༗ޮʹͳΔ΂͖
 => ͋ɺͱ͍͏͜ͱ͸ɺview_assigns ͷλΠϛϯάͰҾ ͖౉͠ର৅ͷivarΛObject#extend͢Ε͹͍͍ͷͰ ͸ʂ

  109. view_assignsͱ͔;ͭ͏஌Βͳ͍ ͱࢥ͏ΜͰ͚͢Ͳɺ ͜ͷAPIͷ஌͕ࣝ͋Δ͔ͳ͍͔͕ɺDraperͱͷ
 ख৮ΓͷࠩΛੜΜͩ

  110. WEB+DB Press Vol.58ͷಛू1Λॻͨ͘Ίʹ Rails 3ͷίʔυΛಡΈ·ͬͨ͘ͷ͕࣮݁ͨ͠

  111. ख৮Γ ;ͭ͏ͷRubyͷϞδϡʔϧΛૉ௚ʹ࢖͏͚ͩ ಛघͳجఈΫϥεΛܧঝͱ͔͠ͳ͍ ͓·͡ͳ͍Λ֮͑ͳͯ͘ྑ͍ RubyͷύϫʔΛͦͷ··࢖͏

  112. ࣅͨΑ͏ͳίϯηϓτͷ΋ͷΛ
 ΋͏1ݸ

  113. jb

  114. jb JSONΛ࡞ΔͨΊͷςϯϓϨʔτΤϯδϯ jbuilder͍ͬͯ͏DSL͕ԚΒͯ͘͠࢖͍ํ͕֮͑
 ʹ͍͘΍ͭͷalternative

  115. ίϯηϓτ JSONͱRubyͷHash͍͍ͬͯͩͨҰॹͩΑͶ ςϯϓϨʔτͷதͰจࣈྻΛ੾ͬͨுͬͨͯ͠ JSONͬΆ͍จࣈྻΛ૊ΈཱͯΔΜ͡Όͳͯ͘ɺ HashͷΠϯελϯεΛ࡞ͬͨΒͦΕΛJSONʹ͠ ͯ͘ΕΔ΄͏͕௚ײతͩ͠ے͕ྑ͍ͷͰ͸ʁ

  116. ઃܭͱ࣮૷ Action ViewͰ͸1ຕ1ຕͷςϯϓϨʔτ͕ίϯύΠϧ͞Εͨ ΋ͷ͕ϝιουͱͯ͠ఆٛ͞ΕΔ jbͰ͸ίϯύΠϧ΋Կ΋ͳͯ͘ɺςϯϓϨʔτʹॻ͍ͨ΋ͷ ͕ͦͷ···ΔͬͱϝιουbodyʹͳΔ ͦͷϝιου͕HashͷΠϯελϯεΛฦ͢Α͏ʹ͢Ε͹͍ ͍͚ͩɻͱʹ͔͘;ͭ͏ͷRubyΛॻ͚͹ྑ͍

  117. ϝϦοτ ṖͷDSLΛ֮͑ͳͯ͘ྑ͍ Կ΋ͯ͠ͳ͍ͷͰ଎͍ jbuilderΑΓ΋ϑΝΠϧ໊ͷ֦ுࢠ͕୹͍

  118. ݟͲ͜Ζ template handlerͷԿ΋΍ͬͯͳͬ͞΀Γ

  119. lib/jb/handler.rb

  120. handler͕Կ΋΍ͬͯͳ͍ςϯϓϨʔτ
 ΤϯδϯΛ΋͏1ݸ

  121. string_template

  122. ݱଘ͢ΔRubyͷςϯϓϨʔτ
 ΤϯδϯͷதͰ͸Ӊ஦࠷଎

  123. jbͱಉ͡ײ͡ͰɺςϯϓϨʔτ͕
 ͦͷ··ϝιουbodyʹͳΔ ͦ͜Ͱฦͨ͠String͕ͦͷ··HTMLͱ͔ʹͳΔ

  124. ςϯϓϨʔτ͕ΫΦʔτ͞Εͨ΋ͷ͕ ·Δ͝ͱ1ຊͷStringϦςϥϧʹͳΔ ແବͳbufferΦϒδΣΫτ͕࢖ΘΕͣʹҰܸͰ String͕૊ΈཱͯΒΕΔͷͰੈք࠷଎

  125. ͨͩͷRubyͳͷͰɺಛघͳຒΊࠐΈ
 ه๏ͱ͔͸Ұ੾ͳ͍

  126. <%= %> ͱ͔ແͯ͘େৎ෉ͳͷʁ

  127. RubyͷStringʹ͸ #{} ͷ interpolation ͕͋ΔΜͰ͢Αʂ ͜ΕͰ͚ͬ͜͏ͳΜͱ͔ͳΔ

  128. ࢖͍Ͳ͜Ζ layoutϑΝΠϧͱ͔Έ͍ͨͳɺΊͬͪΌrender͞ ΕΔ͚Ͳ͋·Γසൟʹ͍͡Βͳ͍Α͏ͳ΋ͷ͸͜Ε Ͱॻ͍͓ͯ͘ͱύϑΥʔϚϯε͕Ք͛Δ͔΋

  129. ݟͲ͜Ζ ΍ͬͺΓtemplate handlerͷԿ΋΍ͬͯͳͬ͞΀ Γ

  130. lib/string_template/ handler.rb

  131. Τϯδϯͭͳ͕Γ Τϯδϯ͸ΤϯδϯͰ΋ɺࠓ౓͸ςϯϓϨʔτΤϯ δϯ͡Όͳͯ͘ Rails Engine

  132. heavens_door

  133. heavens_door ΈΜͳେ޷͖Capybaraͷςετίʔυ͕ɺϒϥ΢ βͷૢ࡞͔Βੜ੒Ͱ͖ΔEngine

  134. ໊લ ࿐൐ઌੜͷελϯυ ͳΜ͔ͦΕͬΆ͍ؾ͕ͨ͠Μ͚ͩͲɺ·͋Θ͔Γʹ ͔ͬͨ͘Ͱ͢Ͷ

  135. ͖͔͚ͬ ZOZOςΫϊϩδʔζ͞Μͷ৽نҊ݅ͰɺΈΜͳͰ systemςετॻ͜͏͍ͥͬͯ͏͜ͱʹͳͬͯ Ͱ΋खॻ͖Ͱ͍͍ͪͪॻ͘ͷ͸େมͩͬͨͷͰ

  136. ࣮͸ϒϥ΢βૢ࡞Ϟʔυ͚ͩ͡Όͳͯ͘ ίϚϯυϥΠϯϞʔυ΋͋ͬͨΓ͢Δ

  137. ίϚϯυϥΠϯϞʔυʁ ࡞ͬͨຊਓʹ͔͠࢖͍ํ͕Θ͔Βͳ͍πʔϧʹͳΓ ͦ͏ͳͷͰ৸͔ͤͯ͋Δ

  138. ઌߦݚڀ ͜ͷϒϥ΢β্ͷૢ࡞Λه࿥ͯ͠capybaraͷίʔ υΛు͘ػೳ͸ɺ2010೥ʹ࡞ͬͨhocus_pocusͬ ͍ͯ͏Rails Engine pluginͷػೳͱͯ͠طʹ࣮૷ ࡁΈͩͬͨ΋ͷ

  139. ͜Μͳ;͏ʹxx೥ܦ͔ͬͯΒੲॻ͍ͨ ίʔυͷժ͕ग़ͨΓ͢Δ͜ͱ΋͋Δ ௕೥ίʔυΛॻ͖ଓ͚ͯΔͱΞυόʔςʔδ͕͋ͬ ͨΓ͢Δɺͱ͍͏ࣄྫ

  140. hocus_pocus

  141. hocus_pocus WikiΈ͍ͨͳײ֮Ͱɺϒϥ΢β্Ͱૢ࡞ͨ͠Βαʔ όʔ্Ͱϖʔδ͕࡞ΕΔRails Engine

  142. ࡞Γ࢝Ίͨͷ͸2010೥ Kaminari͕Engineͱͯ͠͸૬౰ݹ͍͖ͬͯͬ͞ ݴ͚ͬͨͲɺͦΕΑΓݹ͔ͬͨ ͍͢͝Φʔύʔπ͔΋͠Εͳ͍

  143. ͍·͍ͪྲྀߦΒͳ͔ͬͨ…… UI͕ϔϘ͗ͨ͢ πʔϧࣗମͷ֓೦͕೉͗ͨ͢͠ υΩϡϝϯτ͕ແͩͬͨ ΍Γ͔ͨͬͨ͜ͱ͸Ͱ͖ͦ͏ʂͬͯࢥͬͨΒͳΜ͔ ๞͖ͨ

  144. ͍͍ͩͨͰ͖ͨʂ => ͪΌΜͱ࢖͑ Δ·Ͱ࡞ΓࠐΉͷ͕ۤख

  145. ίϯηϓτ͕ಛघͩ͠࢖͍ํ΋೉ղͰɺ࡞ͬͨ ຊਓʹ͔͠࢖͍ํ͕Θ͔Βͳ͍πʔϧʹͳͬͯ ͠·ͬͨ

  146. ͜ͷϓϩμΫτ͕ٴ΅ͨ͠Өڹ Railsඪ४ͷweb-consoleΛΠϯεύΠΞ https://github.com/rails-girls-summer-of- code/summer-of-code-2014/wiki/Project- ideas#conductor-web-based-assistant-for- development

  147. ࡞ͬͨߕ൹͸͋ͬͨΈ͍ͨ ݁ہweb-console͸΍ͬͯΔ͜ͱ͸ͥΜͥΜҧ͏ ͚Ͳ……

  148. Capybaraؔ࿈ͷϏδϡΞϧܥͷ EngineΛ΋͏1ͭ (͋ͱ͍ͭͰʹݴ͏ͱϓϩάϨۂ໊ͭͳ͕Γ)

  149. roundabout

  150. roundabout ը໘ભҠਤੜ੒πʔϧ

  151. ը໘ભҠਤͷੜ੒ ࣮૷ͱͯ͠͸CapybaraͷϞϯΩʔύον ςετίʔυதʹCapybaraͰൃੜͨ͠ϦΫΤετ ͷભҠΛશ෦ه࿥͢Δ ͜ΕΛͭͳ͛ͯֆʹ͢Δͱը໘ભҠਤʹͳΔ

  152. ͜Μͳײ͡(RedmineϓϩδΣΫτͰ ࣮ߦͨ݁͠Ռ)

  153. ਤʹ͸ςετ͕ॻ͔Ε͍ͯΔ
 ΋ͷ͔͠ग़ͯ͜ͳ͍ ͭ·Γɺ͋ΔछͷςετΧόϨοδతͳ΋ͷ͕Մࢹ Խ͞ΕΔπʔϧͰ͋Δͱ΋ݴ͑Δ

  154. ΞΠσΞ͸͓΋͠Ζ͍͠ɺϙςϯγϟϧ͸͋Δ ؾ͕͢ΔΜ͚ͩͲɺ͋·Γ࢖ΘΕͯΔखԠ͑͸ ͳ͍͔΋ ͜ΕΛػʹͥͻ͝ར༻͍ͩ͘͞

  155. ΧόϨοδؔ࿈ͭͳ͕ΓͰ

  156. per_file_coverage (unreleased)

  157. per_file_coverage (Ծ) ςετ࣮ߦ࣌ʹɺΞϓϦΛߏ੒͢Δ֤ϑΝΠϧ͕
 Ͳͷςετ͔Βݺͼग़͞Ε͍ͯΔ͔(ͱɺͦͷٯ)Λ
 શ෦ચ͍ग़ͯ͠ՄࢹԽ͢Δ

  158. ࣮૷ͱͯ͠͸SimpleCovͷ
 ϓϥάΠϯ (ͨͩ͠SimpleCovʹ͸ϓϥάΠϯͳͲͱ͍͏֓೦ ͸ͳ͍)

  159. ஍ࠈͷϞϯΩʔύον ͦ͏͍͑͹͍͓ͪ͏ SimpleCov ͷίϛολʔͰ͸ ͋ΔͷͰɺ֦ு͕͠΍͍͢Α͏ʹϑΟʔυόοΫ͙ Β͍͸͍͖͍ͯͨ͠

  160. RubyͷCoverageϞδϡʔϧΛ
 ར༻

  161. ͖͔͚ͬ ANDPADࣾͷͦͦ͜͜ͷن໛ͷطଘΞϓϦʹࢀը ͯ͠ɺʮ͜ͷίʔυ͸ͲͷspecϑΝΠϧ͔Βςε τ͞ΕͯΔΜͩΖ͏ʁʯͱ͔ɺٯʹʮ͜ͷspec͸ Ͳ͜Β΁ΜͷϑΝΠϧΛςετͯ͠ΔΜͩΖ͏ʯͱ ͔஌Γͨ͘ͳͬͨͷͰ

  162. application_controller͚ͩͰ΋300ݸͱ͔͋Δ ͷͰɺ΍ͬͺ͜͏͍͏ͷ͕஌Γͨ͘ͳΔΜͰ͢Α

  163. Ξ΢τϓοτྫ

  164. ͔͠͠ɺgem͸·ͩͳ͍…… HTML͕ڊେԽͨ͠৔߹ͷύϑΥʔϚϯε໰୊͕
 ౗͍ͤͯͳ͍ ໊લ͕ܾ·͍ͬͯͳ͍ʂ

  165. ୭໊͔͍͍લΛ͚͍ͭͯͩ͘͞ ͓ئ͍͠·͢

  166. Coming Soon...

  167. ࠷ۙͷ͓࢓ࣄؔ࿈Ͱ࡞ͬͨ΋ͷΛ ΋͏1ͭ

  168. lightweight_attributes

  169. lightweight_attributes Active RecordͷϞσϧͷΠϯελϯεੜ੒Λۃྗ ܰ͘͢ΔͨΊͷ͑͛ͭͳ͍ϞϯΩʔύον

  170. ARͷϞσϧͷΠϯελϯεੜ੒ AR 4͙Β͍Ͱೖͬͨtype castingͱ͔͍͏୭΋࢖ͬͯͳ ͍ػೳͷͨΊʹٸܹʹॏͨ͘ͳͬͨ ͱʹ͔͘DB͔ΒϞσϧΛΨόοͱҾͬுͬͯฦ͚ͩ͢Έͨ ͍ͳAPIͱ͔ͩͱɺ͕͜͜ϘτϧωοΫʹͳΔ RubyϨϕϧͰ͸ɺಛʹTimeతͳ΍ͭͷparse͕஗͔ͬͨ Γ͢Δ

  171. RubyͰTimeతͳ΍ͭͷparse͕ ଎͘ͳΔͱ͍͍ͳ͊ https://bugs.ruby-lang.org/issues/16005

  172. https://bugs.ruby-lang.org/ issues/16005

  173. ͱ΋͋Εɺ lightweight_attributes ʹ͍ͭͯ

  174. sponsored by ΞΧπΩ ࠓ೥͔Βnobuͷύτϩϯʹͳͬͨ͋ͷΞΧπΩࣾ Ͱ͢ʂ

  175. ίʔυ͕͑͛ͭͳ͗ͯ͢͞
 ϝϯςෆೳ ͜ͷ΁Μͷίʔυ͸Railsͷόʔδϣϯ͝ͱʹͥΜ ͥΜҧͬͯͯɺෳ਺όʔδϣϯରԠͱ͔Ϛδແཧ

  176. ͱ͍͏͜ͱͰɺ·ͱ΋ʹϝϯς ͞Εͯͳ͍ͷͰར༻͸ඇਪ঑

  177. type castingΛ஗Ԇͤ͞Δͱ͍͏ ΞΠσΞ kamipo͞Μ͕͏·͍͜ͱरͬͯActive Record 6.1ʹίϛοτͯ͘͠Ε͔ͨΒ΋͏͓ଂೖΓͰ͍͍͔ ͳ……

  178. Rails 6.1

  179. Coming Soon...

  180. ΞΧπΩ͞ΜεϙϯαʔͰ΋͏1ͭ

  181. activerecord-ruby (unreleased) ΞϓϦதͰߋ৽͞Εͳ͍͜ͱ͕લఏͷ͍ΘΏΔ
 ʮϚελʔσʔλʯΛΠϯϝϞϦʹల։ ARͷΦϒδΣΫτͷ··Ωϟογϡ͢Δ readonlyͳͷͰ҆৺ͯ͠࢖͍ճͤΔ

  182. ૂ͍ ΫΤϦͷແବଧͪΛ཈੍ ARͷΦϒδΣΫτੜ੒ίετΛ࡟ݮ GCෛՙΛܰݮ

  183. ͜͜·ͰͳΒ୭΋͕ߟ͑ͨ͜ͱ͋Δͱࢥ͏ Μ͚ͩͲɺΠϯλʔϑΣΠεͱ࣮૷͕໰୊ Model.fetch_from_cache ͱ͔ͦ͏͍͏ײ͡ͷ
 μα͍ίʔυ͸ઈରॻ͖ͨ͘ͳ͍ ϓϩμΫγϣϯͷίʔυ͸;ͭ͏ͷARͷίʔυ͔Β Կ΋ม͑ͣʹɺͰ΋ͲͷϞσϧ͕ʮϚελʔςʔϒ ϧʯ͔͚ͩڭ͑ͯ΍ͬͨΒউखʹۭؾΛಡΜͰಈ࡞ ͢Δ͙Β͍͕͍͍

  184. activerecord-ruby ͷAPI ʮϚελʔʯͬΆ͍ϞσϧʹҎԼͷΑ͏ͳએݴΛ
 ೖΕΔ class Country < ActiveRecord::Base find_by_ruby! end

  185. ͦΕ͚ͩ ଞͷίʔυ͸Ұ੾͍͡Βͳͯ͘΋ɺҎԼͷΫΤϦͨ ͕ͪDBΛݺͼग़͢͜ͱͳ͘ద੾ͳ஋Λฦ͢ Model.find(id) Model.where(prefecture: 'Tokyo').order(:created_at)

  186. joins͕ೖͬͯͨΓ͢ΔΑ͏ͳෳࡶͳΫΤϦ ͕౤͛ΒΕͨΒDBʹϑΥʔϧόοΫ͢Δ

  187. ϝϞϦ͔Βऔ͖ͬͯͨ΋ͷͱDB͔Βऔ͖ͬͯͨ ΋ͷʹᴥᴪ͕ͳ͍͔Ͳ͏͔ൺֱ͢ΔϞʔυΛ౥ࡌ ςετΛ͜ΕͰճ͓ͯ͘͠ͱ҆৺Ͱ͖Δ͸ͣ

  188. ύϑΥʔϚϯεήΠϯ ະ஌਺ ਖ਼௚ͳͱ͜Ζɺ·ͱ΋ͳ࣮ΞϓϦͰͷޮՌ͸ݶఆత ͳ༧ײ͸͍ͯ͠Δ DBͷ઀ଓ͕ύοπϯύοπϯΈ͍ͨͳ؀ڥͰ͸
 ޮ͔͘΋

  189. ݟͲ͜Ζ ARͷΠϯλʔϑΣΠεͱγʔϜϨεʹ࿈ܞ͢ΔͨΊ ͷςΫχοΫ

  190. ࣮૷ৄࡉ AR͕૊ΈཱͯͨASTΛSQLͰ͸ͳͯ͘Rubyͷ
 ίʔυʹม׵͢Δ ToRuby visitor ΛΰϦΰϦ࣮૷

  191. gem͸·ͩͳ͍

  192. Coming Soon...

  193. ࠓ·Ͱʹແ͔ͬͨΞϓϩʔνͩ͠ɺίʔυ΋͔ ͳΓ͓΋͠Ζ͍ͷͰɺੈʹग़ͨΞΧπΩʹ͸ͥͻ ͍ͬͯ͡Έ͍ͯͩ͘͞

  194. ઌߦݚڀ arel_ruby

  195. arel_ruby https://github.com/amatsuda/arel_ruby (2012೥)

  196. ArelͷASTͷRuby visitor ͭ·ΓɺࠓճͷϓϩμΫτͷΤϯδϯ෦෼ͦͷ΋ͷ

  197. ͜Ε͸౰࣌ɺRDB͔Β੾Γ཭ͯ͠Rubyͷੈք͚ͩ ͰΞϓϦͷςετ͕࣮ߦͰ͖ͨΒ͓΋͠Ζ͍͔΋ɺ ͱࢥͬͯ΍ͬͯΈͨ΋ͷ ͋·Γݱ࣮తͳϢʔεέʔεͰ͸ͳ͔ͬͨͷͰɺ
 ୯ʹ໘നͦ͏͔ͩΒ࡞ͬͯΈ͚ͨͩΈ͍ͨͳײ͡ʹ ͳͬͯ͠·ͬͨ ͦͯͣͬ͠ͱ͓ଂೖΓ

  198. ίʔυ͸ॻ͚ͯ΋Ϣʔεέʔε Λݟޡͬͨྫ

  199. 8೥ܦͬͯɺ৽ͨͳϢʔεέʔεΛ ݟ͚ͭͯ෮׆

  200. ͜Μͳ;͏ʹxx೥ܦ͔ͬͯΒੲॻ͍ͨ ίʔυͷժ͕ग़ͨΓ͢Δ͜ͱ΋͋Δ ௕೥ίʔυΛॻ͖ଓ͚ͯΔͱΞυόʔςʔδ͕͋ͬ ͨΓ͢Δɺͱ͍͏ࣄྫ

  201. ·ͱΊ

  202. ΍ͬͺRails RailsΛ͍ͬͺ͍ಡΜͩΓॻ͍ͨΓ͍ͯ͠ΔͱRails ʹৄ͘͠ͳΔ

  203. ͍ͭͰ΋Ͳ͜Ͱ΋ૉૣ͘
 ύονΛॻ͜͏ Railsʹৄ͘͠ͳΔͱɺRails͚ͩ͡Όͳ͍ͯ͘ΖΜ ͳ΋ͷʹύον͕ॻ͚ΔΑ͏ʹͳΔ gem-srcΛrbenv΍bundlerͱ࿈ܞ͓͍ͤͯͯ͞ɺ ৗʹ࠷୹खॱͰύονΛ౤͚͛ͭΕΔ४උΛ੔͑ͯ ͓͜͏

  204. ͱʹ͔ͨ͘͘͞Μ
 ύονΛॻ͜͏ ύονΛͨ͘͞Μॻ͔ͳ͍ͱɺύον͕ॻ͚Δ
 Α͏ʹ͸ͳΒͳ͍ ྔ͕࣭ʹస͡Δ͜ͱ΋͋Δ

  205. gem࡞Ո΁ͷಓ ͍ΖΜͳ΋ͷʹύονΛॻ͍ͯΔͱɺଞਓʹॻ͔ͤ ΔΑΓࣗ෼Ͱॻ͍ͨ΄͏͕ྑ͍΋ͷ͕Ͱ͖Δ͜ͱ͕ Θ͔Δ ͖͔͚ͬ΍ϢʔεέʔεΛ͔ͭ·͑ͯɺϓϩμΫτ ʹ͍ͯ͜͠͏

  206. ͦΜͳΜ୭Ͱ΋ࢥ͍ͭ͘Ͱ͠ΐɺΈ͍ͨ ͳgemͰ΋ͱʹ͔͘΍ͬͯΈΔͱྑ͍ ҙ֎ͱ୭΋΍Ζ͏ͱͯ͠ͳ͔ͬͨΓɺࣗ෼͕ੈքͰ Ұ൪͏·͘΍ΕͨΓ͢Δ

  207. ໊લॏཁ ໊લ͚ͭΔͷΉ͍ͣ ໊લ͕͚ͭΕͳͯ͘ࠓ೔ͷൃදʹؒʹ߹Θͳ͔ͬͨ ΋ͷ͕͍͔ͭ͋͘ΔͷͰɺ୭͔Ұॹʹ໊લΛߟ͑ͯ ΄͍͠……

  208. gemͷख़੒ ࡞ͬͨgem͸͙͢ʹժ͕ग़ͳͯ͘΋ɺޙ͔ΒϢʔε έʔε͕͍͖ͭͯͯɺԿ೥΋ܦ͔ͬͯΒ໾ʹཱͬͨ Γ͢Δ ͷͰɺ΍ͬͺΓΞΠσΞΛ͖ͪΜͱίʔυʹམͱ͠ ͓ͯ͘͜ͱ͕େࣄ

  209. ϝϯς gemΛ͍ͬͺ͍࡞ͬͨΓͯ͠Δͱɺϝϯςର৅͕
 ૿͑͗ͯ͢ख͕ճΒͳ͘ͳΔ ͦ΋ͦ΋๞͖ͬΆ͍ਖ਼֬ͳͷͰϝϯςͱ͔ۤख…… ͳͷͰɺ୭͔ϝϯςख఻ͬͯ͘ΕΔͱͱͯ΋خ͠ ͍……

  210. Future Works ࠓޙͱ΋ɺԿ͔ϓϩμΫτͷΞΠσΞ͕͖߱ͬͯͨ Βɺ਺ϲ݄ʹ1ճ͙Β͍ͷϖʔεͰgemΛ࡞Γଓ͚ ͍ͨ @amatsuda ͷ࣍ճ࡞ʹ͝ظ଴͍ͩ͘͞ʂ

  211. Coming Soon!

  212. ·ͱΊ গ͠Ͱ΋օ͞Μͷ͜Ε͔ΒͷOSS׆ಈͷώϯτʹ ͳ͍ͬͯΕ͹޾͍Ͱ͢

  213. end name: Akira Matsuda GitHub: @amatsuda Twitter: @a_matsuda