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
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
AIと人間の共創開発!OSSで試行錯誤した開発スタイル
mae616
1
140
私達はmodernize packageに夢を見るか feat. go/analysis, go/ast / Go Conference 2025
kaorumuta
2
560
Writing Better Go: Lessons from 10 Code Reviews
konradreiche
0
1.2k
Building, Deploying, and Monitoring Ruby Web Applications with Falcon (Kaigi on Rails 2025)
ioquatix
4
2.1k
All About Angular's New Signal Forms
manfredsteyer
PRO
0
150
PHPに関数型の魂を宿す〜PHP 8.5 で実現する堅牢なコードとは〜 #phpcon_hiroshima / phpcon-hiroshima-2025
shogogg
1
220
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
200
Web フロントエンドエンジニアに開かれる AI Agent プロダクト開発 - Vercel AI SDK を観察して AI Agent と仲良くなろう! #FEC余熱NIGHT
izumin5210
3
530
10年もののAPIサーバーにおけるCI/CDの改善の奮闘
mbook
0
820
Serena MCPのすすめ
wadakatu
4
1k
Flutterで分数(Fraction)を表示する方法
koukimiura
0
130
その面倒な作業、「Dart」にやらせませんか? Flutter開発者のための業務効率化
yordgenome03
1
130
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
189
55k
The World Runs on Bad Software
bkeepers
PRO
72
11k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Optimizing for Happiness
mojombo
379
70k
Gamification - CAS2011
davidbonilla
81
5.5k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
9
590
Building an army of robots
kneath
306
46k
Six Lessons from altMBA
skipperchong
29
4k
Building Adaptive Systems
keathley
44
2.8k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.1k
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