Upgrade to Pro — share decks privately, control downloads, hide ads and more …

sinatra

 sinatra

Sinatraでつくる簡単webアプリ

Kuniaki IGARASHI

July 01, 2014
Tweet

More Decks by Kuniaki IGARASHI

Other Decks in Technology

Transcript

  1. TJOBUSBHFNΛ࢖ͬͨ8FCΞϓϦ࡞Γԋश  ҎԼͷίʔυΛॻ͍ͯ޷͖ͳ໊લͰอଘ͠·͢ɻʢྫ͑͹TFSWFSSCʣ SFRVJSFTJOBUSB ! HFUEP )FMMPXPSME FOE ϒϥ΢β͔ΒҎԼͷ63-΁ΞΫηε͠·͢ɻ HFNJOTUBMMTJOBUSB

    HFNΛΠϯετʔϧ͠·͢ɻ ࣮ߦ͠·͢ɻӈԼͷΑ͏ͳද͕ࣔग़·͢ɻ SVCZTFSWFSSC 4JOBUSBIBTUBLFOUIFTUBHFPOGPS EFWFMPQNFOUXJUICBDLVQGSPN5IJO 5IJOXFCTFSWFS WDPEFOBNF4USBJHIU3B[PS  .BYJNVNDPOOFDUJPOTTFUUP -JTUFOJOHPOMPDBMIPTU $53- $UPTUPQ IUUQMPDBMIPTU )FMMPXPSMEͱදࣔ͞ΕΕ͹੒ޭͰ͢ɻ ˞ίʔυΛมߋͨ͠৔߹͸Ͱ࣮ߦ͍ͯ͠ΔTIFMMΛ$USM DͰఀࢭͤ͞ɺ࠶࣮ߦ͠·͢ɻ  8JO؀ڥͰऴྃ͠ͳ͍৔߹ɺ$USM 1"64&Λࢼ͍ͯͩ͘͠͞ɻʣ 
  2. 8FC4FSWFS 8FC"QQ #SPXTFS ϦΫΤετ Ϩεϙϯε 63-IUUQMPDBMIPTU 63-MPDBMIPTU͸ࣗ෼ͷϚγϯ SFRVJSFTJOBUSB ! HFUEP

    )FMMPXPSME FOE 8FC"QQ ΞϓϦ ͷ෦෼͕Έͳ͞Μ͕ॻ͍ͨίʔυͰ͢ɻ 8FC4FSWFS͸TJOBUSBͱ3VCZ͕͏·͍͜ͱ΍ͬͯ͘Ε·͢ɻ ࣗ෼ͷ1$ MPDBMIPTU͸ࣗ෼ͷ1$Λද͢ಛผͳΞυϨεͰ͢ɻ Ͱ͸ɺ63-ͷΑΓޙΖͷͱ͸ԿͰ͠ΐ͏͔ʁ 
  3. MPDBMIPTU ಛผͳΞυϨεͰ͢ɻࣗ෼ͷϚγϯΛࢦ͠·͢ɻ IUUQMPDBMIPTU 63-ͷઆ໌  ϙʔτ൪߸Ͱ͢ɻ൪ϙʔτΛࢦ͠·͢ɻ ීஈ͸ࢦఆ͠ͳ͍͜ͱ͕ଟ͍Ͱ͢ɻࢦఆ͠ͳ͍ͱ൪ϙʔτʹͳΓ·͢ɻ ͭ·ΓɺҰൠతͳ8FCΞϓϦ͸൪ϙʔτͰՔಇ͍ͯ͠·͢ɻ ΞυϨε ϙʔτ

    63-ͷΑΓޙΖ͸ϙʔτΛද͠·͢ɻ ϙʔτ͸ɺಉ͡ΞυϨε಺Ͱ௨৴ઌΛಛఆ͢Δ൪߸Ͱ͢ɻ ྫ͑͹ɺΞυϨε͕Ӻͷ໊લɺϙʔτ͕ӺͷϗʔϜ˓൪ઢɺ ͱΠϝʔδ͢Δͱ෼͔Γ΍͍͔͢΋͠Ε·ͤΜɻ 
  4. 8FC4FSWFS 8FC"QQ #SPXTFS ϦΫΤετ Ϩεϙϯε 63-IUUQMPDBMIPTU ઌ΄Ͳ࡞ͬͨ8FCΞϓϦͷಈ࡞ུ֓ SFRVJSFTJOBUSB ! HFUEP

    )FMMPXPSME FOE ࣍͸8FCΞϓϦͷಈ͖Λৄ͘͠ݟ͍͖ͯ·͢ MPDBMIPTU൪ϙʔτʹདྷͨ ϦΫΤετΛ8FC"QQ΁ಧ͚·͢ 
  5. 8FC4FSWFS 8FC"QQ #SPXTFS ϦΫΤετ Ϩεϙϯε 63-IUUQMPDBMIPTU 8FCΞϓϦͷಈ࡞ SFRVJSFTJOBUSB ! HFUEP

    )FMMPXPSME FOE MPDBMIPTU൪ϙʔτʹདྷͨ ϦΫΤετΛ8FC"QQ΁ಧ͚·͢ 63-ͷΞυϨεͱϙʔτΑΓ ޙΖͷ෦෼Λύεͱݴ͍·͢ɻ ͜ͷ৔߹ɺύε͸ʹͳΓ·͢ɻ ύε͕ͷϦΫΤετʹରͯ͠ )FMMPXPSMEͱ͍͏Ϩεϙϯε Λฦ͢8FCΞϓϦͱͯ͠ಈ࡞͠·͢ ड͚औͬͨϨεϙϯεΛදࣔ 
  6. TJOBUSBHFNΛ࢖ͬͨ8FCΞϓϦ࡞Γԋश KQ ҎԼͷίʔυΛॻ͍ͯ޷͖ͳ໊લͰอଘ͠·͢ɻ KQSCͱ͠·͢ DPEJOHVUG SFRVJSFTJOBUSB ! HFUKQEP ͜Μʹͪ͸ʂ FOE

    ϒϥ΢β͔ΒҎԼͷ63-΁ΞΫηε͠·͢ɻ ࣮ߦ͠·͢ɻ SVCZKQSC 4JOBUSBIBTUBLFOUIFTUBHFPOGPS EFWFMPQNFOUXJUICBDLVQGSPN5IJO 5IJOXFCTFSWFS WDPEFOBNF4USBJHIU3B[PS  .BYJNVNDPOOFDUJPOTTFUUP -JTUFOJOHPOMPDBMIPTU $53- $UPTUPQ IUUQMPDBMIPTUKQ ͜Μʹͪ͸ʂͱදࣔ͞ΕΕ͹੒ޭͰ͢ɻ લͷखॱͰ࣮ߦͨ͠8FCαʔόʔ͕ىಈ͍ͯ͠Δ৔߹͸$USM DͰఀࢭͤ͞·͢ɻ  8JO؀ڥͰऴྃ͠ͳ͍৔߹ɺ$USM 1"64&Λࢼ͍ͯͩ͘͠͞ɻʣ ˞ίʔυΛॻ͖׵͑ͨ৔߹΋Ұ౓ఀࢭˠ࣮ߦ͢Δඞཁ͕͋Γ·͢ɻ ʢϑΝΠϧ໊͸ɺͲΜͳ໊લͰ΋ߏ͍·ͤΜɻ ผͷ໊લͰอଘͯ͠΋େৎ෉Ͱ͢ɻʣ 
  7. TJOBUSBHFNΛ࢖ͬͨ8FCΞϓϦ࡞Γԋश KQ ղઆ HFUͷޙΖʹॻ͘จࣈྻͷϦΫΤετ63-ύεʹԠ౴͠·͢ɻ DPEJOHVUG SFRVJSFTJOBUSB ! HFUKQEP ͜Μʹͪ͸ʂ FOE

    ͜ͷίʔυͷ৔߹͸ 63-IUUQMPDBMIPTUKQ ύεͷ෦෼͕KQ  ʹΞΫηε͞Εͨ৔߹ʹ ͜Μʹͪ͸ʂ ΛϨεϙϯεͱͯ͠ฦ͠·͢ɻ  ˞ͪͳΈʹɺ͜Μʹͪ͸ʂͷ෦෼ΛI͜Μʹͪ͸ʂIͱॻ͘ͱ େ͖ͳจࣈͰදࣔͤ͞Δ͜ͱ͕Ͱ͖·͢ɻ͜Ε͸ɺ)5.-ͱ͍͏ݴޠͷจ๏Ͱɺ ϒϥ΢β͸)5.-Ͱॻ͔ΕͨιʔείʔυΛղऍͯ͠දࣔ͠·͢ɻ
  8. TJOBUSBHFNΛ࢖ͬͨ8FCΞϓϦ࡞Γԋश UJNF ҎԼͷίʔυΛॻ͍ͯ޷͖ͳ໊લͰอଘ͠·͢ɻ UJNFSCͱ͠·͢ɻ SFRVJSFTJOBUSB ! HFUUJNFEP 5JNFOPXUP@T FOE ϒϥ΢β͔ΒҎԼͷ63-΁ΞΫηε͠·͢ɻ

    ࣮ߦ͠·͢ɻ SVCZUJNFSC 4JOBUSBIBTUBLFOUIFTUBHFPOGPS EFWFMPQNFOUXJUICBDLVQGSPN5IJO 5IJOXFCTFSWFS WDPEFOBNF4USBJHIU3B[PS  .BYJNVNDPOOFDUJPOTTFUUP -JTUFOJOHPOMPDBMIPTU $53- $UPTUPQ IUUQMPDBMIPTUUJNF ͷΑ͏ʹݱࡏ࣌ࠁ͕දࣔ͞ΕΕ͹੒ޭͰ͢ɻ લͷखॱͰ࣮ߦͨ͠8FCαʔόʔ͕ىಈ͍ͯ͠Δ৔߹͸$USM DͰఀࢭͤ͞·͢ɻ  8JO؀ڥͰऴྃ͠ͳ͍৔߹ɺ$USM 1"64&Λࢼ͍ͯͩ͘͠͞ɻʣ ˞ίʔυΛॻ͖׵͑ͨ৔߹΋Ұ౓ఀࢭˠ࣮ߦ͢Δඞཁ͕͋Γ·͢ɻ   ݱࡏ࣌ࠁΛදࣔͤ͞Δ8FCΞϓϦΛ࡞ͬͯΈ·͠ΐ͏ɻ 
  9. TJOBUSBHFNΛ࢖ͬͨ8FCΞϓϦ࡞Γԋश UJNF ղઆ ͜ͷ՝୊͔Βɺ5JNFOPXͷΑ͏ͳ3VCZίʔυΛ࣮ߦͨ݁͠ՌΛ ϒϥ΢βͰදࣔ͢Δํ๏Λֶ΂·͢ɻ SFRVJSFTJOBUSB ! HFUUJNFEP 5JNFOPXUP@T FOE

    5JNFOPX͸ݱࡏ࣌ࠁΛ5JNFDMBTTΦϒ δΣΫτͰฦ͠·͢ɻ UP@TϝιουΛ࢖͏ͱɺ4USJOHDMBTTΦ ϒδΣΫτ΁ม׵͞Ε·͢ɻ 4USJOHΦϒδΣΫτͰ͋Ε͹ϒϥ΢β΁දࣔͰ͖ΔͷͰɺ UP@TϝιουͳͲͰม׵͢Δ͜ͱͰॲཧ݁ՌΛදࣔ͢Δ͜ͱ͕Ͱ͖·͢ɻ ·ͨɺ5JNFOPX͸ϦΫΤετ͝ͱʹ࣮ߦ͞ΕΔͷͰɺ Ϧϩʔυ͢Δ͝ͱʹͦͷ࣌఺ͷݱࡏ࣌ࠁ͕දࣔ͞Ε·͢ɻ 
  10. TJOBUSBHFNΛ࢖ͬͨ8FCΞϓϦ࡞Γԋश ύε ҎԼͷίʔυΛॻ͍ͯ޷͖ͳ໊લͰอଘ͠·͢ɻ QBUISCͱ͠·͢ɻ SFRVJSFTJOBUSB ! HFUXPSEEP QBSBNT<XPSE> FOE ϒϥ΢β͔ΒҎԼͷ63-΁ΞΫηε͠·͢ɻ

    ࣮ߦ͠·͢ɻ SVCZQBUISC 4JOBUSBIBTUBLFOUIFTUBHFPOGPS EFWFMPQNFOUXJUICBDLVQGSPN5IJO 5IJOXFCTFSWFS WDPEFOBNF4USBJHIU3B[PS  .BYJNVNDPOOFDUJPOTTFUUP -JTUFOJOHPOMPDBMIPTU $53- $UPTUPQ IUUQMPDBMIPTUIJ લͷखॱͰ࣮ߦͨ͠8FCαʔόʔ͕ىಈ͍ͯ͠Δ৔߹͸$USM DͰఀࢭͤ͞·͢ɻ  8JO؀ڥͰऴྃ͠ͳ͍৔߹ɺ$USM 1"64&Λࢼ͍ͯͩ͘͠͞ɻʣ ˞ίʔυΛॻ͖׵͑ͨ৔߹΋Ұ౓ఀࢭˠ࣮ߦ͢Δඞཁ͕͋Γ·͢ɻ IJͱ͍͏ύεʹΞΫηε͞ΕΕ͹IJ͕ɺ CPPLͱ͍͏ύεͳΒCPPL͕දࣔ͞Ε·͢ɻ ΞΫηεͨ͠ύεΛදࣔͤ͞Δ8FCΞϓϦΛ࡞ͬͯΈ·͠ΐ͏ɻ 
  11. TJOBUSBHFNΛ࢖ͬͨ8FCΞϓϦ࡞Γԋश ύε ղઆ HFUޙͷจࣈྻͷதʹXPSEͷΑ͏ʹγϯϘϧΛॻ͘ͱɺ ϦΫΤετ͞ΕͨύεΛQBSBNT<XPSE>Ͱड͚औΕ·͢ɻ SFRVJSFTJOBUSB ! HFUXPSEEP QBSBNT<XPSE> FOE

    IUUQMPDBMIPTUIJ ͜ΕΛԠ༻͢Δͱɺྫ͑͹݂ӷܕ઎͍ͳͲɺ ΞΫηε͞Εͨ63-ʹԠͯ͡දࣔΛม͑ΔΞϓϦΛ࡞Ε·͢ɻ ͕࣌ؒ͋Δਓ͸νϟϨϯδͯ͠Έ͍ͯͩ͘͞ɻ ্هͷ63-ͰΞΫηεͨ͠৔߹ɺ QBSBNT<XPSE>͸IJΛฦ͠·͢ɻ ˞͜͜ͰͷXPSE͸೚ҙͷ໊લʹͰ͖·͢ɻ HFUGPPEPʙͱॻ͍ͨ৔߹͸ QBSBNT<GPP>ͰύεΛऔΕ·͢ɻ