﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-rox-随笔分类-Ruby</title><link>http://www.blogjava.net/rox/category/14650.html</link><description /><language>zh-cn</language><lastBuildDate>Wed, 28 Feb 2007 06:49:15 GMT</lastBuildDate><pubDate>Wed, 28 Feb 2007 06:49:15 GMT</pubDate><ttl>60</ttl><item><title>为什么Ruby on Rails不能成为主流</title><link>http://www.blogjava.net/rox/archive/2006/04/10/40184.html</link><dc:creator>rox</dc:creator><author>rox</author><pubDate>Mon, 10 Apr 2006 02:48:00 GMT</pubDate><guid>http://www.blogjava.net/rox/archive/2006/04/10/40184.html</guid><wfw:comment>http://www.blogjava.net/rox/comments/40184.html</wfw:comment><comments>http://www.blogjava.net/rox/archive/2006/04/10/40184.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/rox/comments/commentRss/40184.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/rox/services/trackbacks/40184.html</trackback:ping><description><![CDATA[
		<a title="desired" href="http://digg.com/technology/Why_Ruby_on_Rails_won_t_become_mainstream">desired</a>在digg里写道，这里是<a title="一篇有趣的文章" href="http://beust.com/weblog/archives/000382.html">一篇有趣的文章</a>，
详细的讨论了为什么Ruby on
Rails有那么多的优点却始终难以战胜Java或者ASP.net成为网络应用程序设计的主流语言。不过作者自己本身很喜欢Ruby on
Rails，所以他虽然写了这篇文章，却丝毫不影响他对于Ruby on Rails最后定能成功地信心。<img src ="http://www.blogjava.net/rox/aggbug/40184.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/rox/" target="_blank">rox</a> 2006-04-10 10:48 <a href="http://www.blogjava.net/rox/archive/2006/04/10/40184.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>达人常去的Ruby相关网站</title><link>http://www.blogjava.net/rox/archive/2006/03/31/38545.html</link><dc:creator>rox</dc:creator><author>rox</author><pubDate>Fri, 31 Mar 2006 12:36:00 GMT</pubDate><guid>http://www.blogjava.net/rox/archive/2006/03/31/38545.html</guid><wfw:comment>http://www.blogjava.net/rox/comments/38545.html</wfw:comment><comments>http://www.blogjava.net/rox/archive/2006/03/31/38545.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/rox/comments/commentRss/38545.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/rox/services/trackbacks/38545.html</trackback:ping><description><![CDATA[
		<a target="_blank" class="" title="达人常去的Ruby相关网站" href="http://board.ruby-cn.org/viewtopic.php/p/476#476">转载</a>
		<br />
		<br />
		<br />
		<span class="postbody">当然是Ruby相关的。
<br />
比如我常去：
<br /><a href="http://groups.google.com/group/comp.lang.ruby?hl=zh-CN&amp;lr=&amp;newwindow=1" target="_blank">http://groups.google.com/group/comp.lang.ruby?hl=zh-CN&amp;lr=&amp;newwindow=1</a><br /><a href="http://eigenclass.org/hiki.rb?WEBlog%3A%3ARuby" target="_blank">http://eigenclass.org/hiki.rb?WEBlog%3A%3ARuby</a><br /><a href="http://redhanded.hobix.com/" target="_blank">http://redhanded.hobix.com/</a><br /><a href="http://jimweirich.umlcoop.net/index.cgi" target="_blank">http://jimweirich.umlcoop.net/index.cgi</a><br /><br /></span>
		<span class="postbody">
				<a href="http://wiki.rubyonrails.org/" target="_blank">http://wiki.rubyonrails.org</a>
				<br />
				<br />
				<a href="http://www.railscn.com/" target="_blank">http://www.railscn.com</a>
				<br />
				<br />
				<a href="http://chinaonrails.com/frontpage" target="_blank">http://chinaonrails.com/frontpage</a>
				<br />
				<br />
				<a href="http://ror.uuclubs.com/" target="_blank">http://ror.uuclubs.com</a>
				<br />
				<br />
				<a href="http://www.ruby-forum.com/" target="_blank">http://www.ruby-forum.com/</a>
		</span>
		<span class="postbody">
				<br />
		</span>
		<br />
