Skip to content

Instantly share code, notes, and snippets.

View vertiginous's full-sized avatar

Gordon Thiesfeld vertiginous

View GitHub Profile
require 'rubygems'
require 'spec'
# Here is the problem, I want to replace statements like this:
#
# puts (OddRecognizer.new.knows?(1) or OddRecognizer.new.knows?(3)) ? "there are odds" : "there is no odd"
#
# With this syntax:
# puts OddRecognizer.new.knows?(1).or?(3) ? "there are odds" : "there is no odd"
#
@vertiginous
vertiginous / gist:5665
Created August 15, 2008 22:05
An alternative api
require 'rubygems'
require 'spec'
# Here is the problem, I want to replace statements like this:
#
# puts (EvenRecognizer.new.knows?(1) or EvenRecognizer.new.knows?(3)) ? "there are odds" : "there is no odd"
#
# With this syntax:
# puts EvenRecognizer.new.knows?(1).or?(3) ? "there are odds" : "there is no odd"
#
C:\>tree -d -L 1 c:\ruby
c:\ruby
|-- 185-p012-mswin32
|-- 186-p287-mswin32
|-- 186-p368-mingw32
|-- 191-p000-mingw32
|-- 191-p191-mingw32
`-- devkit
6 directories
[ ] Installer
[ ] Write better README than one in repository. State virtues and limitations
[ ] Include Ruby License during License agreement screen
[ ] Display History.txt (extract) on installation completion
[*] Bugfixes for rb-readline (Luis)
[ ] Documentation
[*] Generate CHM files for Core and Standard Library (Gordon Thiesfeld)
[*] Finish Rdoc_CHM 2.4.0, and release gem on Rubyforge
[X] Add a main page to the main CHM file
[ ] Installer
[ ] Write better README than one in repository. State virtues and limitations
[X] Include Ruby License during License agreement screen
[X] Display History.txt (extract) on installation completion
[*] Bugfixes for rb-readline (Luis)
[ ] Documentation
[*] Generate CHM files for Core and Standard Library (Gordon Thiesfeld)
[X] Finish Rdoc_CHM 2.4.0, and release gem on Rubyforge
[X] Add a main page to the main CHM file
C:\scripts\repo\pik>ntimer pik.bat 186 ms
Using ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
ContextSwitches - 4628
First level fills = 0
Second level fills = 0
ETime( 0:00:00.312 ) UTime( 0:00:00.015 ) KTime( 0:00:00.015 )
ITime( 0:00:00.250 )
>pik ls -r
---
IronRuby:
0.3.0: http://rubyforge.org/frs/download.php/53552/ironruby-0.3.0.zip
0.5.0: http://rubyforge.org/frs/download.php/57126/ironruby-0.5.0.zip
0.6.0: http://rubyforge.org/frs/download.php/59717/ironruby-0.6.0.zip
0.9.0: http://rubyforge.org/frs/download.php/61382/ironruby-0.9.0.zip
0.9.1: http://rubyforge.org/frs/download.php/64504/ironruby-0.9.1.zip
0.9.2: http://rubyforge.org/frs/download.php/66606/ironruby-0.9.2.zip
JRuby:
>pik run which --all pik.bat
IronRuby 0.9.0.0 on .NET 2.0.0.0
c:\bin\pik.bat
IronRuby 0.9.1.0 on .NET 2.0.0.0
c:\bin\pik.bat
IronRuby 0.9.2.0 on .NET 2.0.0.0
c:\bin\pik.bat
ENV['GEM_HOME'] = nil
ENV['GEM_PATH'] = nil
REAL_HOME = ENV['HOME']
ENV['HOME'] = "nul"
require 'rubygems'
ENV['HOME'] = REAL_HOME
>pik ruby -e "puts 'hello world'"
IronRuby 0.9.1.0 on .NET 2.0.0.0
hello world
IronRuby 0.9.2.0 on .NET 2.0.0.0
hello world
jruby 1.3.1 (ruby 1.8.6p287) (2009-06-15 2fd6c3d) (Java HotSpot(TM) Client VM 1.6.0_14) [x86-java]