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
150
1
Share
Ruby Scripts To Make Life Easier
Introduction to subprocesses and how to use them for everyday use.
Paulo Ancheta
December 06, 2016
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
おれのAgentic Coding 2026/03
tsukasagr
1
120
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
280
Claude Codeログ基盤の構築
giginet
PRO
7
3.8k
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
120
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
2
120
Feature Toggle は捨てやすく使おう
gennei
0
400
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.8k
How to stabilize UI tests using XCTest
akkeylab
0
150
今年もTECHSCOREブログを書き続けます!
hiraoku101
0
220
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
190
Claude Code Skill入門
mayahoney
0
460
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
5
2.4k
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
300
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
68
38k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
95
Technical Leadership for Architectural Decision Making
baasie
3
300
The Mindset for Success: Future Career Progression
greggifford
PRO
0
290
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
So, you think you're a good person
axbom
PRO
2
2k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
460
For a Future-Friendly Web
brad_frost
183
10k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
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