Don't take it *too* seriously. All point weights are strictly
my opinion and are subject to change.
Version 1.0 follows... cut, paste, run. Or just cut and run.
Cheers,
Hal
def add(n)
@sum += n
puts "#{n} points (#{@sum} total)"
puts
end
def yorn
print "(y/n): "
ch = gets.chomp
ch=='y' ? 1 : 0
end
@sum = 0
puts
puts "First, three background geek questions:"
puts
puts "How many degrees in computer science do you have?"
deg = gets.to_i
add(deg*4)
puts "In what year did your write your FIRST program in any language?"
fp = gets.to_i
div4 = ((Time.now.year - fp)/4.0).ceil
add(div4*1)
puts "How many years have you worked in a software-related job?"
yrs = gets.to_i
div4 = (yrs/4.0).ceil
add(div4*1)
puts "\n----------------------"
puts "And now the Ruby stuff:"
puts
puts "In what year did you start using Ruby? (4 digits)"
yr = gets.to_i
partial = Time.now.year - yr
add(partial*2)
puts "In what year did you start reading the list or newsgroup? (4 digits)"
yr = gets.to_i
partial = Time.now.year - yr
add(partial*4)
puts "How many (non-vaporware) entries do you have in RAA and/or Rubyforge?"
raa = gets.to_i
add(raa*1)
puts "How many Ruby conferences have you assisted in organizing? (US or other)"
conf = gets.to_i
add(conf*6)
puts "Have you assisted in forming a local user's group?"
local = yorn
add(local*2)
puts "At how many Ruby conferences have you made presentations?"
conf = gets.to_i
add(conf*6)
puts "How many Ruby conferences have you attended?"
conf = gets.to_i
add(conf*4)
puts "Now, some book questions."
puts "Translations and newer editions count separately..."
puts
puts "How many Ruby books list you as an author?"
book = gets.to_i
add(book*6)
puts "How many (other) Ruby books have you contributed to?"
book = gets.to_i
add(book*4)
puts "How many (other) Ruby books mention your name?"
book = gets.to_i
add(book*2)
puts "How many unique Ruby books do you own?"
books = gets.to_i
add(books*1)
puts "Do you own a domain name (with content) including the word 'ruby'?"
dom = yorn
add(dom*2)
puts "Approximately how many packages of yours are now in the core or stdlib?"
core = gets.to_i
add(core*1)
puts "Is your name Yukihiro Matsumoto?"
matz = yorn
add(matz*10)
puts "Is your name Dave Thomas or Guy Decoux?"
dave = yorn
add(dave*6)
puts "Is your name: Nobu Nokada, Shugo Maeda, or Minero Aoki?"
nobu = yorn
add(nobu*4)
puts "Do you know any Japanese?"
japan = yorn
add(japan*2)
puts "Is Japanese your first language?"
japan = yorn
add(japan*3)
puts "Have you ever written Ruby for pay?"
pay = yorn
add(pay*10)
puts "Estimate your total lines of Ruby code written."
loc = (gets.to_i/5000.0).ceil
add(loc*1)
puts "How many Ruby presentations have you made (outside RubyConf)?"
nconf = gets.to_i
add(nconf*4)
puts "How many of your Ruby packages have been downloaded >500 times?"
over500 = gets.to_i
add(over500*3)
puts "Ever had an RCR accepted?"
rcr = yorn
add(rcr*5)
puts "That's all... your Ruby Geek status is measured at #@sum."
puts "Have a great day, and keep coding!"
puts
> I offer this in the spirit of the old "purity test" and the
> "nerdity test" that was derived therefrom.
>
> Don't take it *too* seriously. All point weights are strictly
> my opinion and are subject to change.
>
>
> Version 1.0 follows... cut, paste, run. Or just cut and run.
Wow, I'm probably the lowest rated guy here:
"That's all... your Ruby Geek status is measured at 535.
Have a great day, and keep coding!"
Well Hal, you certainly helped me fill out my list of, "I should do
that!"s...
James Edward Gray II
I came in at 124. I should probably get involved in some high-volume
Ruby stuff, try to be more active or something. Or get another CS degree.
James Britt
--
http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys
phhbt.. I got 29 and I've worked on Ruby stuff about full-time for a
little over a year.
In message "Re: What's your Ruby Number? (self.to_i)"
on Tue, 25 Oct 2005 11:20:28 +0900, Hal Fulton <hal...@hypermetrics.com> writes:
|I offer this in the spirit of the old "purity test" and the
|"nerdity test" that was derived therefrom.
|
|Don't take it *too* seriously. All point weights are strictly
|my opinion and are subject to change.
|Version 1.0 follows... cut, paste, run. Or just cut and run.
It gave me 500 Ruby Number.
matz.
Shannon
Well, matz needs to get some code into the standard lib.
James, 124
At Tue, 25 Oct 2005 11:20:28 +0900,
Hal Fulton wrote in [ruby-talk:162393]:
> I offer this in the spirit of the old "purity test" and the
> "nerdity test" that was derived therefrom.
143 for me.
--
Nobu Nakada
>> robert.to_i
=> 42 - 1
:p
--
http://www.braveworld.net/riva
____________________________________________________________________
http://www.freemail.gr - δωρεάν υπηρεσία ηλεκτρονικού ταχυδρομείου.
http://www.freemail.gr - free email service for the Greek-speaking.
Maybe you could try the test again, and increase your LOC estimate by 5000
or so...
LOL No way: I forgot the other answers... :-))
robert
2 ** 5
~ 1 year or ruby dabling
Regards,
Jason
http://blog.casey-sweat.us/
But that was skewed by the 120 pts
I got for the Ruby presentations I have made outside Rubyconf.
And the 100,000 LOC didn't help that much either. Maybe should
have made it 500,000.
--
Jim Freeze
Hmm, I thought it was going to be like Erdös numbers.
If you are matz, you have a Ruby number of 0.
If you've contributed patches to code written by matz, you have a Ruby
number of 1.
If you've worked on code with someone who has a Ruby number of 1, you
have a Ruby number of 2, and so on.
<URL:http://www.oakland.edu/enp/>
mathew
--
<URL:http://www.pobox.com/~meta/>
WE HAVE TACOS
> I offer this in the spirit of the old "purity test" and the
> "nerdity test" that was derived therefrom.
>
> Don't take it *too* seriously. All point weights are strictly
> my opinion and are subject to change.
chris2.to_i # => 70
Probably too young, ;-)
--
Christian Neukirchen <chneuk...@gmail.com> http://chneukirchen.org
=== start
require 'yaml'
@sum = 0
if File.exist?('ruby_number.yml')
File.open('ruby_number.yml') do |f|
@answers = YAML::load(f)
end
end
@answers ||= {}
def question(name)
@current = name
yield
end
def answer
puts "(Previous answer: #{@answers[@current]})" if @answers[@current]
reply = gets.chomp
@answers[@current] = reply if reply.length > 0
@answers[@current]
end
def add(n)
@sum += n
@answers[:total] = @sum
puts "#{n} points (#{@sum} total)"
puts
end
def yorn
print "(y/n): "
ch = answer
ch=='y' ? 1 : 0
end
puts
puts "First, three background geek questions:"
puts
question :compsci_degrees do
puts "How many degrees in computer science do you have?"
deg = answer.to_i
add(deg*4)
end
question :first_program_year do
puts "In what year did your write your FIRST program in any language?"
fp = answer.to_i
div4 = ((Time.now.year - fp)/4.0).ceil
add(div4*1)
end
question :software_job_years do
puts "How many years have you worked in a software-related job?"
yrs = answer.to_i
div4 = (yrs/4.0).ceil
add(div4*1)
end
puts "\n----------------------"
puts "And now the Ruby stuff:"
puts
question :started_with_ruby_year do
puts "In what year did you start using Ruby? (4 digits)"
yr = answer.to_i
partial = Time.now.year - yr
add(partial*2)
end
question :started_reading_newsgroup do
puts "In what year did you start reading the list or newsgroup? (4 digits)"
yr = answer.to_i
partial = Time.now.year - yr
add(partial*4)
end
question :raa_rubyforge_entries do
puts "How many (non-vaporware) entries do you have in RAA and/or
Rubyforge\?"
raa = answer.to_i
add(raa*1)
end
question :rubyconf_organize do
puts "How many Ruby conferences have you assisted in organizing? (US or
other)"
conf = answer.to_i
add(conf*6)
end
question :local_user_group do
puts "Have you assisted in forming a local user's group\?"
local = yorn
add(local*2)
end
question :rubyconf_presentations do
puts "At how many Ruby conferences have you made presentations\?"
conf = answer.to_i
add(conf*6)
end
question :rubyconf_attended do
puts "How many Ruby conferences have you attended\?"
conf = answer.to_i
add(conf*4)
end
puts "Now, some book questions."
puts "Translations and newer editions count separately..."
puts
question :ruby_books_authored do
puts "How many Ruby books list you as an author\?"
book = answer.to_i
add(book*6)
end
question :ruby_books_contributed_to do
puts "How many (other) Ruby books have you contributed to\?"
book = answer.to_i
add(book*4)
end
question :ruby_books_mention do
puts "How many (other) Ruby books mention your name\?"
book = answer.to_i
add(book*2)
end
question :ruby_books_owned do
puts "How many unique Ruby books do you own\?"
books = answer.to_i
add(books*1)
end
question :ruby_domain_name do
puts "Do you own a domain name (with content) including the word 'ruby'\?"
dom = yorn
add(dom*2)
end
question :packages_in_core_or_stdlib do
puts "Approximately how many packages of yours are now in the core or
stdlib\?"
core = answer.to_i
add(core*1)
end
question :matz do
puts "Is your name Yukihiro Matsumoto\?"
matz = yorn
add(matz*10)
end
question :dave_or_guy do
puts "Is your name Dave Thomas or Guy Decoux\?"
dave = yorn
add(dave*6)
end
question :nobu_shugo_or_minero do
puts "Is your name: Nobu Nokada, Shugo Maeda, or Minero Aoki\?"
nobu = yorn
add(nobu*4)
end
question :japanese do
puts "Do you know any Japanese\?"
japan = yorn
add(japan*2)
end
question :japanese_first_language do
puts "Is Japanese your first language\?"
japan = yorn
add(japan*3)
end
question :ruby_for_pay do
puts "Have you ever written Ruby for pay\?"
pay = yorn
add(pay*10)
end
question :ruby_loc_written do
puts "Estimate your total lines of Ruby code written."
loc = (answer.to_i/5000.0).ceil
add(loc*1)
end
question :ruby_presentations do
puts "How many Ruby presentations have you made (outside RubyConf)\?"
nconf = answer.to_i
add(nconf*4)
end
question :ruby_packages_downloaded do
puts "How many of your Ruby packages have been downloaded >500 times\?"
over500 = answer.to_i
add(over500*3)
end
question :rcr_accepted do
puts "Ever had an RCR accepted\?"
rcr = yorn
add(rcr*5)
end
puts "That's all... your Ruby Geek status is measured at #@sum."
puts "Have a great day, and keep coding!"
puts
File.open('ruby_number.yml', 'wb') do |f|
YAML::dump(@answers, f)
end
=== end
Oh, and I'm a ruby newb evidenced by my as yet low score of 15 :)
:ruby_books_authored: "0"
:started_with_ruby_year: "2005"
:ruby_for_pay: n
:ruby_domain_name: n
:rubyconf_organize: "0"
:first_program_year: "1982"
:ruby_packages_downloaded: "0"
:nobu_shugo_or_minero: n
:total: 15
:packages_in_core_or_stdlib: "0"
:ruby_books_contributed_to: "0"
:ruby_loc_written: "10000"
:local_user_group: n
:rcr_accepted: n
:japanese: n
:ruby_books_mention: "0"
:started_reading_newsgroup: "2005"
:matz: n
:rubyconf_presentations: "0"
:software_job_years: "10"
:ruby_books_owned: "0"
:raa_rubyforge_entries: "0"
:compsci_degrees: "0"
:dave_or_guy: n
:rubyconf_attended: "0"
:ruby_presentations: "1"
:japanese_first_language: n
Thanks Hal for the great icebreaker!
Cheers,
/Nick
Well, obviously I screwed up the test if anyone got higher
than Matz. I should have given 100 points for having that
name. :)
What inflated your score so much? Mine was only 184.
There's no error checking, of course. You can easily tell it
you have 250 years of programming experience. Just like it
says on your resume. Just kidding. ;)
<mumble>Heard about a recruiter looking for someone with
15 years of java experience...</mumble>
Hal
> What inflated your score so much? Mine was only 184.
535 does sound awfully high. My score was a lowly 95.
> What inflated your score so much? Mine was only 184.
>
> There's no error checking, of course. You can easily tell it
> you have 250 years of programming experience. Just like it
> says on your resume. Just kidding. ;)
Oops, it was exactly that error, yes. The first date question
doesn't warn you to enter 4 digits and I didn't. Fixing it gives me:
"That's all... your Ruby Geek status is measured at 60.
Have a great day, and keep coding!"
And just to be clear, that does involve two not-yet-released books...
Sorry for the confusion.
James Edward Gray II
LOL, I feel better now. :) Except I should have made the code more
robust. But it's just a toy eh?
Can you talk about those not-yet-released books?? Not to violate
any confidentiality, but I'm curious... one is a collection of
Ruby Quizzes, right?
Hal
Attending RubyConf, writing BASIC back in '91, HighLine, and my user
group account for most of the points.
Not bad for ~ a year.
On Tue, 25 Oct 2005, Hal Fulton wrote:
> I offer this in the spirit of the old "purity test" and the
> "nerdity test" that was derived therefrom.
135. The LOC was more or less a guess. The number of Ruby
Conferences I've helped organized, however, is etched indelibly on my
mind :-)
David
--
David A. Black
dbl...@wobblini.net
> LOL, I feel better now. :) Except I should have made the code more
> robust. But it's just a toy eh?
I liked it. It's the geeky equivelent of those getting to know you
chain letters.
> Can you talk about those not-yet-released books??
Sure.
> one is a collection of Ruby Quizzes, right?
Yes, this is my book. Best of Ruby Quiz. I've really been pouring
all my effort into this for almost a year now, so I'm really hoping
you guys will like it. I've added content and code, talked about
more solutions, and even completely rewrote some of my summaries. If
you like following the quiz, the book is that and more, I think.
I've also contributed recipes to the Ruby Cookbook. See recent
thread here for details.
James Edward Gray II
sean.to_i #=> 76
And I can't claim your excuse! :)
Sean
> The LOC was more or less a guess.
Ditto. My wife was reading over my shoulder when I took the test and
she said I way under bid too... <shrugs>
James Edward Gray II
I also filled it out for Minero Aoki, as a kind of fantasy quest. And
that really got me excited about starting an RPG based around the
premise of being Minero Aoki. Or maybe just a flight simulator.
_why
> I also filled it out for Minero Aoki, as a kind of fantasy quest.
> And that really got me excited about starting an RPG based around
> the premise of being Minero Aoki. Or maybe just a flight simulator.
<dies laughing>
James Edward Gray II
-why, I think in your case a couple of questions should be added:
* Have you ever sung humorous, Ruby-related songs of your own
composition in front of a Ruby meeting?
(+ 50 points)
* Have you written a poignant guide to anything?
(+ 75 points)
Oh, and if you do write an RPG based around the premise of being Minero
Aoki that should be good for at least 50 points.
Phil
... don't ask what my Ruby number is ...
Well I got a 23, which is good because that's my age and I only
started goofing around with ruby about a year ago.
That's a cool idea, too. Go ahead and implement code
to determine it. ;)
Hmm, how many of you have had Matz in your car? :D
Myself, Eric, some others...
Cheers,
Hal
Hmm ... I've had Larry Wall in mine ... does that give me a negative number?
--
-- Jim Weirich j...@weirichhouse.org http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
Does a rental count?
--
Jim Freeze
62 here...
Zach
In message "Re: What's your Ruby Number? (self.to_i)"
on Wed, 26 Oct 2005 08:18:23 +0900, Jim Freeze <j...@freeze.org> writes:
|> Hmm, how many of you have had Matz in your car? :D
|> Myself, Eric, some others...
|Does a rental count?
Where was rental Matz available? I'd rather have one.
matz.
Sure, why not. And you should get a point for having a last
name that is in the core.
Hal
Nahh. Larry's OK. Better to have a Wall in your car
than a car in your wall.
Hal
That is the first time in weeks I have *literally* laughed
out loud at a posting. Thanks, Matz. :)
And if you could be rented, we all would be renting you,
if we could afford it...
Hal
We doubled our number of core-method-named people at RubyConf this
year, thanks to the presence of Adam Keys as well as Jim Freeze.
I'm still holding out for Matt Tainted? or Joe Instance_variable_get.
And if anyone legally changes his or her last name to a core method,
he or she will be admitted free of charge.
Don't forget class names. Shashank Date would hate to be left out.
Pronunciation isn't relevant here.
Hal
class Object
def fulton
"Free admission!"
end
end
Whew... I was thinking I must've _way_ underestimated my LOC!
irb(main):002:0> nathaniel.to_i
=> 122
Speaking at every RubyConf helped :-)
--
Nathaniel Talbott
<:((><
> We doubled our number of core-method-named people at RubyConf this
> year, thanks to the presence of Adam Keys as well as Jim Freeze.
>
> I'm still holding out for Matt Tainted? or Joe Instance_variable_get.
> And if anyone legally changes his or her last name to a core method,
> he or she will be admitted free of charge.
Well, there are those who would agreed that "Tainted?" might be a good
description of yours truly...
-- Matt
Nothing great was ever accomplished without _passion_
--
"Nothing will ever be attempted, if all
possible objections must first be
overcome." - Samuel Johnson
Isn't a fulton method the opposite of a singleton?
-Ezra Zygmuntowicz
WebMaster
Yakima Herald-Republic Newspaper
ez...@yakima-herald.com
509-577-7732
Yeah, but #freeze belongs to the top class, Object.
Only way to beat that is to be in Kernel. Know anyone
named 'puts' or 'fail'? :)
--
Jim Freeze
Hopefully we will never have a method called zygmuntowicz ;-)
That's it. I'm legally changing my name to <=>.
Sincerely, Mr. Spaceship.
--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
But I thought =~ was pronounced "zygmuntowicz"!
> >
> > Hopefully we will never have a method called zygmuntowicz ;-)
>
> But I thought =~ was pronounced "zygmuntowicz"!
>
And here I was thinking it was the chosen pronunciation for the future ** as in
**keys ;) .
--
Christophe Grandsire (to_i = 14 . That's what happens when you are a true
newbie, don't have time to code, and cannot attend conferences :( ).
http://rainbow.conlang.free.fr
It takes a straight mind to create a twisted conlang.
On Wed, 26 Oct 2005, Joel VanderWerf wrote:
> Jim Freeze wrote:
>> On 10/25/05, David A. Black <dbl...@wobblini.net> wrote:
>>
>>>
>>> On Wed, 26 Oct 2005, Hal Fulton wrote:
>>>
>>>> Sure, why not. And you should get a point for having a last
>>>> name that is in the core.
>>>
>>> We doubled our number of core-method-named people at RubyConf this
>>> year, thanks to the presence of Adam Keys as well as Jim Freeze.
>>
>>
>>
>> Yeah, but #freeze belongs to the top class, Object.
>> Only way to beat that is to be in Kernel. Know anyone
>> named 'puts' or 'fail'? :)
>
> That's it. I'm legally changing my name to <=>.
>
> Sincerely, Mr. Spaceship.
The operator formerly known as Joel....
> We doubled our number of core-method-named people at RubyConf this
> year, thanks to the presence of Adam Keys as well as Jim Freeze.
>
> I'm still holding out for Matt Tainted? or Joe Instance_variable_get.
> And if anyone legally changes his or her last name to a core method,
> he or she will be admitted free of charge.
>
>
> David
>
mh.. what about second names? I am quite sure there is some joe p. smith
Hm. I may have overestimated my LOC, but I got:
austin.to_i # => 120
-austin
--
Austin Ziegler * halos...@gmail.com
* Alternate: aus...@halostatue.ca
kaspar.to_i # => 93
whatever, neat the tool.
--
code manufacture & ruby lab at http://www.tua.ch/ruby
At least my symbol is pronounceable.
-- A Prince among programmers.
An idea that is not dangerous is unworthy of being called an idea at
all. -- Oscar Wilde
Just don't compile your car with -Wall
martin
> Jim Freeze wrote:
>> On 10/25/05, David A. Black <dbl...@wobblini.net> wrote:
>>
>>>
>>>On Wed, 26 Oct 2005, Hal Fulton wrote:
>>>
>>>>Sure, why not. And you should get a point for having a last
>>>>name that is in the core.
>>>
>>>We doubled our number of core-method-named people at RubyConf this
>>>year, thanks to the presence of Adam Keys as well as Jim Freeze.
>>
>>
>>
>> Yeah, but #freeze belongs to the top class, Object.
>> Only way to beat that is to be in Kernel. Know anyone
>> named 'puts' or 'fail'? :)
>
> That's it. I'm legally changing my name to <=>.
>
> Sincerely, Mr. Spaceship.
I wanna be flip-flop then! Don't deprecate me.
> vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
--
Christian Neukirchen <chneuk...@gmail.com> http://chneukirchen.org
If you spell that ".." or "...", people might get the pronunciation confused
with "range operator" or "to" for short.
Cheers,
Dave
*
Anyhow I got a 67, which isn't bad considering the 2-3 years I was out
of the community. My participation in RubyConf 2001 helped my score
considerably (since I had the t-shirts made I consider myself an
organizer.)
Also I'm trying to remember who I drove in my car back at RubyConf
2001. I'm not sure if matz was in that group, but I remember the car
was full (myself and 4 others.) Anyone remember being driven in a blue
Lexus IS300 by me back at RubyConf 2001?
Anyhow, thanks for this Hal, it was very interesting, and like James
said it makes a nice "things I should be doing in the Ruby community"
list.
Ryan
2005/10/29, Ryan Leavengood <leave...@gmail.com>:
There are enough hits on "Mr Rand" and "Mr Trap" on google :)
And "Mr Loop" is there, too.
+--- Kero ------------------------- kero@chello@nl ---+
| all the meaningless and empty words I spoke |
| Promises -- The Cranberries |
+--- M38c --- http://members.chello.nl/k.vangelder ---+
Good fodder for action/adventure hero names:
Trap Randloop
Rand Traploop
Loop Randtrap
and so on.
James
--
http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys
Heh: I beat Matz!!!
It helps to be giving 2-4 Ruby talks/week :)
Somehow I imagine you are the only person in RubyDom to beat matz, and
in fact I bet your number is greater than 1000, eh?
I hate you.
Jealously yours,
Ryan
;)
- Dimitri (who got a 37)
I have a feeling that Robert will be unhappy until this
contains a couple of injects.
puts [
[ "\nFirst, three background geek questions:" ],
[ "\nHow many degrees in computer science do you have?",
:i, 4 ],
[ "In what year did your write your FIRST program in any language?",
:y, [4] ],
[ "How many years have you worked in a software-related job?",
:i, [4] ],
[ "\n----------------------" ],
[ "And now the Ruby stuff:" ],
[ "\nIn what year did you start using Ruby?",
:y, 2 ],
[ "In what year did you start reading the list or newsgroup?",
:y, 4 ],
[ "How many (non-vaporware) entries do you have in RAA and/or
Rubyforge?",
:i ],
[ "How many Ruby conferences have you assisted in organizing? (US or
other)",
:i, 6 ],
[ "Have you assisted in forming a local user's group?",
:YN, 2 ],
[ "At how many Ruby conferences have you made presentations?",
:i, 6 ],
[ "How many Ruby conferences have you attended?",
:i, 4 ],
[ "Now, some book questions." ],
[ "Translations and newer editions count separately..." ],
[ "\nHow many Ruby books list you as an author?",
:i, 6 ],
[ "How many (other) Ruby books have you contributed to?",
:i, 4 ],
[ "How many (other) Ruby books mention your name?",
:i, 2 ],
[ "How many unique Ruby books do you own?",
:i ],
[ "Do you own a domain name (with content) including the word
'ruby'?",
:YN, 2 ],
[ "Approximately how many packages of yours are now in the core or
stdlib?",
:i ],
[ "Is your name Yukihiro Matsumoto?",
:YN, 10 ],
[ "Is your name Dave Thomas or Guy Decoux?",
:YN, 6 ],
[ "Is your name: Nobu Nokada, Shugo Maeda, or Minero Aoki?",
:YN, 4 ],
[ "Do you know any Japanese?",
:YN, 2 ],
[ "Is Japanese your first language?",
:YN, 3 ],
[ "Have you ever written Ruby for pay?",
:YN, 10 ],
[ "Estimate your total lines of Ruby code written.",
:i, [5_000] ],
[ "How many Ruby presentations have you made (outside RubyConf)?",
:i, 4 ],
[ "How many of your Ruby packages have been downloaded >500 times?",
:i, 3 ],
[ "Ever had an RCR accepted?",
:YN, 5 ],
[ "That's all... your Ruby Geek status is measured at" ]
].inject(0){ |sum,question|
puts question.shift
points =
question.inject(0){ |num,x|
case
when :i == x
gets.to_i
when :YN == x
(gets =~ /^y/i) ? 1 : 0
when :y == x
num = gets.to_i
num += (num<20) ? 2000 : 1900 if num < 100
Time.now.year - num
when x.respond_to?(:pop)
( num / x.first.to_f ).ceil
when x.respond_to?(:/)
num * x
else
raise "\n\n\aBad item: #{ x.inspect }\n\n"
end
}
puts " #{points} points (#{sum+points} total)\n\n" if
question.size > 1
sum + points
}