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
introduction_scriptor_gem.pdf
Search
hatsu
January 09, 2025
Programming
190
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
introduction_scriptor_gem.pdf
hatsu
January 09, 2025
More Decks by hatsu
See All by hatsu
Prism.parseで 300本以上あるエンドポイントに 接続できる権限の一覧表を作ってみた
hatsu38
1
200
MySQL初心者が311個のカラムにNot NULL制約を追加していってALTER TABLEについて学んだ話
hatsu38
2
420
約9000個の自動テストの 時間を50分->10分に短縮 Flakyテストを1%以下に抑えた話
hatsu38
25
20k
Just a Rails Patch Update
hatsu38
2
960
Dive into MaintenanceTasks
hatsu38
1
220
GitHub Actions is Fun
hatsu38
1
220
Other Decks in Programming
See All in Programming
LLM Plugin for Node-REDの利用方法と開発について
404background
0
160
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.6k
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.5k
AIエージェントの隔離技術の徹底比較
kawayu
0
460
net-httpのHTTP/2対応について
naruse
0
440
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
350
CSC307 Lecture 17
javiergs
PRO
0
310
AutonomyとControlのあいだ:Graflowで記述するAIエージェント協調
myui
0
110
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
2.9k
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
400
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
150
dRuby over BLE
makicamel
2
320
Featured
See All Featured
Practical Orchestrator
shlominoach
191
11k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.9k
sira's awesome portfolio website redesign presentation
elsirapls
0
270
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
Designing for humans not robots
tammielis
254
26k
Leo the Paperboy
mayatellez
7
1.8k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
150
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Un-Boring Meetings
codingconduct
0
310
Designing Powerful Visuals for Engaging Learning
tmiket
1
400
Transcript
Rails8 scripts generatorͷհ ͱͦΕʹ·ͭΘΔGemΛ࡞ͬͨ Omotesando.rb #104 @hatsu_38 2025/01/09
ࣗݾհ • Twitter: @hatsu_38 • GitHub: @hatsu38 • SHE Inc.
• Rubyྺ 5 = ΤϯδχΞྺ • React.js / TypeScript / GitHub Actions • Ruby͕Ұ൪͖
Rails8͔ΒՃ͞Εͨ scriptϑΥϧμ͍ͬͯ·͢ʁ
None
https://discuss.rubyonrails.org/t/is-there-any-of fi cial-way-to-organize-one-off-scripts/74186
OneTime(Ұ͖Γ)ͷscriptͷஔ͖ͷ՝ • ࠓ·ͰRailsެࣜͰఏڙ͍ͯ͠ΔOneTimeઐ༻ͷscriptͷஔ͖ͳ͔ͬͨ • OneTimeͷεΫϦϓτlib/tasks/* ʹஔ͍ͯӡ༻͞Ε͍ͯΔέʔεଟ͍ • migrateͷͨΊͳΒdata_migrate gemmaintenance_tasks gemͷखஈ͋Δ
• ͨͩlib/tasks/*ʹԿ࣮ߦ͞ΕΔScriptͳͲઃஔ͞Ε͍ͯΔ
OneTime(Ұ͖Γ)ͷscriptͷஔ͖Ͳ͕͍͍͜ʁ • Ұ͔͠Θͳ͍scriptɺෳճ࣮ߦ͠ͳ͍͜ͱΛ໌ࣔ͢ΔͨΊʹผϑΥϧμʹ͓͍ ͓͖͍ͯͨ • DHHͷBasecampͰɺscript/migrate/* ͷΑ͏ͳϑΥϧμʹཧ͍ͯ͠Δ • ଞʹscript/benchmarks/*
script/ops/* ͷΑ͏ͳͷΛ࡞ͬͯͨΓ͢Δ
https://github.com/rails/rails/pull/52335
bin/rails generate script my_script • script/my_script.rb ͕ੜ͞ΕΔ • cat script/my_script.rb
• த͍͢͝γϯϓϧ
scriptϑΥϧμͷ͍ํͷྫ • ruby script/my_script.rb "1" "
[email protected]
"
script folderͷഎܠ͍ํҎ্
αʔόʔʹೖ࣮ͬͯߦͱ͔ݏͩͳ͊💭
࣮ߦ݁ՌཤྺͰͱ͓͖͍ͬͯͨͳ💭
GemΛ࡞ͬͯΈͨ💡 https://github.com/hatsu38/scriptor
scriptϑΥϧμʹ͋ΔϑΝΠϧҰཡΛϒϥβͰӾཡͰ͖Δ
scriptϑΥϧμʹ͋ΔϑΝΠϧΛϒϥβͰӾཡͰ͖Δ
ϒϥβ͔Βscriptͷίʔυͷ࣮ߦ͕Ͱ͖Δ/࣮ߦཤྺ͕Δ
None
scriptorͷಋೖ • bundle add scriptor • bin/rails generate scriptor:install •
con fi g/routes.rbʹ `mount Scriptor::Engine => “/scriptor"` ͕Ճ͞ΕΔ • db/migrations/****_create_scriptor_executions.scriptor.rb ͕ੜ͞ΕΔ
Rails8 scriptϑΥϧμͷհͱ Scriptor gemͷհͰͨ͠💡