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
Ruby Scripts To Make Life Easier
Search
Paulo Ancheta
December 06, 2016
Programming
1
140
Ruby Scripts To Make Life Easier
Introduction to subprocesses and how to use them for everyday use.
Paulo Ancheta
December 06, 2016
Tweet
Share
More Decks by Paulo Ancheta
See All by Paulo Ancheta
Demystifying Git
pauloancheta
0
55
A PR Has Been Submitted
pauloancheta
0
57
Other Decks in Programming
See All in Programming
手戻りゼロ? Spec Driven Developmentとは@KAG AI week
tmhirai
1
170
Claude Code、ちょっとした工夫で開発体験が変わる
tigertora7571
0
200
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
210
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
750
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
360
PJのドキュメントを全部Git管理にしたら、一番喜んだのはAIだった
nanaism
0
240
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
180
株式会社 Sun terras カンパニーデック
sunterras
0
2k
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
720
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
280
朝日新聞のデジタル版を支えるGoバックエンド ー価値ある情報をいち早く確実にお届けするために
junkiishida
1
640
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
Featured
See All Featured
Crafting Experiences
bethany
1
81
The Cost Of JavaScript in 2023
addyosmani
55
9.7k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
370
Code Review Best Practice
trishagee
74
20k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
130
The World Runs on Bad Software
bkeepers
PRO
72
12k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
660
AI: The stuff that nobody shows you
jnunemaker
PRO
3
360
Typedesign – Prime Four
hannesfritz
42
3k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
190
Product Roadmaps are Hard
iamctodd
PRO
55
12k
It's Worth the Effort
3n
188
29k
Transcript
Ruby Scripts to Make Life Easier #MakeRubyGreatAgain
@PauloAncheta
We make alias-es all the time. We should make something
more useful.
# talk.rb system “echo hello world” $ ruby talk.rb hello
world
# talk* #! bin/env ruby `echo hello world` $ mv
talk.rb talk $ chmod u+x talk $ ./talk hello world
# talk* #! bin/env ruby string = “hello world” `echo
#{string}` $ ./talk hello world
# talk* #! bin/env ruby string = “hello world” `echo
#{string.gsub(/world/, “VanRuby”) } | grep file.txt` $ ./talk | more file.txt hello VanRuby
$ irb irb(main):001:0> files = `ls` => “Applications\nDesktop\nDocuments\nDow nloads\nLibrary\nMovies\nMusic\nPictur es\nPublic\ntalk\n”
irb(main):002:0> files.class => String
irb(main):003:0> system `ls` => true
All of that is great. How can I be productive
doe?
# clean-pg* #! bin/env ruby pg = `ps aux |
grep postgres | grep waiting` pg = pg.split(/\n/) pg.each do |waiting| # ... some process to get the pid `kill #{pid}` end
# split-branch* #! bin/env ruby # commits => 1z2y3 TICKET-number
msg specific_commits = `git log - -pretty - -oneline | grep #{ARGV}` `git checkout master && git pull origin master && git checkout -b test-branch` specific_commits.each do |commit| sha = commit[0..6] # => [123asdf, qwer456, … ] `git cherry-pick #{sha}` end
#MakeRubyGreatAgain