<img src ="http://www.blogjava.net/rox/aggbug/38545.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/rox/" target="_blank">rox</a> 2006-03-31 20:36 <a href="http://www.blogjava.net/rox/archive/2006/03/31/38545.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Ruby</title><link>http://www.blogjava.net/rox/archive/2006/03/25/37416.html</link><dc:creator>rox</dc:creator><author>rox</author><pubDate>Sat, 25 Mar 2006 15:51:00 GMT</pubDate><guid>http://www.blogjava.net/rox/archive/2006/03/25/37416.html</guid><wfw:comment>http://www.blogjava.net/rox/comments/37416.html</wfw:comment><comments>http://www.blogjava.net/rox/archive/2006/03/25/37416.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/rox/comments/commentRss/37416.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/rox/services/trackbacks/37416.html</trackback:ping><description><![CDATA[http://www.ruby-lang.org/<br /><br /><a target="_blank" class="" title="这里有第一版的部分中文翻译" href="http://www.ruby-cn.org/book/ProgrammingRuby/index.html">这里有第一版的部分中文翻译</a><br />下载最新版本的Ruby，安装之后就有一个快捷指向ProgrammingRuby.chm，<br />很不错的书，已经有了2005年的2nd版本，可以到<a target="_blank" class="" title="Programming Ruby, 2nd ed, 2005.rar" href="http://www.box.net/public/4n20ev6hy0">这里下载</a>。（顺便做个广告<a href="http://www.box.net/signup/invitation/roxsenall@hotmail.com"><img src="http://www.box.net/img/refer_blue_big.gif" /></a>）<br />按照上面的例子，建立两个文件，<br /><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 128, 128);"> test.rb</span></div><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 128, 128);"> 1</span> <span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> Song<br /></span><span style="color: rgb(0, 128, 128);"> 2</span> <span style="color: rgb(0, 0, 0);">  </span><span style="color: rgb(0, 0, 255);">def</span><span style="color: rgb(0, 0, 0);"> initialize(name, artist, duration)<br /></span><span style="color: rgb(0, 128, 128);"> 3</span> <span style="color: rgb(0, 0, 0);">    @name     </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> name<br /></span><span style="color: rgb(0, 128, 128);"> 4</span> <span style="color: rgb(0, 0, 0);">    @artist   </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> artist<br /></span><span style="color: rgb(0, 128, 128);"> 5</span> <span style="color: rgb(0, 0, 0);">    @duration </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> duration<br /></span><span style="color: rgb(0, 128, 128);"> 6</span> <span style="color: rgb(0, 0, 0);">  end<br /></span><span style="color: rgb(0, 128, 128);"> 7</span> <span style="color: rgb(0, 0, 0);">  </span><span style="color: rgb(0, 0, 255);">def</span><span style="color: rgb(0, 0, 0);"> to_s  <br /></span><span style="color: rgb(0, 128, 128);"> 8</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">Song: #{@name}--#{@artist} (#{@duration})</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">  <br /></span><span style="color: rgb(0, 128, 128);"> 9</span> <span style="color: rgb(0, 0, 0);">  end  <br /></span><span style="color: rgb(0, 128, 128);">10</span> <span style="color: rgb(0, 0, 0);">end<br /></span><span style="color: rgb(0, 128, 128);">11</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">12</span> <span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> Song<br /></span><span style="color: rgb(0, 128, 128);">13</span> <span style="color: rgb(0, 0, 0);">  attr_reader :name, :artist, :duration <br /></span><span style="color: rgb(0, 128, 128);">14</span> <span style="color: rgb(0, 0, 0);">end<br /></span><span style="color: rgb(0, 128, 128);">15</span> <span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 128, 128);">16</span> <span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> KaraokeSong </span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);"> Song<br /></span><span style="color: rgb(0, 128, 128);">17</span> <span style="color: rgb(0, 0, 0);">  attr_reader :lyrics<br /></span><span style="color: rgb(0, 128, 128);">18</span> <span style="color: rgb(0, 0, 0);">  </span><span style="color: rgb(0, 0, 255);">def</span><span style="color: rgb(0, 0, 0);"> initialize(name, artist, duration, lyrics)<br /></span><span style="color: rgb(0, 128, 128);">19</span> <span style="color: rgb(0, 0, 0);">    super(name, artist, duration)<br /></span><span style="color: rgb(0, 128, 128);">20</span> <span style="color: rgb(0, 0, 0);">    @lyrics </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> lyrics<br /></span><span style="color: rgb(0, 128, 128);">21</span> <span style="color: rgb(0, 0, 0);">  end<br /></span><span style="color: rgb(0, 128, 128);">22</span> <span style="color: rgb(0, 0, 0);">  </span><span style="color: rgb(0, 0, 255);">def</span><span style="color: rgb(0, 0, 0);"> to_s  <br /></span><span style="color: rgb(0, 128, 128);">23</span> <span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">Karaoke</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> super </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 0, 0);">\nlyrics: #{@lyrics}</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">  <br /></span><span style="color: rgb(0, 128, 128);">24</span> <span style="color: rgb(0, 0, 0);">  end<br /></span><span style="color: rgb(0, 128, 128);">25</span> <span style="color: rgb(0, 0, 0);">end</span></div><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 128, 128);">test2.rb</span><span style="color: rgb(0, 0, 0);"></span></div><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 128, 128);">1</span> <span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> Song<br /></span><span style="color: rgb(0, 128, 128);">2</span> <span style="color: rgb(0, 0, 0);">  attr_writer :name, :artist, :duration <br /></span><span style="color: rgb(0, 128, 128);">3</span> <span style="color: rgb(0, 0, 0);">end</span></div><br />然后在控制台下输入：<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 128, 128);"> 1</span> <span style="color: rgb(128, 0, 0);">C:\&gt;ruby<br /></span><span style="color: rgb(0, 128, 128);"> 2</span> <span style="color: rgb(128, 0, 0);">load "d:/ruby/mycode/test.rb"<br /></span><span style="color: rgb(0, 128, 128);"> 3</span> <span style="color: rgb(128, 0, 0);">load "d:/ruby/mycode/test2.rb"<br /></span><span style="color: rgb(0, 128, 128);"> 4</span> <span style="color: rgb(128, 0, 0);">song = Song.new("Bicylops", "Fleck", 260)<br /></span><span style="color: rgb(0, 128, 128);"> 5</span> <span style="color: rgb(128, 0, 0);">puts song.inspect<br /></span><span style="color: rgb(0, 128, 128);"> 6</span> <span style="color: rgb(128, 0, 0);">puts song.to_s<br /></span><span style="color: rgb(0, 128, 128);"> 7</span> <span style="color: rgb(128, 0, 0);">song.name="Groovy"<br /></span><span style="color: rgb(0, 128, 128);"> 8</span> <span style="color: rgb(128, 0, 0);">song.artist="Java"<br /></span><span style="color: rgb(0, 128, 128);"> 9</span> <span style="color: rgb(128, 0, 0);">song.duration=15<br /></span><span style="color: rgb(0, 128, 128);">10</span> <span style="color: rgb(128, 0, 0);">puts song.inspect<br /></span><span style="color: rgb(0, 128, 128);">11</span> <span style="color: rgb(128, 0, 0);">puts song.to_s<br /></span><span style="color: rgb(0, 128, 128);">12</span> <span style="color: rgb(128, 0, 0);">^D<br /></span><span style="color: rgb(0, 128, 128);">13</span> <span style="color: rgb(128, 0, 0);">#&lt;Song:0x28366e0 @name="Bicylops", @duration=260, @artist="Fleck"&gt;<br /></span><span style="color: rgb(0, 128, 128);">14</span> <span style="color: rgb(128, 0, 0);">Song: Bicylops--Fleck (260)<br /></span><span style="color: rgb(0, 128, 128);">15</span> <span style="color: rgb(128, 0, 0);">#&lt;Song:0x28366e0 @name="Groovy", @duration=15, @artist="Java"&gt;<br /></span><span style="color: rgb(0, 128, 128);">16</span> <span style="color: rgb(128, 0, 0);">Song: Groovy--Java (15)</span></div><font color="#ff0000">注：这里的^D是Ctrl+D<br /></font><br />这段代码，给我们什么启发呢？<br /><img src ="http://www.blogjava.net/rox/aggbug/37416.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/rox/" target="_blank">rox</a> 2006-03-25 23:51 <a href="http://www.blogjava.net/rox/archive/2006/03/25/37416.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>