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
Rubyc
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Martin Chabot
September 20, 2012
Programming
3
160
Rubyc
Rubyc helps you at the command line
Martin Chabot
September 20, 2012
Tweet
Share
Other Decks in Programming
See All in Programming
Grafana:建立系統全知視角的捷徑
blueswen
0
320
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
440
CSC307 Lecture 05
javiergs
PRO
0
490
登壇資料を作る時に意識していること #登壇資料_findy
konifar
3
880
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
110
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
170
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
250
Patterns of Patterns
denyspoltorak
0
1.4k
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
AgentCoreとHuman in the Loop
har1101
5
220
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
440
Basic Architectures
denyspoltorak
0
660
Featured
See All Featured
Chasing Engaging Ingredients in Design
codingconduct
0
110
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
350
Information Architects: The Missing Link in Design Systems
soysaucechin
0
770
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
We Are The Robots
honzajavorek
0
160
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
290
The untapped power of vector embeddings
frankvandijk
1
1.6k
Skip the Path - Find Your Career Trail
mkilby
0
52
Being A Developer After 40
akosma
91
590k
Code Review Best Practice
trishagee
74
20k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Designing for humans not robots
tammielis
254
26k
Transcript
Rubyc Martin Chabot Thursday, 20 September, 12
File Processing Thursday, 20 September, 12
Unix Tools • grep • find • xargs • sed
• awk • ... Thursday, 20 September, 12
Do you need to look at documentation to use sed
& awk? Thursday, 20 September, 12
If no, this presentation is not for you! Thursday, 20
September, 12
Otherwise, Why don’t you use Ruby? Thursday, 20 September, 12
ruby -n -e Thursday, 20 September, 12
Ruby’s man pages Thursday, 20 September, 12
Example cat my_file | ruby -n -e "print if /wombat/"
Thursday, 20 September, 12
ruby -p -e Thursday, 20 September, 12
Ruby’s Man Pages Thursday, 20 September, 12
ruby -r Thursday, 20 September, 12
Ruby’s man Pages Thursday, 20 September, 12
Ruby 1.8 • Can only have one -r option •
You cannot use it with rubygems Thursday, 20 September, 12
Thursday, 20 September, 12
Ruby 1.9 • Can only have many -r options •
eg: -r rubygems -r csv Thursday, 20 September, 12
Rubyc Gem • Supports Enumerable methods: map, select etc. •
Iterates on each line • Sets the ‘line’ variable and its ‘l’ alias • Sets the ‘lnum’ and the ‘index’ variable Thursday, 20 September, 12
Example Thursday, 20 September, 12
Thursday, 20 September, 12
Rubyc commands Thursday, 20 September, 12
Use Case I Colorize stderr Thursday, 20 September, 12
The shell way rake 2> >(while read line;do echo -e
"\033[31m$line \033[0m";done) Thursday, 20 September, 12
The Ruby 1.9 Way rake 2> >(ruby -r colorize -p
-e ‘$_ = $_.red’) Thursday, 20 September, 12
rake 2> >(rubyc map -r colorize ‘l.red’) The Rubyc Way
Thursday, 20 September, 12
Use Case II Extract the number of insertions per db
table in a Rails log file Thursday, 20 September, 12
The Shell Way To lazy to work on it !
Thursday, 20 September, 12
The Ruby Way To lazy too ! Thursday, 20 September,
12
The Rubyc Way Thursday, 20 September, 12
Conclusion • If you feel confortable with ruby’s -n -p
options continue using it. • If your like me, give Rubyc a chance. • Give me some feedback Thursday, 20 September, 12