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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Martin Chabot
September 20, 2012
Programming
160
3
Share
Rubyc
Rubyc helps you at the command line
Martin Chabot
September 20, 2012
Other Decks in Programming
See All in Programming
Alternatives to JPA 2026
debop
0
110
Exploring RuboCop with MCP
koic
0
550
ハンズオンで学ぶクラウドネイティブ
tatsukiminami
0
120
ルールルルルルRubyの中身の予備知識 ── RubyKaigiの前に予習しなイカ?
ydah
1
170
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
200
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
230
アーキテクチャモダナイゼーションとは何か
nwiizo
17
5k
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
0
140
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
4
890
의존성 주입과 모듈화
fornewid
0
130
「Linuxサーバー構築標準教科書」を読んでみた #ツナギメオフライン.7
akase244
0
1.4k
L’IA au service des devs : Anatomie d'un assistant de Code Review
toham
0
240
Featured
See All Featured
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
350
Designing for humans not robots
tammielis
254
26k
Building Adaptive Systems
keathley
44
3k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
250
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
710
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
360
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
260
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
180
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
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