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
160
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rubyc
Rubyc helps you at the command line
Martin Chabot
September 20, 2012
Other Decks in Programming
See All in Programming
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
740
高専、大学編入、そして未踏へ〜プロダクト開発とキャリアの歩み - Technical College, University Transfer, and On to “Mitou” / My Journey in Product Development and Career
pkmiya
0
110
私のClaude Code活用法 (個人開発編) - PHPerKaigi mini #4(2026/08/24)
panda_program
1
190
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
270
レビュー履歴をAIに食わせて、 Compose移行を加速するs
shihochan
0
240
信頼性の目標を誰も求めてない
shubox
0
380
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
570
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
400
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
120
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
1.2k
リアルな遅延を測る仕様
kota_yata
1
130
My Marp Sample
sinoue0108
0
130
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.3k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Facilitating Awesome Meetings
lara
57
7.1k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Making Projects Easy
brettharned
120
6.7k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
400
Optimising Largest Contentful Paint
csswizardry
37
3.9k
Producing Creativity
orderedlist
PRO
348
40k
The Limits of Empathy - UXLibs8
cassininazir
1
620
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