http://wtf.hijacked.us/wiki/index.php?title=Ruby_1.9&feed=atom&action=historyRuby 1.9 - Revision history2024-03-28T21:55:32ZRevision history for this page on the wikiMediaWiki 1.35.0http://wtf.hijacked.us/wiki/index.php?title=Ruby_1.9&diff=611&oldid=prevJontow: 1 revision2013-01-05T02:48:26Z<p>1 revision</p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 02:48, 5 January 2013</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>Jontowhttp://wtf.hijacked.us/wiki/index.php?title=Ruby_1.9&diff=610&oldid=prevAndrew: Add some documentation on ruby 1.92008-01-01T20:45:52Z<p>Add some documentation on ruby 1.9</p>
<p><b>New page</b></p><div>On christmas 2007 ruby 1.9.0.0 was released. It's intended to be a developer's release to allow people to transition their libraries/code to the 1.9 changes. The planned release schedule for 1.9 is to release updates to 1.9.0 every month, numbered like 1.9.0.x and then sometime in early 2008 (Aprilish?) to make a 1.9.1 release which should be production grade.<br />
<br />
This page is just a repository of information I've gleaned from playing with 1.9...<br />
<br />
== Compiling ==<br />
I '''HIGHLY''' recommend you configure with --prefix=/opt/ruby19 or --program-suffix=19 (or some variation on this theme). Ruby 1.9 is NOT ready for being the default ruby runtime on any machine.<br />
<br />
=== FreeBSD ===<br />
Tested on i386.<br />
Note: the -O2 optimization [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/14520 causes issues on FreeBSD]<br />
<br />
./configure --with-X11-dir=/usr/local --with-tcl-include=/usr/local/include/tcl8.4 --with-tk-include=/usr/local/include/tk8.4 CFLAGS="-g"<br />
=== IRIX ===<br />
<br />
Needs >= 1.9.0.1 or [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/14447 my patch]. You might not need --enable-wide-getaddrinfo if you're not using IPv6. Your tk/readline paths will be different if you're not using pkgsrc like I am.<br />
<br />
./configure --enable-wide-getaddrinfo --with-X11-dir=/usr/lib/X11 --with-tk-dir=/usr/pkg --with-readline-dir=/usr/pkg<br />
<br />
=== OpenBSD ===<br />
Tested on sparc64.<br />
Works out of the box.<br />
<br />
=== NetBSD ===<br />
Tested on i386, Alpha.<br />
Works out of the box.<br />
<br />
== Making ruby/tk work on 1.9 ==<br />
Ruby/tk looks like it hasn't been entirely updated for 1.9 yet so there's a couple niggles that need patching.<br />
<br />
Basically I removed all references to Thread.critical in lib/ruby/1.9.0/tk.rb and I replaced the def TkRoot.new(..) and def TkRoot.destroy(...) with def self.(new|destroy) in lib/ruby/1.9.0/tk/root.rb. That has resolved the issues I've encountered thus far.<br />
<br />
== Changes that have broken my code ==<br />
<br />
=== Format of 'caller' ===<br />
ruby -ve 'def foo; puts caller; end; proc{foo}.call'<br />
<br />
ruby 1.8.6 (2007-03-13 patchlevel 0) [mips-irix6.5]<br />
-e:1<br />
-e:1:in `call'<br />
-e:1<br />
<br />
ruby 1.9.0 (2007-12-25 revision 14709) [mips-irix6.5]<br />
-e:1:in `block in <main>'<br />
-e:1:in `call'<br />
-e:1:in `<main>'<br />
<br />
This only broke stuff because I have an awful piece of code that parses the callstack to get a filename out. The main thing to note is that extra : and the accounting for <main> and blocks.<br />
<br />
=== Object#instance_variables returns array of symbols not strings ===<br />
ruby -ve '@foo=1;@bar=2;p self.instance_variables'<br />
<br />
ruby 1.8.6 (2007-03-13 patchlevel 0) [mips-irix6.5]<br />
["@foo", "@bar"]<br />
<br />
ruby 1.9.0 (2007-12-25 revision 14709) [mips-irix6.5]<br />
[:@foo, :@bar]<br />
<br />
This is an excellent change, but it will break any code that assumes an array of strings should be returned.<br />
<br />
== See Also ==<br />
<br />
* [http://eigenclass.org/hiki/Changes+in+Ruby+1.9 Changes in 1.9] - Slightly dated, will be replaced with a newer, automatically generated one soon, apparently.</div>Andrew