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

rails new コマンド

D504d1f14dd00f8028c440e9d1923d37?s=47 Yasuhiroki
January 25, 2022

rails new コマンド

銀座Rails#41 LT

D504d1f14dd00f8028c440e9d1923d37?s=128

Yasuhiroki

January 25, 2022
Tweet

More Decks by Yasuhiroki

Other Decks in Technology

Transcript

  1. SBJMTOFXίϚϯυ !ZBTVIJSPLJ ۜ࠲3BJMT

  2. !ZBTVIJSPLJ w झຯࢠͲ΋ͷ$IBOHF-PHΛॻ͘

  3. !ZBTVIJSPLJ w ࢓ࣄΈΜνϟϨ 3BJMT"84"OESPJE

  4. !ZBTVIJSPLJ w ࢓ࣄΈΜνϟϨ 3BJMT"84"OESPJE

  5. IBQQZOFXZFBS

  6. OPUGPVOE 

  7. IBQQZ͸࡞ΕΔ

  8. IBQQZ͸࡞ΕΔ BMJBTIBQQZSBJMT

  9. None
  10. IBQQZOFXZFBS w ৽೥ϓϩδΣΫτΛ࡞Δ

  11. VOBMJBTIBQQZ

  12. SBJMTOFX͸ Ͳ͏΍࣮ͬͯ૷͞Ε͍ͯΔʁ

  13. SBJMTOFXZFBS ࣮ߦͨ͠ͱ͖ͷίʔυΛಡΉ

  14.  fi OESBJMTDPNNBOE w SBJMUJFTʹ͋Δ

  15. WJNSBJMUJFTFYFSBJMT rails ։ൃऀ޲͚

  16. WJNSBJMUJFTMJCSBJMTDMJSC

  17. WJNSBJMUJFTMJCSBJMTDMJSC # TODO: ͋ͱͰಡΉ

  18. WJNSBJMUJFTMJCSBJMTDMJSC rails plugin ίϚϯυҎ֎͸͢΂ͯ rails application ѻ͍ # TODO: ͋ͱͰಡΉ

  19. دΓಓ  SBJMTOFXZFBSҎ֎Ͱ΋ ಈ͘ͷͰ͸ʁ

  20. دΓಓ  ಈ͔ͳ͍

  21. WJNSBJMUJFTMJCSBJMTDMJSC w 3BJMT$PNNBOEJOWPLFBQQMJDBUJPO  <OFX ZFBS>͕࣮ߦ͞ΕΔ

  22. 3BJMT$PNNBOEJOWPLF

  23. 3BJMT$PNNBOEJOWPLF ໋໊نଇʹैͬͯ Rails::Command Λ ܧঝͨ͠ΫϥεΛ୳͢ → Rails::Command::ApplicationCommand namespace = "application"

  24. 3BJMT$PNNBOE"QQMJDBUJPO$PNNBOE w 3BJMT$PNNBOE"QQMJDBUJPO$PNNBOEQFSGPS N BQQMJDBUJPO <OFX ZFBS> \^ ͕࣮ߦ͞ΕΔ

  25. 3BJMT$PNNBOEJOWPLF w SBJMTOFX͸HFOFSBUPSͷҰछ w IUUQTSBJMTHVJEFTKQHFOFSBUPSTIUNM

  26. دΓಓ  ॻ͍ͯΔ IUUQTSBJMTHVJEFTKQHFOFSBUPSTIUNM

  27. 3BJMT$PNNBOEJOWPLF w SBJMTOFX͸HFOFSBUPSͷҰछ w IUUQTSBJMTHVJEFTKQHFOFSBUPSTIUNM

  28. 3BJMT(FOFSBUPST"3(74DSVCCFS w "3(7Λ4DSVCͯ͠Δ w ൚༻ͦ͏ͳ໊લʹݟ͔͚ͤͯ 
 ࣮͸3BJMT(FOFSBUPST"QQ(FOFSBUPS༻ w ࣮૷͸লུ

  29. دΓಓ  OFXҎ֎͸IFMQʹ͢Δ 

  30. دΓಓ  ͔ͩΒSBJMTOFXͷΈಈ͘  "yasuhiroki" == "new" => false rails

    --help year Λ࣮ߦͨ͜͠ͱʹͳΔ
  31. 3BJMT(FOFSBUPST"QQ(FOFSBUPS

  32. 3BJMT(FOFSBUPST"QQ(FOFSBUPS w 5IPSHFNΛར༻ w Φϓγϣϯ BQJͱ͔ Λղੳ w ςϯϓϨʔτ͔ΒϑΝΠϧΛಈతʹੜ੒ w

    SBJMTOFXͰԿ͕ͲͷΑ͏ʹੜ੒͞ΕΔͷ͔͸ 
 ͢΂ͯ͜͜ʹ࣮૷͞Ε͍ͯΔ
  33. SBJMTOFXίϚϯυ͸ 
 Ҏ্ͷΑ͏ʹ࣮૷͞Ε͍ͯͨ

  34. دΓಓ  Կ͔๨Ε͍ͯΔؾ͕͢Δ 

  35. دΓಓ  HSFQ50%0 

  36. دΓಓ  HSFQ50%0 

  37. SBJMTOFXίϚϯυ͕ ಈ࡞͠ͳ͍ঢ়گ͕͋Δ

  38. SBJMTOFX͕ಈ͔ͳ͍ w SBJMTϓϩδΣΫτ্ͩͱ 
 SBJMTOFX͸ಈ͔ͳ͍

  39. WJNSBJMUJFTMJCSBJMTDMJSC ͍·ಡΉ

  40. 3BJMT"QQ-PBEFSFYFD@BQQ

  41. 3BJMT"QQ-PBEFSFYFD@BQQ bin/rails ͔ script/rails Λ୳͢ root (/) ʹͳΔ·ͰḪͬͯ୳͢

  42. 3BJMT"QQ-PBEFSFYFD@BQQ bin/rails ΍ script/rails ͕ ͳ͔ͬͨΒԿ΋͠ͳ͍

  43. 3BJMT"QQ-PBEFSFYFD@BQQ exec ruby bin/rails, *["new", "year"] Λ࣮ߦ͢Δ ※ ͜ͷล͸ݹ͍ Rails

    (ͨͿΜ3ܥ) ޲͚ͷॲཧ bin/rails ͕͋ͬͨΒɺ
  44. ,FSOFMFYFD w Ҿ਺ʹࢦఆͨ͠ίϚϯυ͕੒ޭͨ͠Βɺ 
 ͦ͜Ͱ3VCZͷॲཧ͸ऴྃ͢Δ w IUUQTEPDTSVCZMBOHPSHKBMBUFTU NFUIPE,FSOFMNFYFDIUNM w

  45. دΓಓ  φϕΞπͰಈ࡞֬ೝ 

  46. WJNSBJMUJFTMJCSBJMTDMJSC bin/rails ͕͋Δ৔߹͸ɺ Ҏ߱ͷॲཧ͸࣮ߦ͞Εͳ͍

  47. SVCZCJOSBJMTOFXZFBS w CJOSBJMT͸ߦ 3BJMTͷ৔߹

  48. SBJMTDPNBNOETSC Rails::Command.invoke "new", ["year"] Λ࣮ߦ͢Δ

  49. 3BJMT$PNNBOEJOWPLF"HBJO

  50. 3BJMT$PNNBOEJOWPLF"HBJO Rails::Command::NewCommand ͷ perform ͕ݺ͹ΕΔ namespace = "new"

  51. 3BJMT$PNNBOE/FX$PNNBOE w 3BJMTϓϩδΣΫτ্Ͱ͸࣮ߦͰ͖ͳ͍Α 
 ϝοηʔδΛදࣔͯ͠FYJU͢Δ

  52. SBJMTOFXίϚϯυ͸ 
 Ҏ্ͷΑ͏ʹ࣮૷͞Ε͍ͯͨ

  53. 5IBOLT