# Ruby T-Shirt Idea

**URL:** <https://rubytalk.org/t/ruby-t-shirt-idea/6778>\
**Category:** ruby-talk\
**Created:** [9 July 2003 22:35 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778 "2003-07-09T22:35:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Austin\_King](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@Austin\_King](https://rubytalk.org/u/Austin_King)\
**Post date:** [9 July 2003 22:35 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/1 "2003-07-09T22:35:51Z")

</div>

Keywords: advocacy, silly t-shirts, Request For Feedback

Hello from Yet Another Newbie Ruby User,  
I am not religious about languages, but have been really enjoying Ruby  
and need a new T-shirt for around the office. So I thought I would  
make one.

Picture this in bold red print on a white shirt

class RubyFan \< OOProgrammer  
include OpenSource  
def initialize( name, talent )  
super( name, talent )  
# adjust for inherent Rubyness  
@productivity = CodeFu.MASTER \* talent  
@stress\_level = @stress\_level / 2  
@street\_cred = true;  
end  
end

# [http://ruby-lang.org](http://ruby-lang.org)

any thoughts? Anything inherantly un-rubyish?

– Ozten

---

<div class="post-metadata">

**Author:** ![Daniel\_Carrera](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@Daniel\_Carrera](https://rubytalk.org/u/Daniel_Carrera)\
**Post date:** [9 July 2003 22:40 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/2 "2003-07-09T22:40:13Z")

</div>

I like the idea of Ruby t-shirts, but your code snipet is rather long for  
a t-shirt. It has to be quick and catchy. How about this:

a, b = b, a  
Who needs temp variables?  
[http://www.ruby-lang.org](http://www.ruby-lang.org)

Cheers,  
Daniel.

> **···**
>
> On Thu, Jul 10, 2003 at 07:35:51AM +0900, Austin King wrote:
> 
> > Keywords: advocacy, silly t-shirts, Request For Feedback
> > 
> > Hello from Yet Another Newbie Ruby User,  
> > I am not religious about languages, but have been really enjoying Ruby  
> > and need a new T-shirt for around the office. So I thought I would  
> > make one.
> > 
> > Picture this in bold red print on a white shirt
> > 
> > class RubyFan \< OOProgrammer  
> > include OpenSource  
> > def initialize( name, talent )  
> > super( name, talent )
> > 
> > # adjust for inherent Rubyness
> > 
> > @productivity = CodeFu.MASTER \* talent  
> > @stress\_level = @stress\_level / 2  
> > @street\_cred = true;  
> > end  
> > end
> > 
> > # [http://ruby-lang.org](http://ruby-lang.org)
> > 
> > any thoughts? Anything inherantly un-rubyish?
> > 
> > – Ozten
> 
> * * *
> 
> Daniel Carrera | OpenPGP fingerprint:  
> Graduate TA, Math Dept | 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88  
> UMD (301) 405-5137 | [http://www.math.umd.edu/~dcarrera/pgp.html](http://www.math.umd.edu/~dcarrera/pgp.html)

---

<div class="post-metadata">

**Author:** ![Brian\_Candler](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@Brian\_Candler](https://rubytalk.org/u/Brian_Candler)\
**Post date:** [10 July 2003 09:49 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/3 "2003-07-10T09:49:36Z")

</div>

Note that the semicolon isn’t needed.

Regards,

Brian.

> **···**
>
> On Thu, Jul 10, 2003 at 07:35:51AM +0900, Austin King wrote:
> 
> > class RubyFan \< OOProgrammer  
> > include OpenSource  
> > def initialize( name, talent )  
> > super( name, talent )
> > 
> > # adjust for inherent Rubyness
> > 
> > @productivity = CodeFu.MASTER \* talent  
> > @stress\_level = @stress\_level / 2  
> > @street\_cred = true;  
> > end  
> > end

---

<div class="post-metadata">

**Author:** ![Ian\_Macdonald](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@Ian\_Macdonald](https://rubytalk.org/u/Ian_Macdonald)\
**Post date:** [11 July 2003 10:28 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/4 "2003-07-11T10:28:49Z")

</div>

That’s good. I came up with the following:

class Ruby \< Scripting\_Languages  
include Perl  
include Python  
end

Ian

> **···**
>
> On Thu 10 Jul 2003 at 07:35:51 +0900, Austin King wrote:
> 
> > Keywords: advocacy, silly t-shirts, Request For Feedback
> > 
> > Hello from Yet Another Newbie Ruby User,  
> > I am not religious about languages, but have been really enjoying Ruby  
> > and need a new T-shirt for around the office. So I thought I would  
> > make one.
> > 
> > Picture this in bold red print on a white shirt
> > 
> > class RubyFan \< OOProgrammer  
> > include OpenSource  
> > def initialize( name, talent )  
> > super( name, talent )
> > 
> > # adjust for inherent Rubyness
> > 
> > @productivity = CodeFu.MASTER \* talent  
> > @stress\_level = @stress\_level / 2  
> > @street\_cred = true;  
> > end  
> > end
> > 
> > # [http://ruby-lang.org](http://ruby-lang.org)
> > 
> > any thoughts? Anything inherantly un-rubyish?
> 
> –  
> Ian Macdonald | Kramer’s Law: You can never tell which way  
> System Administrator | the train went by looking at the tracks.  
> [ian@caliban.org](mailto:ian@caliban.org) |  
> [http://www.caliban.org](http://www.caliban.org) |  
> \>

---

<div class="post-metadata">

**Author:** ![gabriele\_renzi4](https://avatars.discourse-cdn.com/v4/letter/g/e36b37/32.png) [@gabriele\_renzi4](https://rubytalk.org/u/gabriele_renzi4)\
**Post date:** [9 July 2003 23:16 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/5 "2003-07-09T23:16:07Z")

</div>

5.times { puts ‘ruby r0x!’}

> **···**
>
> il Thu, 10 Jul 2003 07:40:13 +0900, Daniel Carrera [dcarrera@math.umd.edu](mailto:dcarrera@math.umd.edu) ha scritto::
> 
> > -----BEGIN PGP SIGNED MESSAGE-----  
> > Hash: SHA1
> > 
> > I like the idea of Ruby t-shirts, but your code snipet is rather long for  
> > a t-shirt. It has to be quick and catchy. How about this:
> > 
> > a, b = b, a  
> > Who needs temp variables?  
> > [http://www.ruby-lang.org](http://www.ruby-lang.org)

---

<div class="post-metadata">

**Author:** ![Tim\_Hammerquist2](https://avatars.discourse-cdn.com/v4/letter/t/8c91f0/32.png) [@Tim\_Hammerquist2](https://rubytalk.org/u/Tim_Hammerquist2)\
**Post date:** [10 July 2003 00:57 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/6 "2003-07-10T00:57:35Z")

</div>

Daniel Carrera graced us by uttering:

> I like the idea of Ruby t-shirts, but your code snipet is  
> rather long for a t-shirt. It has to be quick and catchy. How  
> about this:
> 
> a, b = b, a  
> Who needs temp variables?  
> [http://www.ruby-lang.org](http://www.ruby-lang.org)

Perl and Python both do this. Python even uses the same syntax.

What can we use that demonstrates something that Ruby’s uniquely  
useful for in 4 lines or less?

Tim Hammerquist

> **···**
>
> –  
> This text is protected by Double-ROT13 encryption.  
> Any attempt to decode this text is a violation of the DMCA/WIPO acts.

---

<div class="post-metadata">

**Author:** ![Xavier\_Noria](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/xavier_noria/32/1867_2.png) [@Xavier\_Noria](https://rubytalk.org/u/Xavier_Noria)\
**Post date:** [9 July 2003 23:28 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/7 "2003-07-09T23:28:49Z")

</div>

“Please, keep your language clean” (seen on freenode#ruby-lang 🙂

– fxn

> **···**
>
> On Thursday 10 July 2003 01:16, gabriele renzi wrote:
> 
> > il Thu, 10 Jul 2003 07:40:13 +0900, Daniel Carrera \> \> [dcarrera@math.umd.edu](mailto:dcarrera@math.umd.edu) ha scritto::
> > 
> > > -----BEGIN PGP SIGNED MESSAGE-----  
> > > Hash: SHA1
> > > 
> > > I like the idea of Ruby t-shirts, but your code snipet is rather  
> > > long for a t-shirt. It has to be quick and catchy. How about  
> > > this:
> > > 
> > > a, b = b, a  
> > > Who needs temp variables?  
> > > [http://www.ruby-lang.org](http://www.ruby-lang.org)
> > 
> > 5.times { puts ‘ruby r0x!’}

---

<div class="post-metadata">

**Author:** ![Daniel\_Carrera](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@Daniel\_Carrera](https://rubytalk.org/u/Daniel_Carrera)\
**Post date:** [10 July 2003 01:00 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/8 "2003-07-10T01:00:29Z")

</div>

Gabriele suggested “4.times { puts ‘Ruby rocks!’ }”. I like it.

* * *

Daniel Carrera | OpenPGP fingerprint:  
Graduate TA, Math Dept | 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88  
UMD (301) 405-5137 | [http://www.math.umd.edu/~dcarrera/pgp.html](http://www.math.umd.edu/~dcarrera/pgp.html)

> **···**
>
> On Thu, Jul 10, 2003 at 09:57:35AM +0900, Tim Hammerquist wrote:
> 
> > Daniel Carrera graced us by uttering:
> > 
> > > I like the idea of Ruby t-shirts, but your code snipet is  
> > > rather long for a t-shirt. It has to be quick and catchy. How  
> > > about this:
> > > 
> > > a, b = b, a  
> > > Who needs temp variables?  
> > > [http://www.ruby-lang.org](http://www.ruby-lang.org)
> > 
> > Perl and Python both do this. Python even uses the same syntax.
> > 
> > What can we use that demonstrates something that Ruby’s uniquely  
> > useful for in 4 lines or less?

---

<div class="post-metadata">

**Author:** ![HAL\_9000](https://avatars.discourse-cdn.com/v4/letter/h/90ced4/32.png) [@HAL\_9000](https://rubytalk.org/u/HAL_9000)\
**Post date:** [10 July 2003 03:38 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/9 "2003-07-10T03:38:10Z")

</div>

> Daniel Carrera graced us by uttering:
> 
> > I like the idea of Ruby t-shirts, but your code snipet is  
> > rather long for a t-shirt. It has to be quick and catchy. How  
> > about this:
> > 
> > a, b = b, a  
> > Who needs temp variables?  
> > [http://www.ruby-lang.org](http://www.ruby-lang.org)
> 
> Perl and Python both do this. Python even uses the same syntax.
> 
> What can we use that demonstrates something that Ruby’s uniquely  
> useful for in 4 lines or less?

Hmm, there’s the classic “grep in four lines.” Can’t recall  
exactly how it looks – I think it used a perlism that I’m  
not used to.

> ## Tim Hammerquist
> 
> This text is protected by Double-ROT13 encryption.  
> Any attempt to decode this text is a violation of the DMCA/WIPO acts.

lol… guess we’re all in violation, eh? Hmm, wouldn’t  
Double-rot13 be rot26? Or rot0?

Hal

> **···**
>
> ----- Original Message -----  
> From: “Tim Hammerquist” [tim@vegeta.ath.cx](mailto:tim@vegeta.ath.cx)  
> Newsgroups: comp.lang.ruby  
> To: “ruby-talk ML” [ruby-talk@ruby-lang.org](mailto:ruby-talk@ruby-lang.org)  
> Sent: Wednesday, July 09, 2003 7:57 PM  
> Subject: Re: Ruby T-Shirt Idea
> 
> –  
> Hal Fulton  
> [hal9000@hypermetrics.com](mailto:hal9000@hypermetrics.com)

---

<div class="post-metadata">

**Author:** ![Josef\_Jupp\_SCHUGT](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@Josef\_Jupp\_SCHUGT](https://rubytalk.org/u/Josef_Jupp_SCHUGT)\
**Post date:** [10 July 2003 20:19 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/10 "2003-07-10T20:19:26Z")

</div>

Saluton!

- gabriele renzi; 2003-07-10, 12:56 UTC:

> 5.times { puts ‘ruby r0x!’}

puts ruby.rocks  
true

Gis,

Josef ‘Jupp’ Schugt

> **···**
>
> –  
> N’attribuez jamais à la malice ce que l’incompétence explique !  
> – Napoléon

---

<div class="post-metadata">

**Author:** ![Daniel\_Carrera](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@Daniel\_Carrera](https://rubytalk.org/u/Daniel_Carrera)\
**Post date:** [10 July 2003 05:16 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/11 "2003-07-10T05:16:15Z")

</div>

Doesn’t sound that hard. Could someone remind me how to use the File.eachline method? (I  
know I’ve gotten it at least partially wrong there).

Or could someone give me a link to PickAxe so I can look it up?

Thanks.

* * *

Daniel Carrera | OpenPGP fingerprint:  
Graduate TA, Math Dept | 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88  
UMD (301) 405-5137 | [http://www.math.umd.edu/~dcarrera/pgp.html](http://www.math.umd.edu/~dcarrera/pgp.html)

> **···**
>
> On Thu, Jul 10, 2003 at 12:38:10PM +0900, Hal E. Fulton wrote:
> 
> > Hmm, there’s the classic “grep in four lines.” Can’t recall  
> > exactly how it looks – I think it used a perlism that I’m  
> > not used to.

---

<div class="post-metadata">

**Author:** ![Daniel\_Carrera](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@Daniel\_Carrera](https://rubytalk.org/u/Daniel_Carrera)\
**Post date:** [10 July 2003 05:27 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/12 "2003-07-10T05:27:07Z")

</div>

I just thought of a dead give-away:

dcarrera ~ $ cat myfile  
cat  
dog  
horse  
zebra  
tiger  
dcarrera ~ $ grep a myfile  
cat  
zebra  
dcarrera ~ $ ruby -e ‘puts ARGF.grep(/a/)’ myfile  
cat  
zebra

Cheers,

* * *

Daniel Carrera | OpenPGP fingerprint:  
Graduate TA, Math Dept | 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88  
UMD (301) 405-5137 | [http://www.math.umd.edu/~dcarrera/pgp.html](http://www.math.umd.edu/~dcarrera/pgp.html)

> **···**
>
> On Thu, Jul 10, 2003 at 12:38:10PM +0900, Hal E. Fulton wrote:
> 
> > Hmm, there’s the classic “grep in four lines.” Can’t recall  
> > exactly how it looks – I think it used a perlism that I’m  
> > not used to.

---

<div class="post-metadata">

**Author:** ![Mauricio\_Fernndez](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@Mauricio\_Fernndez](https://rubytalk.org/u/Mauricio_Fernndez)\
**Post date:** [10 July 2003 05:47 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/13 "2003-07-10T05:47:16Z")

</div>

What about

require ‘English’  
re = ARGV.shift  
$DEFAULT\_INPUT.each{|x| puts x if x =~ /#{re}/}

??

It’s two lines if you use ‘$\<’…

> **···**
>
> On Thu, Jul 10, 2003 at 12:38:10PM +0900, Hal E. Fulton wrote:
> 
> > > What can we use that demonstrates something that Ruby’s uniquely  
> > > useful for in 4 lines or less?
> > 
> > Hmm, there’s the classic “grep in four lines.” Can’t recall  
> > exactly how it looks – I think it used a perlism that I’m  
> > not used to.
> 
> –  
> \_ \_
> 
> > > \_\_ \_\_ _| |_ \_\_\_ \_ \_\_ \_\_\_ \_\_ \_ \_ \_\_  
> > > '\_ \ / _`| __/__ | '_` \_ \ / ` | ’ \   
> > > ) | (| | |_\_\_ \ | | | | | (_| | | | |  
> > > .\_\_/ \_,_|\ __|__ /| |_| |_|\__,_|_| |\_|  
> > > Running Debian GNU/Linux Sid (unstable)  
> > > batsman dot geo at yahoo dot com
> 
> Linux: because a PC is a terrible thing to waste  
> – ksh@cis.ufl.edu put this on Tshirts in '93

---

<div class="post-metadata">

**Author:** ![gabriele\_renzi4](https://avatars.discourse-cdn.com/v4/letter/g/e36b37/32.png) [@gabriele\_renzi4](https://rubytalk.org/u/gabriele_renzi4)\
**Post date:** [10 July 2003 21:41 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/14 "2003-07-10T21:41:39Z")

</div>

=\> true

🙂

> **···**
>
> il Thu, 10 Jul 2003 12:38:10 +0900, “Hal E. Fulton” [hal9000@hypermetrics.com](mailto:hal9000@hypermetrics.com) ha scritto::
> 
> > lol… guess we’re all in violation, eh? Hmm, wouldn’t  
> > Double-rot13 be rot26? Or rot0?
> 
> > > x.rot13.rot13

---

<div class="post-metadata">

**Author:** ![Tim\_Hammerquist2](https://avatars.discourse-cdn.com/v4/letter/t/8c91f0/32.png) [@Tim\_Hammerquist2](https://rubytalk.org/u/Tim_Hammerquist2)\
**Post date:** [10 July 2003 22:01 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/15 "2003-07-10T22:01:47Z")

</div>

Hal E. Fulton graced us by uttering:

> **···**
>
> > Tim Hammerquist [tim@vegeta.ath.cx](mailto:tim@vegeta.ath.cx) wrote:
> > 
> > > –  
> > > This text is protected by Double-ROT13 encryption.  
> > > Any attempt to decode this text is a violation of the DMCA/WIPO acts.
> > 
> > lol… guess we’re all in violation, eh? Hmm, wouldn’t  
> > Double-rot13 be rot26? Or rot0?
> 
> Actually, it’s rot52, but that’s just because I’m working with a  
> poker game at the moment. If we apply the same naming scheme as  
> the DES algorithm, it would be 2rot13, IIRC.
> 
> I don’t think it matters much, really. Next to the DMCA,  
> everything else sounds educated.
> 
> ## Tim Hammerquist
> 
> I do die sometimes, but I am doing well.  
> – Hyatt, “Excel Saga”

---

<div class="post-metadata">

**Author:** ![Ian\_Macdonald](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@Ian\_Macdonald](https://rubytalk.org/u/Ian_Macdonald)\
**Post date:** [11 July 2003 10:22 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/16 "2003-07-11T10:22:37Z")

</div>

Here’s my humble and slightly obscure variation:

class Symbol  
def method\_missing(verb=‘rocks’, \*other\_words)  
puts [self.to\_s, verb, other\_words].join(’ ')  
end  
end

:Programming.should(‘be’, ‘fun’)  
:Ruby.rules %w[the world of scripting]

Ian

> **···**
>
> On Thu 10 Jul 2003 at 10:00:29 +0900, Daniel Carrera wrote:
> 
> > -----BEGIN PGP SIGNED MESSAGE-----  
> > Hash: SHA1
> > 
> > On Thu, Jul 10, 2003 at 09:57:35AM +0900, Tim Hammerquist wrote:
> > 
> > > Daniel Carrera graced us by uttering:
> > > 
> > > What can we use that demonstrates something that Ruby’s uniquely  
> > > useful for in 4 lines or less?
> > 
> > Gabriele suggested “4.times { puts ‘Ruby rocks!’ }”. I like it.
> 
> –  
> Ian Macdonald | Quantum Mechanics is God’s version of  
> System Administrator | “Trust me.”  
> [ian@caliban.org](mailto:ian@caliban.org) |  
> [http://www.caliban.org](http://www.caliban.org) |  
> \>

---

<div class="post-metadata">

**Author:** ![Martin\_DeMello1](https://avatars.discourse-cdn.com/v4/letter/m/3be4f8/32.png) [@Martin\_DeMello1](https://rubytalk.org/u/Martin_DeMello1)\
**Post date:** [12 July 2003 07:00 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/17 "2003-07-12T07:00:50Z")

</div>

I’ve always thought that would make an excellent slogan 🙂

Ruby - keep your language clean!

[www.ruby-lang.org](http://www.ruby-lang.org)

If we’re going for unusual ruby features, I think open classes are the  
most interesting. “Ruby - open source, open classes!”

martin

> **···**
>
> Xavier Noria [fxn@hashref.com](mailto:fxn@hashref.com) wrote:
> 
> > “Please, keep your language clean” (seen on freenode#ruby-lang 🙂

---

<div class="post-metadata">

**Author:** ![Daniel\_Carrera](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@Daniel\_Carrera](https://rubytalk.org/u/Daniel_Carrera)\
**Post date:** [10 July 2003 05:21 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/18 "2003-07-10T05:21:09Z")

</div>

Okay, ignore my last question (except the one about a link to PicAxe). I just figured the  
syntax (basically by trying every possible permutation).

Now I have a new question: Turning a string into a regex.  
Example:

dcarrera ~ $ irb

> > var = “he”  
> > =\> “he”  
> > str = “hello world”  
> > =\> “hello world”  
> > str =~ /var/  
> > =\> nil

What am I doing wrong?

> **···**
>
> On Thu, Jul 10, 2003 at 02:16:15PM +0900, Daniel Carrera wrote:
> 
> > On Thu, Jul 10, 2003 at 12:38:10PM +0900, Hal E. Fulton wrote:
> > 
> > > Hmm, there’s the classic “grep in four lines.” Can’t recall  
> > > exactly how it looks – I think it used a perlism that I’m  
> > > not used to.
> > 
> > Doesn’t sound that hard. Could someone remind me how to use the File.eachline method? (I  
> > know I’ve gotten it at least partially wrong there).
> > 
> > Or could someone give me a link to PickAxe so I can look it up?
> > 
> > ## Thanks.
> > 
> > Daniel Carrera | OpenPGP fingerprint:  
> > Graduate TA, Math Dept | 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88  
> > UMD (301) 405-5137 | [http://www.math.umd.edu/~dcarrera/pgp.html](http://www.math.umd.edu/~dcarrera/pgp.html)
> 
> * * *
> 
> Daniel Carrera | OpenPGP fingerprint:  
> Graduate TA, Math Dept | 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88  
> UMD (301) 405-5137 | [http://www.math.umd.edu/~dcarrera/pgp.html](http://www.math.umd.edu/~dcarrera/pgp.html)

---

<div class="post-metadata">

**Author:** ![HAL\_9000](https://avatars.discourse-cdn.com/v4/letter/h/90ced4/32.png) [@HAL\_9000](https://rubytalk.org/u/HAL_9000)\
**Post date:** [10 July 2003 05:31 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/19 "2003-07-10T05:31:07Z")

</div>

Quite right.

The part I can’t remember was one of those  
“implicit loop” things that I never use…

BTW, var = Regexp.new(Regexp.escape(var)) will  
also do that conversion… probably more than  
two ways… 😉

As for interpolating a variable into a regex,  
I’m not sure whether it does automatic escaping  
or not. I’d like to think it does, but there  
may be some good reason it doesn’t. Too lazy to  
test right now…

Hal

> **···**
>
> ----- Original Message -----  
> From: “Daniel Carrera” [dcarrera@math.umd.edu](mailto:dcarrera@math.umd.edu)  
> To: “ruby-talk ML” [ruby-talk@ruby-lang.org](mailto:ruby-talk@ruby-lang.org)  
> Sent: Thursday, July 10, 2003 12:27 AM  
> Subject: Re: Ruby T-Shirt Idea
> 
> > I just thought of a dead give-away:
> > 
> > dcarrera ~ $ cat myfile  
> > cat  
> > dog  
> > horse  
> > zebra  
> > tiger  
> > dcarrera ~ $ grep a myfile  
> > cat  
> > zebra  
> > dcarrera ~ $ ruby -e ‘puts ARGF.grep(/a/)’ myfile  
> > cat  
> > zebra
> 
> –  
> Hal Fulton  
> [hal9000@hypermetrics.com](mailto:hal9000@hypermetrics.com)

---

<div class="post-metadata">

**Author:** ![Daniel\_Carrera](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@Daniel\_Carrera](https://rubytalk.org/u/Daniel_Carrera)\
**Post date:** [10 July 2003 05:50 UTC](https://rubytalk.org/t/ruby-t-shirt-idea/6778/20 "2003-07-10T05:50:21Z")

</div>

Did you see mine? It was one line! (with a semicolon though 🙂

* * *

Daniel Carrera | OpenPGP fingerprint:  
Graduate TA, Math Dept | 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88  
UMD (301) 405-5137 | [http://www.math.umd.edu/~dcarrera/pgp.html](http://www.math.umd.edu/~dcarrera/pgp.html)

> **···**
>
> On Thu, Jul 10, 2003 at 02:47:16PM +0900, Mauricio Fernández wrote:
> 
> > What about
> > 
> > require ‘English’  
> > re = ARGV.shift  
> > $DEFAULT\_INPUT.each{|x| puts x if x =~ /#{re}/}
> > 
> > ??
> > 
> > It’s two lines if you use ‘$\<’…

[Next page](https://rubytalk.org/t/ruby-t-shirt-idea/6778.md?page=2)
