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
700
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
310
シェルスクリプトをサーバーレスで cron したい
yasuhiroki
1
760
自動化を習慣化する
yasuhiroki
2
14k
GitHub Actions Parallel Testing
yasuhiroki
1
1.2k
circleci.vim
yasuhiroki
0
1.5k
ベンチャー企業がCircleCIを選んだ理由と活用方法
yasuhiroki
1
760
Rubyの正規表現を調べてみた
yasuhiroki
0
780
開発者(個人)のためのJenkins 運用編
yasuhiroki
0
2.2k
Other Decks in Technology
See All in Technology
Amazon CloudWatch Network Monitor のススメ
yuki_ink
1
210
DynamoDB でスロットリングが発生したとき_大盛りver/when_throttling_occurs_in_dynamodb_long
emiki
1
440
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
950
SRE×AIOpsを始めよう!GuardDutyによるお手軽脅威検出
amixedcolor
0
190
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
8
880
データプロダクトの定義からはじめる、データコントラクト駆動なデータ基盤
chanyou0311
2
330
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
160
プロダクト活用度で見えた真実 ホリゾンタルSaaSでの顧客解像度の高め方
tadaken3
0
190
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
160
生成AIが変えるデータ分析の全体像
ishikawa_satoru
0
170
アプリエンジニアのためのGraphQL入門.pdf
spycwolf
0
100
Python(PYNQ)がテーマのAMD主催のFPGAコンテストに参加してきた
iotengineer22
0
520
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
180
21k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Navigating Team Friction
lara
183
14k
A better future with KSS
kneath
238
17k
Adopting Sorbet at Scale
ufuk
73
9.1k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
RailsConf 2023
tenderlove
29
900
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
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