Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
rails new コマンド
Search
Yasuhiroki
January 25, 2022
Technology
1
680
rails new コマンド
銀座Rails#41 LT
Yasuhiroki
January 25, 2022
Tweet
Share
More Decks by Yasuhiroki
See All by Yasuhiroki
自分に勉強させるには
yasuhiroki
1
380
Android Studio `Command+Shift+A`
yasuhiroki
0
300
シェルスクリプトをサーバーレスで cron したい
yasuhiroki
1
740
自動化を習慣化する
yasuhiroki
2
14k
GitHub Actions Parallel Testing
yasuhiroki
1
1.1k
circleci.vim
yasuhiroki
0
1.5k
ベンチャー企業がCircleCIを選んだ理由と活用方法
yasuhiroki
1
750
Rubyの正規表現を調べてみた
yasuhiroki
0
760
開発者(個人)のためのJenkins 運用編
yasuhiroki
0
2.1k
Other Decks in Technology
See All in Technology
Renovate ではじめる運用レスなライブラリ更新 / 令和最新版 他人に自慢したいヤバいCI/CD LT会 @ yabaibuki.dev #2
ponkio_o
PRO
1
130
Consoles, printk, Nested-NMIs_ Oh my!
ennael
PRO
0
150
Assisted reorganization of data structures
ennael
PRO
0
200
位置情報とオープンソースがやりたくてMIERUNEに転職した話 〜経歴、事例紹介、GISへのいざない〜 / MIERUNE JCT - Tokyo 2024
mierune
PRO
0
390
GitHub Actions/Docker/Terraform/Renovate で最小限の Monorepo CD パイプラインを作る / Minimalistic Monorepo CD Pipeline with GitHub Actions, Docker, Terraform and Renovate
yuyatakeyama
4
340
C# 13 / .NET 9 の新機能 (RC 1 時点)
nenonaninu
1
1.1k
エンジニアは伝え方が9割/90% of what engineers need is communication skills
ykanoh
2
140
ドメインと向き合う - 旅行予約編
hidenorigoto
4
510
映像・音声伝送システム
jtes
0
190
オープニング / MIERUNE JCT - Tokyo 2024
mierune
PRO
1
340
Tracking down sources of kernel errors with retsnoop
ennael
PRO
0
130
Oracle GoldenGate 23ai 導入Tips
oracle4engineer
PRO
1
200
Featured
See All Featured
KATA
mclloyd
27
13k
Docker and Python
trallard
40
3k
Building a Modern Day E-commerce SEO Strategy
aleyda
37
6.8k
How to Ace a Technical Interview
jacobian
274
23k
The Brand Is Dead. Long Live the Brand.
mthomps
53
38k
Music & Morning Musume
bryan
46
6.1k
Designing Experiences People Love
moore
138
23k
Statistics for Hackers
jakevdp
796
220k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Building Flexible Design Systems
yeseniaperezcruz
326
38k
Facilitating Awesome Meetings
lara
49
6k
Writing Fast Ruby
sferik
624
60k
Transcript
SBJMTOFXίϚϯυ !ZBTVIJSPLJ ۜ࠲3BJMT
!ZBTVIJSPLJ w झຯࢠͲͷ$IBOHF-PHΛॻ͘
!ZBTVIJSPLJ w ࣄΈΜνϟϨ 3BJMT"84"OESPJE
!ZBTVIJSPLJ w ࣄΈΜνϟϨ 3BJMT"84"OESPJE
IBQQZOFXZFBS
OPUGPVOE
IBQQZ࡞ΕΔ
IBQQZ࡞ΕΔ BMJBTIBQQZSBJMT
None
IBQQZOFXZFBS w ৽ϓϩδΣΫτΛ࡞Δ
VOBMJBTIBQQZ
SBJMTOFX Ͳ͏࣮ͬͯ͞Ε͍ͯΔʁ
SBJMTOFXZFBS ࣮ߦͨ͠ͱ͖ͷίʔυΛಡΉ
fi OESBJMTDPNNBOE w SBJMUJFTʹ͋Δ
WJNSBJMUJFTFYFSBJMT rails ։ൃऀ͚
WJNSBJMUJFTMJCSBJMTDMJSC
WJNSBJMUJFTMJCSBJMTDMJSC # TODO: ͋ͱͰಡΉ
WJNSBJMUJFTMJCSBJMTDMJSC rails plugin ίϚϯυҎ֎ͯ͢ rails application ѻ͍ # TODO: ͋ͱͰಡΉ
دΓಓ SBJMTOFXZFBSҎ֎Ͱ ಈ͘ͷͰʁ
دΓಓ ಈ͔ͳ͍
WJNSBJMUJFTMJCSBJMTDMJSC w 3BJMT$PNNBOEJOWPLFBQQMJDBUJPO <OFX ZFBS>͕࣮ߦ͞ΕΔ
3BJMT$PNNBOEJOWPLF
3BJMT$PNNBOEJOWPLF ໋໊نଇʹैͬͯ Rails::Command Λ ܧঝͨ͠ΫϥεΛ୳͢ → Rails::Command::ApplicationCommand namespace = "application"
3BJMT$PNNBOE"QQMJDBUJPO$PNNBOE w 3BJMT$PNNBOE"QQMJDBUJPO$PNNBOEQFSGPS N BQQMJDBUJPO <OFX ZFBS> \^ ͕࣮ߦ͞ΕΔ
3BJMT$PNNBOEJOWPLF w SBJMTOFXHFOFSBUPSͷҰछ w IUUQTSBJMTHVJEFTKQHFOFSBUPSTIUNM
دΓಓ ॻ͍ͯΔ IUUQTSBJMTHVJEFTKQHFOFSBUPSTIUNM
3BJMT$PNNBOEJOWPLF w SBJMTOFXHFOFSBUPSͷҰछ w IUUQTSBJMTHVJEFTKQHFOFSBUPSTIUNM
3BJMT(FOFSBUPST"3(74DSVCCFS w "3(7Λ4DSVCͯ͠Δ w ൚༻ͦ͏ͳ໊લʹݟ͔͚ͤͯ ࣮3BJMT(FOFSBUPST"QQ(FOFSBUPS༻ w ࣮লུ
دΓಓ OFXҎ֎IFMQʹ͢Δ
دΓಓ ͔ͩΒSBJMTOFXͷΈಈ͘ "yasuhiroki" == "new" => false rails
--help year Λ࣮ߦͨ͜͠ͱʹͳΔ
3BJMT(FOFSBUPST"QQ(FOFSBUPS
3BJMT(FOFSBUPST"QQ(FOFSBUPS w 5IPSHFNΛར༻ w Φϓγϣϯ BQJͱ͔ Λղੳ w ςϯϓϨʔτ͔ΒϑΝΠϧΛಈతʹੜ w
SBJMTOFXͰԿ͕ͲͷΑ͏ʹੜ͞ΕΔͷ͔ ͯ͢͜͜ʹ࣮͞Ε͍ͯΔ
SBJMTOFXίϚϯυ Ҏ্ͷΑ͏ʹ࣮͞Ε͍ͯͨ
دΓಓ Կ͔Ε͍ͯΔؾ͕͢Δ
دΓಓ HSFQ50%0
دΓಓ HSFQ50%0
SBJMTOFXίϚϯυ͕ ಈ࡞͠ͳ͍ঢ়گ͕͋Δ
SBJMTOFX͕ಈ͔ͳ͍ w SBJMTϓϩδΣΫτ্ͩͱ SBJMTOFXಈ͔ͳ͍
WJNSBJMUJFTMJCSBJMTDMJSC ͍·ಡΉ
3BJMT"QQ-PBEFSFYFD@BQQ
3BJMT"QQ-PBEFSFYFD@BQQ bin/rails ͔ script/rails Λ୳͢ root (/) ʹͳΔ·ͰḪͬͯ୳͢
3BJMT"QQ-PBEFSFYFD@BQQ bin/rails script/rails ͕ ͳ͔ͬͨΒԿ͠ͳ͍
3BJMT"QQ-PBEFSFYFD@BQQ exec ruby bin/rails, *["new", "year"] Λ࣮ߦ͢Δ ※ ͜ͷลݹ͍ Rails
(ͨͿΜ3ܥ) ͚ͷॲཧ bin/rails ͕͋ͬͨΒɺ
,FSOFMFYFD w Ҿʹࢦఆͨ͠ίϚϯυ͕ޭͨ͠Βɺ ͦ͜Ͱ3VCZͷॲཧऴྃ͢Δ w IUUQTEPDTSVCZMBOHPSHKBMBUFTU NFUIPE,FSOFMNFYFDIUNM w
دΓಓ φϕΞπͰಈ࡞֬ೝ
WJNSBJMUJFTMJCSBJMTDMJSC bin/rails ͕͋Δ߹ɺ Ҏ߱ͷॲཧ࣮ߦ͞Εͳ͍
SVCZCJOSBJMTOFXZFBS w CJOSBJMTߦ 3BJMTͷ߹
SBJMTDPNBNOETSC Rails::Command.invoke "new", ["year"] Λ࣮ߦ͢Δ
3BJMT$PNNBOEJOWPLF"HBJO
3BJMT$PNNBOEJOWPLF"HBJO Rails::Command::NewCommand ͷ perform ͕ݺΕΔ namespace = "new"
3BJMT$PNNBOE/FX$PNNBOE w 3BJMTϓϩδΣΫτ্Ͱ࣮ߦͰ͖ͳ͍Α ϝοηʔδΛදࣔͯ͠FYJU͢Δ
SBJMTOFXίϚϯυ Ҏ্ͷΑ͏ʹ࣮͞Ε͍ͯͨ
5IBOLT