$30 off During Our Annual Pro Sale. View Details »

object-oriented social coding scripting language Ruby

object-oriented social coding scripting language Ruby

とちぎRuby会議04招待講演のスライド, 2011/12/3 http://regional.rubykaigi.org/tochigi04

Akira Matsuda

December 04, 2011
Tweet

More Decks by Akira Matsuda

Other Decks in Programming

Transcript

  1. ΦϒδΣΫτࢦ޲ ιʔγϟϧίʔσΟϯά εΫϦϓτݴޠRuby a_matsuda

  2. None
  3. ͍͖ͳΓࢲࣄͰڪॖ Ͱ͕͢ɺ

  4. ઌ݄ࢠͲ΋͕ ࢈·Ε·ͨ͠ɻ

  5. ✴twitter: a_matsuda ✴github: amatsuda

  6. ID໰୊

  7. GitHub͸࠷ॳIDʹ Ξϯεί͕ ࢖͑ͳ͔ͬͨ

  8. real name: Akira Matsuda

  9. ໊લ΋බࣈ΋;ͭ͏͢ ͗ͯIDͷ֬อ͕೉͍͠

  10. kakutani ͱ͔͏Β΍·͍͠

  11. ࢠڙͨͪ΋ ;ͭ͏ͷ໊લʹͨ͠ ͷͰۤ࿑ͦ͠͏

  12. ୈ1෦ ΦϒδΣΫτࢦ޲ ιʔγϟϧίʔσΟϯά εΫϦϓτݴޠRuby

  13. ✴twitter: a_matsuda ✴github: amatsuda

  14. ✴twitter: a_matsuda ✴github: amatsuda

  15. ࣭໰1 GitHubͬͯԿʁ

  16. ࣭໰2 GitHubͷΞΧ΢ϯτΛ ·ͩ࣋ͬͯͳ͍ਓʁ

  17. https://github.com/

  18. ࣭໰3 GitHubͰຖ೔͓࢓ࣄͷ ίʔυॻ͍ͯΔਓʁ

  19. ྺ࢙ͷ͓͞Β͍

  20. Ruby

  21. ʮΦϒδΣΫτࢦ޲ εΫϦϓτݴޠʯ

  22. http://www.ruby-lang.org/ja/about/ “Ruby͸ɺखܰͳΦϒδΣΫ τࢦ޲ϓϩάϥϛϯάΛ࣮ݱ ͢ΔͨΊͷछʑͷػೳΛ࣋ͭ ΦϒδΣΫτࢦ޲εΫϦϓτ ݴޠͰ͢ɻ“

  23. made in Japan

  24. grew up in US

  25. ೔ຊ͸Rubyޙਐࠃɻ

  26. ೔ຊͷRubyͷྺ࢙͸ٯ༌ೖͷྺ࢙ ✴ΧϯϑΝϨϯε ✴WEBΞϓϦ ✴ιʔγϟϧίʔσΟϯά

  27. ΧϯϑΝϨϯε ✴ RubyConf ✴ RubyKaigi

  28. http://blade.nagaokaut.ac.jp/cgi- bin/scat.rb/ruby/ruby-talk/11883 RubyConf.new(2001)

  29. 2006೥ ʮ೔ຊRubyΧϯϑΝϨ ϯε2006ʯ

  30. http://rubyonrails.org/ “Rails was created in 2003 by David Heinemeier Hansson”

  31. Rails in Japan RailsͰϝγ৯ͬͯΔ ਓʁ

  32. Ruby on Railsݱ৅ ✴Ruby͕࢓ࣄʹͳΔ ✴೔ຊͰ΋ఆண͖ͯͨ͠ײ ✴͜͜਺೥͸Rails͚ͩͰ ϝγ͕৯͑ͯ·͢

  33. ୈ3ͷจԽతٯ༌ೖ “Social Coding”

  34. https://github.com/about Company Founded: 2008

  35. Rails premieres on GitHub “GitHub has now officially launched and

    Rails is right there at the premiere. The Rails repository now lives at rails/rails and you can check it out with: git clone git://github.com/rails/ rails.git”
  36. WEB+DB Press Vol. 48 (2008/12) ಛू1 [ݴޠผ] Ϟμϯϓϩάϥϛϯά ೖ໳

  37. None
  38. ೔ຊॳͷGitHubྱࢍهࣄ (ͨͿΜ)

  39. ͍͍͜ͱॻ͍ͯΔ “GitHub ͷ࠷େͷಛ௃͸ɺʮਓʯʹϑΥʔ ΧεΛ౰ͯɺΦʔϓϯιʔειϑτ΢ΣΞ (OSS)ͷੈքʹιʔγϟϧͳࢹ఺Λ࣋ͪࠐ Ή͜ͱʹ੒ޭͨ͠఺Ͱ͢ɻGitHub Ͱ͸ɺ ʮϓϩδΣΫτʯʹʮਓʯ͕ΞαΠϯ͞Ε ΔͷͰ͸ͳ͘ɺʮਓʯ͕ʮϓϩδΣΫτʯ Λ࣋ͭΑ͏ͳΠϝʔδʹͳ͍ͬͯ·͢ɻ“

  40. ೔ຊॳͷGitHubྱࢍهࣄ (ͨͿΜ) ॻ͍ͨͷΦϨΦϨ

  41. ະདྷΛ༧ݴ “GitHub ͸·͞ʹίʔυͰޠΓ߹͏ SNS(Social Networking Service)ͳͷ Ͱ͢ɻ͜ͷߏ଄͸OSSίϛϡχςΟ ͷຊ࣭Λ޼Έʹද͓ͯ͠ΓɺOSS։ ൃͷύϥμΠϜΛେ͖͘ม͑Δ͖ͬ ͔͚ʹͳΔՄೳੑΛൿΊ͍ͯ·͢ɻ”

  42. ͓ങ͍ٻΊ͸ͪ͜Β

  43. 2008೥ͷRubyಛूͰGitͷ࿩ ✴RubyΛޠΔ্ͰGit͸ط ʹ͔ܽͤͳ͍ଘࡏͩͬͨ ✴RubyίϛϡχςΟ͕Git Λൃݟͨ͠

  44. Why Ruby? ͳͥRuby—GitHub ͳͷ͔ʁ

  45. 2ͭͷཧ༝ ✴σβΠϯ ✴ޮ༻

  46. RubyͷσβΠϯ “Ruby is designed to be human-oriented” (Matz)

  47. ιʔείʔυΛ౤͛߹ͬͯ ίϛϡχέʔγϣϯΛߦ͏SNS ಡΊ͹Θ͔ΔcommitΛ ࡞Δඞཁ͕͋ΔɻՄಡ ੑ͕ͱͯ΋ॏཁɻ

  48. ·͞ʹ૬ࢥ૬Ѫ— ✴GitHub: ίʔυΛ࢖ͬͯޠ Γ߹͏SNSɻՄಡੑॏཁɻ ✴Ruby: ίϯϐϡʔλʔͰ͸ ͳͯ͘ਓؒʹϑΥʔΧε͠ ͨݴޠɻՄಡੑߴ͍ɻ

  49. Rubyͷޮ༻ “Ruby͸ΩϝΔͱ ؾ͍͍࣋ͪ” (Matz)

  50. ”Ruby͸ਓ༷͕ؒؾ෼ Α͘ϓϩάϥϛϯά͢ ΔͨΊͷݴޠ” (Matz)

  51. For whom we write code? RubyΛ࢖ͬͯ஻ͬͯΔ ૬ख͸ύιίϯ͡Όͳ ͍ɻਓؒͩɻ

  52. We’re talking to humans using Ruby ͜Ε͸RubyistͳΒ ΈΜͳΫϦΞ͍ͯ͠Δ ͱ͜ΖͰ͢ΑͶɻ

  53. RubyΛ࢖ͬͯ୭Λؾ࣋ͪྑͤ͘͞Δͷ͔ ✴not only ࣗ෼ ✴Πϯλʔωοτͷ޲ ͜͏Ͱܨ͕Δਓʑ ✴ͭ·Γੈք

  54. ૬৐ޮՌͰϠό͍͜ͱʹ ҰਓͰΩϝͯؾ͍࣋ͪ ͍΋ͷ͸ɺΈΜͳͰ ϠοͨΒ΋ͬͱ΋ͬͱ ؾ͍͍࣋ͪʂ

  55. ੈքதͷΈΜͳ͕ूͬͯRubyΛ࢖ͬ ͯίϛϡχέʔγϣϯ͕ߦΘΕΔ৔ That’s called “the Ruby community”

  56. “The Ruby Community”ʹ͓͚ Δ೔ຊਓͷϓϨθϯεෆ଍ GitHubͰ೔ຊਓͷ໊લ Λ໓ଟʹݟͳ͍

  57. Ruby Hero Award(স) զΒ͕ʮRuby Heroʯ m_sekiͰ͢Β ϊϛωʔτ΋͞Εͳ͍ ͱ͍͏ݱ࣮

  58. ೔ຊਓͷϓϨθϯεෆ଍ͷཁҼ ✴஍ཧత৚݅ʁ ✴ݴ༿ͷนʁ

  59. ஍ཧత৚݅ ؔ܎ͳ͍Αɻ Πϯλʔωοτ ͩ΋Μɻ

  60. ݴ༿ͷน ҰॹͩΑɻ Rubyͩ΋Μɻ

  61. ͨͿΜ೔ຊਓͷࠃຽੑͷ໰୊ ʮԶͷcoolͳίʔυΛ ݟͯ͘Εʂʯతͳ΍ͭ ͕ۤख

  62. ʮ೔ຊਓʯ͕ډͳ͍ ஍ํ֨ࠩͱ͔ Ҏલͷ໰୊

  63. ೔ຊ͸Rubyޙਐࠃ ౦ژͱ͔ͱͪ͗ͱ͔ ؔ܎ͳ͍

  64. Social Coding࣌୅ ஍ํͰRubyΛؤுͬͯ ͍Δօ͞Μʹ͸େ͖ͳ νϟϯεɺ͔΋Ͷɻ

  65. ୈ2෦ Social Coding Practices

  66. GitΛ஌Δ Practice 0

  67. Materials ✴WEB+DB Vol. 50 ಛू2 ✴Git Immersion http://gitimmersion.com ✴Junioຊ ✴GitHub

    Bootcamp http://help.github.com/ ✴Git Internals http://peepcode.com/products/ git-internals-pdf
  68. WEB+DB Vol. 50 ಛू2

  69. FAQ Windows?

  70. Windows? ࢖Θͳ͍Ͱ͍ͩ͘͞ɻ

  71. Practice 1 ଞਓʹಡ·Εͯஏ͔ͣ ͘͠ͳ͍ίϛοτΦϒ δΣΫτΛ࡞Ε

  72. ଞਓʹಡ·Εͯஏ͔ͣ͘͠ͳ͍ ίϛοτΦϒδΣΫτΛ࡞Ε ✴ৗʹΞτϛοΫͳίϛοτΛ ৺͕͚Δ ✴ಡऀͷؾ࣋ͪΛߟ͑ͨɺ ਖ਼͍͠ίϛοτίϝϯτΛॻ͘

  73. ΄Μͱ͏ʹ͋ͬͨ μϝͳίϛοτྫ ✴“various changes” ✴“ xed a bug” ✴“ xes

    #1326” ✴TL;DR
  74. ίϛοτίϝϯτͷॻ͖͔ͨ ✴1ߦ໨: what is this commit? ✴2ߦ໨: ۭߦ ✴3ߦ໨ʙ: details,

    why, etc.
  75. ྑ͍͔΋͠Εͳ͍ίϛοτ “rails g scaffold user name age:integer ...”

  76. ྑ͍͔΋͠Εͳ͍ίϛοτ ✴“OMG” ✴“oops!”

  77. ιʔγϟϧίʔσΟϯάͷجຊ ϓϩάϥϛϯάͱ͸ ೔ʑͷίϛοτΛ๰͙ ࡞ۀ

  78. product = [commit, commit, commit, ...] ϓϩμΫτͳΜ͍ͯ͏ ΋ͷ͸೔ʑͷίϛοτ ͕ੵΈॏͳͬͨ݁Ռͷ ද૚Ͱ͔͠ͳ͍

  79. “Commit” matters ͔ͩΒGHͰ͸commit ʹ͸ίϝϯτͰ͖Δ͚ Ͳtreeʹ͸ίϝϯτͰ ͖ͳ͍

  80. ࢀߟ https://github.com/ rails/rails/commits

  81. ιʔγϟϧίʔσΟϯάͷਅ਷ ͲΕ͚ͩ੣࣮ͳɺ༗ҙ ٛͳίϛοτΦϒδΣ ΫτΛੈͷதʹૹΓग़ ͤΔ͔

  82. Practice 2 ਓͷόάΛ௚͢

  83. ࠷௿ݶͷϚφʔ ✴ਓͷϓϩμΫτΛ࢖ͬ ͯͯόάΛ౿ΜͩΒ௚͢ ✴௚ͨ͠Βupstreamʹ pull request͢Δ

  84. ຖ೔࢓ࣄͰRubyॻ͍ͯ Ε͹࠷௿Ͱ΋ि1ճ͸୭ ͔ͷόά౿ΜͰΔ͸ͣ

  85. Railsͷ৔߹ http:// contributors.rubyonrail s.org/

  86. ਖ΋ੵ΋Ε͹ جຊతʹϋοΫ͢ΔͨΊ ͷϋοΫ͸ͯ͠ͳ͍ɻ࢓ ࣄͰ౿Μͩόάʹύον ౰ͯͯΔ͚ͩɻ

  87. ͍ͭ΋ݴͬͯ·͕͢ɺ Rails͸όάͷๅݿͳͷͰ ௚͠ͳ͕Β࢖ͬͯͩ͘͞ ͍

  88. Practice 3 Sending “pull request”

  89. ΄Μͱ͏ʹ͋ͬͨ μϝͳpull request https://github.com/ amatsuda/kaminari/ pull/181

  90. https://github.com/amatsuda/ kaminari/pull/181 ૬ख͕೔ຊਓͰ΋ӳޠ Ͱॻ͍͍ͯͩ͘͞

  91. ӳޠ͕ۤखʁ

  92. ӳޠ͕ۤखʁ ษڧ͠Ζ

  93. ӳޠ͕ۤखʁ ίʔυͰઆ໌͢Δͱ͍ ͏ςΫχοΫ

  94. μϝͳྫ https://github.com/ amatsuda/everywhere/ pull/2

  95. https://github.com/amatsuda/ everywhere/pull/2 “If you like this, please merge in.”

  96. “If you like this, please merge in.” ͜ΕɺGitHubͱ͍͏ ΞϓϦͷػೳͷઆ໌ Ͱ͢ΑͶɻ

  97. ڭ܇ ʮΑΖ͓͘͠ئ͍͠· ͢ʯ͸ཁΓ·ͤΜ Αʔɻ

  98. Practice 4 ࣗ෼ͷϓϩμΫτΛ࡞ Δ

  99. http://git.io/kaminari Kaminariͷ৔߹

  100. Thank you for your +1 <3 <3 <3 1900+ watchers!!

  101. Why I made it ✴Rails 3Ͱwill_paginate͕ಈ͔ͳ ͔ͬͨ ✴ࠔͬͨ ✴ιʔεಡΜͰ΋ΧΦεա࣏͗ͯͤ Δؾ͕͠ͳ͍

    ✴͠ΐ͏͕ͳ͍͔Β৽͍͠ͷ࡞ͬͨ
  102. ެ։ͯ͠Έͨ ΈΜͳࠔͬͯͨΒ͠ ͘ɺΈΜͳ͕ඈͼ͍ͭ ͨ

  103. ఻೻ܦ࿏ ʮ࡞ͬͨΑʯͬͯtweet ͨ͠ RT @kakutani => ࠃ಺ RT @jmettraux =>

    ւ֎
  104. Thank you @jmettraux ͜ͷ৔ΛआΓ͓ͯྱΛ ݴ͍͍ͨ

  105. ࠷৽࡞ http://git.io/ active_decorator

  106. ڭ܇ ࣗ෼͕ඞཁʹ͔ΒΕͯ ࡞ͬͨ΋ͷ͸ΈΜͳ΋ ඞཁͳ͜ͱ͕͋Δɻ

  107. μϝͳ(੯͍͠)ྫ ThinReports https:// github.com/thinreports

  108. ThinReports @a_matsuda: @thinreports_org ΋͔ͯ͠͠GitHubͰ ιʔε͕ެ։͞Ε͍ͯͳ͔ͬͨΓ͠·͔͢ʁ ↓ ͸͍ɺGitHubͰ͸ͳ͘(ͳΜ͔ࣗલSVN)Ͱެ։ͯ͠· ͢ɻͰ͕͢ɺݱࡏGitHubʹϛϥʔ͠Α͏ͱըࡦதͰ͢ɻ ↓ ThinReports

    ͸ɺͦͷશͯͷιʔείʔυΛެ։͍ͯ͠ ·͢ɻιʔείʔυ͸ϝΠϯͷ Subversion ϦϙδτϦ ʹՃ͑ͯ GitHub ʹ΋ϛϥʔͱͯ͠ެ։͍ͯ͠·͢ɻ
  109. ࠓ͔ΒΦʔϓϯιʔε΍Δͷʹ ࣗલSVNཁΒͳ͘ͳ͍ʁ ๭ruby-lang͡Ό ͋Δ·͍͠

  110. μϝͳ(੯͍͠)ྫ CastOff https://github.com/ soba1104/CastOff

  111. Practice 5 ஥ؒΛݟ͚ͭΖ

  112. hocus_pocusͷ৔߹ http://git.io/hp

  113. ͋Δ೔GHʹDM͕ “colaborating with hocus_pocus” by @kurko

  114. “colaborating with hocus_pocus” ✴஍ٿͷཪଆ͔Β ✴໘ࣝ͸ͳ͍ ✴ख఻͍͍ͨʂ ✴ςετॻ͘Αʂ ✴υΩϡϝϯτॻ͘Αʂ

  115. So, I gave him a commit right Stay tuned, and

    see how we work together!
  116. ڭ܇ Πϯλʔωοτ͍͢͝

  117. Practice 6 meet the people

  118. RubyKaigi “RubyձٞͰ֎ࠃͷrubyistsͱ೔ຊͷ rubyists͸ྑ͍ਓؒؔ܎ΛੜΈग़ͤΔ ͱࢥ͏ɻͦΕͰɺདྷ೥ͷRubyձٞ͸ ͳ͍͔Β൵͍͠ɻ” https://twitter.com/#!/ takoyakikamen/status/ 142439088052649985

  119. RubyConf ೔ຊਓ΋͍ͬͺ͍Ͱ ҆৺

  120. RailsConf ✴RubyHero͕͏͡Ό͏ ͡Ό ✴RailsϓϩάϥϚʔͳΒ RubyConfΑΓָ͍͠͸ͣ

  121. Conclusion

  122. Why Ruby? ✴designed for Humans ✴ΈΜͳͰΩϝΔͱ ؾ࣋ͪྑ͍

  123. Practices Hack Ruby and spread your commits!!