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
59
A PR Has Been Submitted
pauloancheta
0
60
Other Decks in Programming
See All in Programming
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
320
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
470
Spec-Driven Development with AI Agents (Workshop, May 2026)
antonarhipov
2
290
JAWS-UG横浜 #100 祝・第100回スペシャルAWS は VPC レスの時代へ
maroon1st
0
210
Claude Codeをカスタムして自分だけのClaude Codeを作ろう
terisuke
0
160
KMP × Kotlin 2.3 - How Android Got Slower While iOS Builds Improved by 47%
rio432
0
110
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
490
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
360
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
110
AIと共に生きる技術選定 2026
sgash708
0
120
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
160
How We Practice Exploratory Testing in Iterative Development( #scrumniigata ) / 反復開発の中で、探索的テストをどう実施しているか
teyamagu
PRO
3
630
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
BBQ
matthewcrist
89
10k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Making the Leap to Tech Lead
cromwellryan
135
9.8k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
320
WCS-LA-2024
lcolladotor
0
570
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
350
Amusing Abliteration
ianozsvald
1
160
We Have a Design System, Now What?
morganepeng
55
8.1k
Scaling GitHub
holman
464
140k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
680
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