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

mruby 入門

mruby 入門

Tatsushi Demachi

December 02, 2017
Tweet

More Decks by Tatsushi Demachi

Other Decks in Programming

Transcript

  1. *OUSPEVDUJPOUP
    NSVCZ
    ͳ͕ͷ3VCZͷձCZ!UBUTVTIJ@E

    View full-size slide

  2. 8IP
    w Ͱ·ͪͨͭ͠ 5XJUUFS!UBUTVTIJ@E

    w Πϯϑϥ԰ʢαʔόɺωοτϫʔΫͳͲʣ
    w ࠷ۙ͸΋ͬͺΒ(P࢖͍

    View full-size slide

  3. 8IBU`TNSVCZ
    w 3VCZͷܰྔ࣮૷ʢ*40ఆٛͷ෦෼࣮૷ʣ
    w จ๏͸3VCZޓ׵
    w ओʹΞϓϦέʔγϣϯ૊ࠐΈ༻్ʹ։ൃ
    w Ϗϧυ࣌ʹඞཁͳݴޠػೳͷΈΛ૊ࠐΈ
    w ৄࡉ͸IUUQTHJUIVCDPNNSVCZNSVCZࢀর

    View full-size slide

  4. 8IFSFJTJUVTFE
    w OHY@NSVCZʢOHJOYͷ֦ுϞδϡʔϧʣ
    w OHJOYͷઃఆɺ֦ுΛ3VCZจ๏Ͱॻ͚Δ
    w )0ʢ)551αʔόʣ
    w αʔόͷ੍ޚΛ3VCZจ๏Ͱॻ͚Δ
    w NJUBNBFʢߏ੒؅ཧπʔϧ*UBNBFNSVCZ൛ʣ
    w ୯ҰόΠφϦͷίϚϯυϥΠϯπʔϧ
    w 3VCZ%4-Ͱॻ͔Εͨߏ੒ఆٛΛॲཧՄೳ

    View full-size slide

  5. )PXUPJOTUBMM

    View full-size slide

  6. 3FRVJSFNFOU
    w $$PNQJMFS
    w -JOLFS
    w "SDIJWFS
    w -JC$MJCSBSJFTBOEIFBEFST
    w #JTPO
    w 3VCZ

    View full-size slide

  7. #VJME
    w HJUDMPOFIUUQTHJUIVCDPNNSVCZ
    NSVCZHJU
    w DENSVCZ
    w NJOJSBLF

    View full-size slide

  8. #JOBSJFT
    w NJSCʢJSC૬౰ʣ
    w NSCDʢNSVCZ7.όΠτίʔυίϯύΠϥʣ
    w NSVCZʢSVCZ૬౰ʣ
    w NSVCZTUSJQʢ%FCVHηΫγϣϯ࡟আπʔϧʣ
    w NSECʢσόοΨʣ

    View full-size slide

  9. -JCSBSJFT
    w MJCNSVCZ@DPSFB

    TSDҎԼͱύʔαͷΈΛؚΉίΞϥΠϒϥϦ
    w MJCNSVCZB

    NSCMJC NSCHFN΋ؚΉNSVCZϥΠϒϥϦ

    View full-size slide

  10. %FNP
    DPNQJMF SVONJSCBOE
    NSVCZ

    View full-size slide

  11. #VJMEDPOpHVSBUJPO
    w Ϗϧυઃఆ͸CVJME@DPOpHSCϑΝΠϧͰࢦఆ
    w .36#:@$0/'*(؀ڥม਺ͰCVJME@DPOpHSC
    ͷύεΛࢦఆ

    View full-size slide

  12. #VJMEDPOpHTFDUJPO
    w 5PPMDIBJO
    w $DPNQJMFS
    w -JOLFS
    w "SDIJWFS
    w 1BSTFS(FOFSBUPS
    w NSCHFNT
    w FUDʜ

    View full-size slide

  13. NSCHFN
    w NSVCZʹ͓͚Δ֦ுػߏ
    w $ BOEPS
    3VCZͰॻ͘͜ͱ͕Ͱ͖Δ
    w NSVCZ࣮ߦܥ MJCNSVCZB
    ʹ௚઀૊ࠐ·ΕΔ
    w NSVCZίΞػೳͷҰ෦΋࣮͸NSCHFN

    View full-size slide

  14. )PXUPVTFNSCHFN
    w CVJME@DPOpHSCͰࢦఆ
    w (FN#PYͰࢦఆ
    w ར༻͍ͨ͠NSCHFNͷఆٛΛ·ͱΊ͓͚ͯΔ
    ࢓૊Έ
    w CVJME@DPOpHSCͰݺͼग़ͯ͠ར༻͢Δ

    View full-size slide

  15. NSCHFNSFGFSFODFUZQF
    w NSCHFNࢀরઌ͸Լهͷछྨ͕͋Δ
    w ϑΝΠϧύε
    w ϦϞʔτ(JUϦϙδτϦ
    w (JUIVC
    w #JUCVDLFU
    w NHFN
    w NHFNMJTU IUUQTHJUIVCDPNNSVCZNHFNMJTU
    ʹ·ͱΊ
    ΒΕ͍ͯΔNSCHFN

    View full-size slide

  16. NSCHFNTUSVDUVSF
    GEM_NAME <- Name of GEM
    !"" include <- Header for Ruby extension
    !"" mrblib <- Source for Ruby extension
    !"" src <- Source for C extension
    !"" test <- Test code (Ruby)
    !"" mrbgem.rake <- GEM specification
    #"" README.md <- Readme for GEM

    View full-size slide

  17. NSCHFNSBLF
    w NSCHFNͷఆٛϑΝΠϧ
    w MJDFOTF
    w BVUIPS
    w TVNNBSZ
    w WFSTJPO
    w ґଘؔ܎
    w FUDʜ

    View full-size slide

  18. &YBNQMF
    3VCZPOMZ

    View full-size slide

  19. $FYUFOTJPO
    w NSCHFNʹ͸ɺԼهͷೋͭͷؔ਺͕ඞཁ
    w NSC@(&./".&@HFN@JOJU NSC@TUBUF

    w ҰൠతʹϞδϡʔϧɺΫϥεɺϝιουͳͲͷఆٛ
    Λߦ͏
    w NSC@(&./".&@HFN@pOBM NSC@TUBUF

    w NSVCZ֎͔ΒׂΓ౰ͯͨϝϞϦͳͲͷ੔ཧͳͲΛ
    ߦ͏

    View full-size slide

  20. &YBNQMF
    $ 3VCZIZCSJE

    View full-size slide

  21. $PODMVTJPO
    w $ 3VCZͰ༰қʹϥϯλΠϜ͕֦ுՄೳ
    w ΞϓϦέʔγϣϯͷ಺෦ߏ଄Λద੾ʹެ։͢Ε
    ͹ɺNSVCZ͔Βࣗ༝ʹ੍ޚՄೳ
    w ϥϯλΠϜʹ௚઀૊ࠐ·ΕΔͷͰɺ୯ҰόΠφϦ
    Խ΋Մೳ

    View full-size slide

  22. 3FGFSFODFT.BUFSJBMT
    w IUUQTHJUIVCDPNNSVCZNSVCZ
    w IUUQTHJUIVCDPNNSVCZNSVCZCMPC
    NBTUFSEPDHVJEFTDPNQJMFNE
    w IUUQTHJUIVCDPNNSVCZNSVCZCMPC
    NBTUFSEPDHVJEFTNSCHFNTNE
    w IUUQTHJUIVCDPNUBUTVTIJEOBSVCZ
    NSVCZFYBNQMF

    View full-size slide