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

AdminScriptで管理画面をスッキリさせる

alpaca-tc
February 02, 2017

 AdminScriptで管理画面をスッキリさせる

2017/02/02 スタートアップRails第四回 発表資料です。
スクリプトの管理ページをマウントするgemを使って、日々のエンジニアの雑務を自動化するお話です。

https://github.com/alpaca-tc/admin_script

alpaca-tc

February 02, 2017
Tweet

More Decks by alpaca-tc

Other Decks in Programming

Transcript

  1. AdminScriptͰ
    ۀ຿ΛεοΩϦͤ͞Δ

    View full-size slide

  2. @alpaca-tc
    @alpaca_tc
    ❤ Vim, Ruby,
    ͍ͬ͘Μ

    View full-size slide

  3. ΋ͷͮ͘Γ͕΋ͬͱָ͘͠ͳΔΞΠςϜ࡞੒αʔϏε
    pixivFACTORY
    ΈΜͳͷອըΞϓϦ
    pixivίϛοΫ
    ૑࡞׆ಈΛ΋ͬͱָ͘͠

    View full-size slide

  4. ͓࢓ࣄ
    ͋Δ͋Δ

    View full-size slide

  5. ͱ͋Δαϙʔτ૭ͷձ࿩

    View full-size slide

  6. ࡶ຿
    ࡶ຿
    ࡶ຿
    ࡶ຿
    ࡶ຿
    ࡶ຿
    ࡶ຿ ࡶ຿
    ࡶ຿
    ࡶ຿ ࡶ຿
    ࡶ຿ ࡶ຿
    ࡶ຿
    ΤϯδχΞʹ
    ౤͛ΒΕΔࡶ຿

    View full-size slide

  7. ࡶ຿
    ࡶ຿
    ࡶ຿
    ࡶ຿
    ࡶ຿
    ࡶ຿
    ࡶ຿ ࡶ຿
    ࡶ຿
    ࡶ຿ ࡶ຿
    ࡶ຿ ࡶ຿
    ࡶ຿
    શ෦ࣗಈԽ͍ͨ͠

    View full-size slide

  8. ʻ ؅ཧը໘ʹ௥Ճ͢Δ͔

    View full-size slide

  9. ؅ཧը໘ʹ௥Ճ͢Δ͔
    ɾroutes.rbʹϧʔςΟϯά௥Ճͯ͠
    ɾControllerΛ࡞ͬͯ…
    ɾFormObjectΛ࡞ͬͯ…
    ɾViewΛ࡞ͬͯ…

    View full-size slide

  10. ؅ཧը໘ʹ௥Ճ͢Δ͔
    ɾroutes.rbʹϧʔςΟϯά௥Ճͯ͠
    ɾControllerΛ࡞ͬͯ…
    ɾFormObjectΛ࡞ͬͯ…
    ɾViewΛ࡞ͬͯ…
    ΊΜͲ͍͘͞!!!!

    View full-size slide

  11. ΋ͬͱ؆୯ʹ
    ࣗಈԽ͍ͨ͠

    View full-size slide

  12. Admin
    Script alpaca-tc/admin_script

    View full-size slide

  13. ؅ཧը໘ʹ௥Ճ͢Δ͔
    ɾroutes.rbʹϧʔςΟϯά௥Ճͯ͠
    ɾControllerΛ࡞ͬͯ…
    ɾFormObjectΛ࡞ͬͯ…
    ɾViewΛ࡞ͬͯ…

    View full-size slide

  14. ؅ཧը໘ʹ௥Ճ͢Δ͔
    ɾroutes.rbʹϧʔςΟϯά௥Ճͯ͠
    ɾControllerΛ࡞ͬͯ…
    ɾFormObjectΛ࡞ͬͯ…
    ɾViewΛ࡞ͬͯ…

    View full-size slide

  15. ؅ཧը໘ʹ௥Ճ͢Δ͔
    ɾroutes.rbʹϧʔςΟϯά௥Ճͯ͠
    ɾControllerΛ࡞ͬͯ…
    ɾFormObjectΛ࡞ͬͯ…
    ɾViewΛ࡞ͬͯ…
    ͜Ε͚ͩͰ͓ΘΓʂ

    View full-size slide

  16. Ҿ਺ͱॲཧΛॻ͘
    app/models/admin_script/awesome_script.rb

    View full-size slide

  17. Ҿ਺ͱॲཧΛॻ͘
    ΞΫηε͢Δ͚ͩ
    app/models/admin_script/awesome_script.rb
    GET /admin_scripts/awesome_script/edit

    View full-size slide

  18. Admin
    Script alpaca-tc/admin_script
    ɾ΄΅ActiveModel
    ܕ͸͍͍ײ͡ʹͯ͘͠ΕΔ
    Ҿ਺Λ౉ͤ͹
    Ϙλϯ͔Β΋࣮ߦͰ͖Δ
    ɾεΫϦϓτͷ؅ཧը໘ΛϚ΢ϯτ

    View full-size slide

  19. Admin
    Script alpaca-tc/admin_script
    ݟͤΒΕͳ͍Αʂ
    ͨ͘͞ΜͷAdminScript

    View full-size slide

  20. Admin
    Script alpaca-tc/admin_script
    ݟͤΒΕͳ͍Αʂ
    ͨ͘͞ΜͷAdminScript
    ָνϯʂʂʂ

    View full-size slide

  21. ࠓͷαϙʔτ૭ͷձ࿩

    View full-size slide

  22. ࠓͷαϙʔτ૭ͷձ࿩

    View full-size slide

  23. ࠓͷαϙʔτ૭ͷձ࿩

    View full-size slide

  24. AdminScript͸
    ͍͍κ
    alpaca-tc/admin_script

    View full-size slide