Slide 1

Slide 1 text

ಈ࡞͠ͳ͍ίϝϯτ͸ ͨͩͷίϝϯτͳͷͰ ಈ࡞͢ΔίϝϯτΛ࡞ͬͨ ʲiCARE Dev Meetup #36ʳRejected CFP ڙཆձ 2022 OKURA Masafumi, 2022-11-16

Slide 2

Slide 2 text

RubyKaigi

Slide 3

Slide 3 text

ϓϩϙʔβϧ

Slide 4

Slide 4 text

མͪͨʘ(^o^)ʗ

Slide 5

Slide 5 text

༨ஊ

Slide 6

Slide 6 text

ϓϩϙʔβϧ͸ બͿଆ΋େม

Slide 7

Slide 7 text

མͪΔʹѱ͍ Ͱ͸ͳ͍

Slide 8

Slide 8 text

ؓ࿩ٳ୊

Slide 9

Slide 9 text

ࣗݾ঺հ • ໊લɿେ૔խ࢙ʢ͓͓͘Β·͞;Έʣ • ॴଐɿϑϦʔϥϯε • ՝֎׆ಈɿKaigi on RailsɺAlbaɺGrow.rbͳͲ • झຯɿᘖᘣɺOSSɺొஃɺίϛϡχςΟࢀՃͳͲ

Slide 10

Slide 10 text

͓୊ɿಈ࡞͢ΔίϝϯτΛ࡞ͬͨ࿩ 1.ͳͥ࡞Ζ͏ͱࢥͬͨͷ͔ʁ 2.ͲͷΑ͏ʹ࣮૷ͨ͠ͷ͔ʁ 3.ΞΠσΞΛࢥ͍͖ͭɺ࣮ݱ͢Δ·Ͱ

Slide 11

Slide 11 text

ಈ࡞͢Δίϝϯτ

Slide 12

Slide 12 text

Xa https://github.com/ okuramasafumi/xa

Slide 13

Slide 13 text

eXecutable annotation

Slide 14

Slide 14 text

1. ͳͥ࡞Ζ͏ͱ ࢥͬͨͷ͔

Slide 15

Slide 15 text

ͦΕɺίϝϯτ ͡Όͳͯ͘΋ Α͘ͳ͍ʁ

Slide 16

Slide 16 text

ྫɿ ʮ͜ͷΫϥεΛܧঝͨ͠ αϒΫϥε͸fooϝιουΛ ΦʔόʔϥΠυ͢Δ͜ͱʯ

Slide 17

Slide 17 text

ίϝϯτ͕ ͋ͬͯ΋ ಡ·ΕΔͱ͸ ݶΒͳ͍

Slide 18

Slide 18 text

ίϝϯτ಺ͷࢦࣔ ͸ಈ࡞͸͠ͳ͍

Slide 19

Slide 19 text

ಈ࡞͢Δίϝϯτ ͱ͸ʁ

Slide 20

Slide 20 text

DSLͱͯ͠ͷ ίϝϯτ

Slide 21

Slide 21 text

Rubyͷදݱྗ ͳΒՄೳͰ͸ʁ

Slide 22

Slide 22 text

2. ͲͷΑ͏ʹ ࣮૷ͨ͠ͷ͔

Slide 23

Slide 23 text

ΤσΟλ΁

Slide 24

Slide 24 text

3. ΞΠσΞΛ ࢥ͍͖ͭɺ ࣮ݱ͢Δ·Ͱ

Slide 25

Slide 25 text

ΞΠσΞΛ࣮ݱ͢ΔͨΊͷώϯτ I.ࠣࡉͳಈػΛେ੾ʹ͢Δ II.ݴޠΛΑ͘ཧղ͢Δ III.࡞Γଓ͚Δ

Slide 26

Slide 26 text

ⅰ. ࠣࡉͳಈػΛ େ੾ʹ͢Δ

Slide 27

Slide 27 text

ࢥ͍͖ͭ

Slide 28

Slide 28 text

՗ཱͪ

Slide 29

Slide 29 text

ࣗ෼ҰਓͰ͸ ͳ͍ͷ͔΋ʁ

Slide 30

Slide 30 text

PoC (Proof of Concept)

Slide 31

Slide 31 text

਺࣌ؒͰ ࡞ͬͯΈΔ

Slide 32

Slide 32 text

ⅱ. ݴޠΛΑ͘ ཧղ͢Δ

Slide 33

Slide 33 text

ݴޠ͸࠷΋ جຊతͳπʔϧ

Slide 34

Slide 34 text

XaʹඞཁͩͬͨRubyͷ஌ࣝ • ϒϩοΫͷத਎Λઐ༻ͷධՁΦϒδΣΫτͰinstance_eval͢Δ͜ͱ ͰɺͦͷΦϒδΣΫτͷதʹཁૉΛด͡ࠐΊΔ͜ͱ͕Ͱ͖Δ • ϝιουݺͼग़͠͸ׅހ͕লུͰ͖Δ • ฏจͬΆ͍ݟͨ໨΋࣮ݱͰ͖Δ • TracePointΛ࢖͑͹DSLͷ಺༰Λޙ͔ΒݕূͰ͖Δ

Slide 35

Slide 35 text

Ruby͍͢͝

Slide 36

Slide 36 text

ݴޠΛΑ͘ཧղ ͍ͯ͠ͳ͍ͱ ࡞Εͳ͍΋ͷ΋͋Δ

Slide 37

Slide 37 text

ⅲ. ࡞Γଓ͚Δ

Slide 38

Slide 38 text

Xa͸ࣗ෼͕࡞ͬͨ ͍͍ͩͨ7ݸ໨ ͘Β͍ͷgem

Slide 39

Slide 39 text

࡞͖ͬͯͨgemͷҰ෦ • YusoɿӡૹྉۚσʔλϕʔεɺॳΊͯ࡞͕ͬͨϝϯς͞Εͯͳ͍ • AlbaɿJSONγϦΞϥΠβɺ୅ද࡞ • rubocop-sensibleɿRuboCopͷطఆͷઃఆΛஔ͖׵͑Δ • necoɿίϚϯυύλʔϯͷ࣮૷ɺվमத • tiny_hooksɿίʔϧόοΫ࣮૷ɺActiveSupportΑΓ͔ͳΓ଎͍

Slide 40

Slide 40 text

౷Ұੑ͸ͳ͍

Slide 41

Slide 41 text

͋Ε͜Εࢼ͢

Slide 42

Slide 42 text

୅ද࡞ͷAlba͸ ଟ෼4ͭ໨ ͘Β͍ͷgem

Slide 43

Slide 43 text

࡞Γଓ͚Δ

Slide 44

Slide 44 text

·ͱΊ

Slide 45

Slide 45 text

ΞΠσΞΛܗʹ ͢ΔͨΊʹඞཁͳ ΋ͷ

Slide 46

Slide 46 text

ΞΠσΞͦͷ΋ͷ

Slide 47

Slide 47 text

ٕज़

Slide 48

Slide 48 text

ҙࢥ

Slide 49

Slide 49 text

΍ͬͯΈΑ͏ʂ

Slide 50

Slide 50 text

Happy hacking!