??xml version="1.0" encoding="utf-8" standalone="yes"?>美女做暖暖视频免费在线观看全部网址91,日韩av在线一区二区,欧美12一14sex性hdhttp://www.aygfsteel.com/leekiang/category/30625.htmlMDA/MDD/TDD/DDD/DDDDDDDzh-cnSat, 27 Aug 2011 03:03:40 GMTSat, 27 Aug 2011 03:03:40 GMT60rmagickhttp://www.aygfsteel.com/leekiang/archive/2010/05/17/321125.htmlleekiangleekiangSun, 16 May 2010 19:12:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/05/17/321125.htmlhttp://www.aygfsteel.com/leekiang/comments/321125.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/05/17/321125.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/321125.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/321125.html在windows上直接gem安装rmagick时报Building native extensions.   Error installing rmagick windows

1 ?a target="_blank">http://rubyforge.org/projects/rmagick/ 下蝲rmagick-win32 对应的zip?没找到ruby1.8.7?.9的,只好先下1.8.6?/div>
2 解压zipC个时目录,在该目录中有一个ImageMagick的ext安装文g,安装?/div>
3 开一个命令行H口Qcd到解压的临时目录Q敲入命令: gem install rmagick.
4.?span id="ctl00_MainContentPlaceholder_ctl01_ctl00_lblEntry">ImageMagick 的安装\径放到path环境变量里面

可能出现的问题:
1.CORE_RL_magick_.dll找不刎ͼ
?span id="ctl00_MainContentPlaceholder_ctl01_ctl00_lblEntry">ImageMagick 的安装\径放到path环境变量里面dOK了?/div>
2.gem install rmagick p|
更新gem? 版本Q?gem update --system)

参考http://wxmfly.javaeye.com/blog/216787


leekiang 2010-05-17 03:12 发表评论
]]>rubyW记http://www.aygfsteel.com/leekiang/archive/2010/03/17/315647.htmlleekiangleekiangTue, 16 Mar 2010 16:53:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/03/17/315647.htmlhttp://www.aygfsteel.com/leekiang/comments/315647.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/03/17/315647.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/315647.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/315647.htmlarr = [1,2,3,4]
puts arr.find{|i| i%2 == 0 }   #findq回满条g的第一条记?br />puts arr.select{|i| i%2 == 0}  #selectq回满条g的全部记?br />arr.unshift(0)                 在头部添?br />arr.push(5,6)                  在尾部添?br />arr<<7                         与push的不同在于push可以攑֤?br />arr.sort.reverse               先排序再倒置Q即降序


leekiang 2010-03-17 00:53 发表评论
]]>
rcovhttp://www.aygfsteel.com/leekiang/archive/2010/03/06/314686.htmlleekiangleekiangSat, 06 Mar 2010 05:00:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/03/06/314686.htmlhttp://www.aygfsteel.com/leekiang/comments/314686.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/03/06/314686.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/314686.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/314686.html安装之前必须先安装DevKitQhttp://github.com/oneclick/rubyinstaller/wiki/Development-Kit里有详细的安装步?br />主要步骤:
1)下蝲DevKit解压到c:\DevKit目录Q下载地址为http://rubyinstaller.org/downloads/
2)C:\DevKit>ruby dk.rb init
3)C:\DevKit>ruby dk.rb install
4)C:\DevKit>gem install rdiscount --platform=ruby 我觉得这一步只是验证DevKit是否安装成功Q也可以不做的?br />5)最好把c:\DevKit\bin加到环境变量

2,rcov test/functional/*.rb test/unit/*.rb --output=public/rcov --rails
会生成一大堆反映试覆盖情况的网|到public/rcov目录下,如果不写--outputQ则q些|页会放到项目下新徏的coverage目录?br />
3,在项目下执行rake stats可看C码统计,以及代码和测试代码的比例?br />
4,在netbeans6.9里开始怎么也显CZ了覆盖率报告Q后来打开一个模型类Q点L行测试,然后有了?br />而且可以昄每一行代码是否被试?看了几个cȝ覆盖情况Q感觉有的方法里的代码明明被了Q但囑Ş里显C没有测到?br />http://blogs.sun.com/tor/entry/netbeans_screenshot_of_the_week6后面的评论里有h写了他是如何做的?br />
http://www.jairrillo.com/blog/2008/08/18/introduction-to-rspec-part-2-testing-the-rails-model/
http://eigenclass.org/hiki.rb?rcov#l2
http://stackoverflow.com/questions/3451346/cannot-install-rcov-from-gem

leekiang 2010-03-06 13:00 发表评论
]]>
rails中的RESThttp://www.aygfsteel.com/leekiang/archive/2010/02/21/313489.htmlleekiangleekiangSat, 20 Feb 2010 18:53:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/02/21/313489.htmlhttp://www.aygfsteel.com/leekiang/comments/313489.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/21/313489.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/313489.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/313489.html

leekiang 2010-02-21 02:53 发表评论
]]>
ruby解析htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/20/313478.htmlleekiangleekiangSat, 20 Feb 2010 10:14:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/02/20/313478.htmlhttp://www.aygfsteel.com/leekiang/comments/313478.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/20/313478.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/313478.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/313478.htmlC:\Ruby1.8.7\lib\ruby\1.8\open-uri.rb

require 'open-uri'
open(
'c:/boot.ini'){|file|
  puts file.
class  #File
}
open(
'http://coderlee.cnblogs.com'){|file|
  puts file.
class  #Tempfile
}
可以看出Q打开一个本机文件的块参数是FilecdQ而打开一个uri的块参数是一个Tempfilecd。还有一点要注意Q就是open-uri里面的openҎ会自动对302 redirection重定向地址q行q踪讉KQ而Net::HTTP#getҎ则不会自动追t?02重定向地址?摘自q里)

require 'nokogiri'
require 
'open-uri'
doc = Nokogiri::HTML(open('http://www.huomo.cn'))
doc.search(
"//h2/a").each do |link|
  puts link.inner_text
  puts link[:href]
end

url = 'http://www.google.cn/search?hl=zh-CN&q=%BC%D6%B1%A6%D3%F1'
doc 
= Nokogiri::HTML.parse(open(url), nil, 'gb2312')#不这样写会有q

doc.css(
'h3.r a.l').each do |link|
  puts link.inner_text
end

doc.xpath(
'//h3/a[@class="l"]').each do |link|
  puts link.content
end

doc.search(
'h3.r a.l''//h3/a[@class="l"]').each do |link|
  puts link.content
end

参考http://www.javaeye.com/topic/557485



leekiang 2010-02-20 18:14 发表评论
]]>
rails处理长执行时间的hhttp://www.aygfsteel.com/leekiang/archive/2010/02/20/313430.htmlleekiangleekiangFri, 19 Feb 2010 20:42:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/02/20/313430.htmlhttp://www.aygfsteel.com/leekiang/comments/313430.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/20/313430.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/313430.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/313430.html
q个问题是在人机界面斚w很普遍,而且也有一个普遍的解决Ҏ -- 把Q务交l一个背景运行的q程或线E。Q何开发过桌面应用的h都会觉得很熟悉。但是有时候如果开发者把切换和通信做得不好Q也会碰到麻烦?br />
一个我觉得较好的办法,而幸好我的ThoughtWorks同事们也同意Q就是用一个actor。在q个模型里,webh的handler把需旉的请求包装ؓ一个命令(commandQ,然后放进队列QqueueQ内。在背景q行的actorq察着q个queueQ从queue中提出ƈ且执行这个命令。当它把q个命o执行完了Q就通知前台界面的actor。通常q个queue一开始会是数据库的一个表Q之后如有需要的话,再把它改Z个消息队列(message queueQ?br />
和ActiveRecord的漏z一P我提赯个不是因为它是Rails里特有的问题Q我们在各种应用也会看到同样的问题。值得在这里带出是因ؓ用Rails的h们往往很容易忘了有q样的情况发生,也忘了有q样的模式去解决。我们发现Rails把web开发中重复又重复的环节变得易和快,但是复杂的环节是仍然存在的?br />
来源:http://rickylui.com/lionwiki/index.php?page=Ruby+at+ThoughtWorks
     http://martinfowler.com/articles/rubyAtThoughtWorks.html


leekiang 2010-02-20 04:42 发表评论
]]>
rails调试http://www.aygfsteel.com/leekiang/archive/2010/02/19/313426.htmlleekiangleekiangFri, 19 Feb 2010 15:22:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/02/19/313426.htmlhttp://www.aygfsteel.com/leekiang/comments/313426.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/19/313426.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/313426.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/313426.html未安装版本与0\.4\..*模式匚w的ruby-debug-ide 点击"安装快速调试器",出现如下的错?
------------------------------------------------------
Building native extensions.  This could take a while...
ERROR:  Error installing ruby-debug-ide:
    ERROR: Failed to build gem native extension.

c:/ruby/bin/ruby.exe mkrf_conf.rb
Building native extensions.  This could take a while...

Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.9 for inspection.
Results logged to c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.9/ext/gem_make.out
------------------------------------------------------
然后在C:\ruby\lib\ruby\gems\1.8\gems下发C刚刚生成的ruby-debug-ide-0.4.9目录和ruby-debug-base-0.10.3目录?br />
接着在cmd里gem install ruby-debugQ也报错Q?br />------------------------------
Building native extensions.  This could take a while...
ERROR:  Error installing ruby-debug:
        ERROR: Failed to build gem native extension.

c:/ruby/bin/ruby.exe extconf.rb
creating Makefile
nmake
'nmake' 不是内部或外部命令,也不是可q行的程?br />或批处理文g?br />
Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-bas
e-0.10.3 for inspection.
Results logged to c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3/ext/gem_
make.out
-------------------------------
然后发现ruby-debug-base-0.10.3目录重新生成了?br />
现在说一下解x?
1Q下载http://rubyforge.iasi.roedu.net/gems/ruby-debug-base-0.9.3-mswin32.gem
   gem install ruby-debug-base-0.9.3-mswin32.gem
2, 去http://rubyforge.org/projects/debug-commons/下蝲ruby-debug-ide-0.4.6.gem
   gem install ruby-debug-ide-0.4.6.gem
   版本不能高于0.4.6,如果高了都报       
      ERROR: Failed to build gem native extension.
   0.4.7见ruby-debug-ide-0.4.7\ext\extconf.rb
   0.4.9见ruby-debug-ide-0.4.9\ext\mkrf_conf.rb
   0.4.6压根没有ext目录
   有h说要装什么linecache.gemQ我没安装?br />   q有了ruby-debug.gem,我也没安装?br />   在http://rubyforge.mirrors.roedu.net/gems里能扑ֈ老版本?br />
感谢http://hlee.javaeye.com/blog/576237

在netbeans里调试时发现有问?那个l三角不能点多了Q否则会影响后面的调试?br />

另外不明白gem除了把文件拷到gems目录下,q做了什么?br />


后面都是记录Q仅供参考?br />?a >How to enable Ruby debug in RubyMine 2.0 on Windows里说
(If you installed Ruby with the zip binary, reinstall it using the one-click installer as found here. That's because currently the ruby debugger ide only works on Windows using a RubyInstaller installation). Also verify that Ruby's root path doesn't include spaces.
  1. ...?br />
  2. ...?
  3. ...?
  4. Open with a text editor the file command.rb that's part of the installed ruby-debug-ide19 gem. In my case, that file was under folder C:\Programmi\Ruby19\lib\ruby\gems\1.9.1\gems\ruby-debug-ide19-0.4.12\lib\ruby-debug
  5. Modify the beginning of procedure debug_eval (at line 120) so to enter a new statement between statements str = str.to_s and max_time = 10. The new statement to enter is:
    return "" if str == "$FILENAME"

    At the end, the procedure debug_eval should begin like this:
    def debug_eval(str, b = get_binding)
      begin str = str.to_s
      return "" if str == "$FILENAME"
      max_time = 10
      to_inspect = str.gsub(/\\n/, "\n")

ruby-debug to Ruby 1.9
如果使用的是ruby1.9,?a >Installation: IDE version?a >NetBeans 6.7.1 IDE updates.ruby-debug19 only works on Windows using a RubyInstaller installation,Do not install to a path that has a space inside of it.In both cases, you will also need to download and install the DevKit.
原来?a >ruby-debug-ide 0.4.7 的release notes里说了原?
Patch by Mark Moseley supporting ruby-debug-base19.
  Dynamically installs right ruby-debug-base dependency depending on the
  version of a Ruby platform being used. ruby-debug-base19 is the only solution
  these days for 1.9 debugging, so might be temporary solution until ruby-debug
  projects brings official version.
另外参见Ruby 2.0 Beta Issue: Error installing ruby-debug-ide19
        Debug supported for ruby 1.8.7?

?a >从下午弄到深夜还没解军_于ruby-debug-ide的问?/a>发现有h解决?
我试了下ruby1.8.6q是不行Q还是报那个异常。没法换成NetBeans6.8集成的jrubyQ集成的jruby中自带ruby-debug-ideQOK了。在q里提示一下,不要选jruby.exe要选jruby.batQ希望对遇到同样问题的h有所帮助?br />问题解决Q解x骤:1.下蝲rubyinstallerQ安装;2.下蝲devkitQ解压到根目录后Q修?“ruby路径”\devkit\msys\1.0.11\etc\fstab?br />“ruby路径?devkit/gcc/3.4.5/mingw32
“ruby路径?devkit/msys/1.0.11/usr/local /usr/local
然后在命令行H口Qgem install linecache19 q个要好长时_耐心{待。然后gem install ruby-debug-ide19Q这个就快了。这OK了,不要在rubymine中安装ruby-debug-ide19和linecache19Q会报错?br />

某h?a target="_blank">解决办法:
在RubyMine里调试提C需要安装ruby-debug-ideQ但是安装的q程有问题,提示Q?br />  ERROR: Failed to build gem native extension.
于是惌开gem包,把里面的extensionL。但是编辑完之后再用winrar打包gemp不出来了。看来压~的格式也很重要。于是找来了tar和gzip两个工具Qtarq好Q用gzip解压和压~过的文件还是认不出来。只有另惛_的办法了。突然想到把文g解压之后Q应该可以用gem的工h生成一个gem安装文g吧。于是找了一制作gem的教E,把extensionL之后制作了一个gemQ居然可以顺序安装了。然后重新打开 RubyMine也可以调试了?br />
Trying to install ruby-debug-ide on jruby 1.2.0
http://youtrack.jetbrains.net/issue/RUBY-5341
好帖Ruby调试器一?/a>
一?a >视频

http://netbeans.org/kb/60/ruby/debugger-screencast.html


201010补充:
Ҏ没有那么复杂,
装DevKit,把DevKit\bin讄为环境变?然后可以在netbean中安装和执行?br />


leekiang 2010-02-19 23:22 发表评论
]]>
response_to{?/title><link>http://www.aygfsteel.com/leekiang/archive/2010/02/18/313392.html</link><dc:creator>leekiang</dc:creator><author>leekiang</author><pubDate>Wed, 17 Feb 2010 18:42:00 GMT</pubDate><guid>http://www.aygfsteel.com/leekiang/archive/2010/02/18/313392.html</guid><wfw:comment>http://www.aygfsteel.com/leekiang/comments/313392.html</wfw:comment><comments>http://www.aygfsteel.com/leekiang/archive/2010/02/18/313392.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/leekiang/comments/commentRss/313392.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/leekiang/services/trackbacks/313392.html</trackback:ping><description><![CDATA[posts_url               http://localhost:3000/posts<br />posts_path              /posts<br />new_post_path           /posts/new<br />edit_post_path(post)    /post/:id/edit<br />redirect_to(@post)     会重定向?post/:id?也就是posts_controller的show<br /><br />Expected response to be a <:redirect>, but was <200><br />试时报错,后发现是试里提供的数据没有通过验证<br /><img src ="http://www.aygfsteel.com/leekiang/aggbug/313392.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/leekiang/" target="_blank">leekiang</a> 2010-02-18 02:42 <a href="http://www.aygfsteel.com/leekiang/archive/2010/02/18/313392.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>试redmine时报gem~失http://www.aygfsteel.com/leekiang/archive/2010/02/17/313324.htmlleekiangleekiangWed, 17 Feb 2010 12:01:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/02/17/313324.htmlhttp://www.aygfsteel.com/leekiang/comments/313324.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/17/313324.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/313324.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/313324.htmlq行redmine的测试时报错
Missing these required gems:
thoughtbot-shoulda
nofxx-object_daddy
mocha
在控制台里执行gem install mocha
gem install shoulda
和gem install object_daddy
到C:\ruby\lib\ruby\gems\1.8\gems下去?br />发现多了object_daddy-0.4.1,shoulda-2.10.3和mocha-0.9.8q?个目?br />再执行测试,不报~少mocha了,但还报缺另外两个jar

在http://www.redmine.org/boards/2/topics/11130扑ֈ了办?br />rake gems:install RAILS_ENV=test
以下是在netbeans控制台里输出的信?br />gem.bat install thoughtbot-shoulda --source http://gems.github.com
Successfully installed thoughtbot-shoulda-2.10.2
gem.bat install nofxx-object_daddy --source http://gems.github.com
Successfully installed nofxx-object_daddy-0.4.1

然后到C:\ruby\lib\ruby\gems\1.8\gems下去看,发现多了两个目录
nofxx-object_daddy-0.4.1和thoughtbot-shoulda-2.10.2,
奇怪的是与前面相比Q目录名和大都变了?br />

leekiang 2010-02-17 20:01 发表评论
]]>
rubyW记http://www.aygfsteel.com/leekiang/archive/2010/02/17/313261.htmlleekiangleekiangWed, 17 Feb 2010 03:47:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/02/17/313261.htmlhttp://www.aygfsteel.com/leekiang/comments/313261.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/17/313261.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/313261.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/313261.html2,ruby的符?symbol)
  symbol都以冒号作ؓ前缀。rails常常用符hl方法参数命?以及用作hash的键。譬如说:
  redirect_to :action=>"edit",:id=>params[:id]
3,
class Order < ActiveRecord::Base
 has_many :line_items
 
 
def self.find_all_unpaid
   find(:all, 
'paid = 0' )
 end

 
def total
   sum 
= 0
   line_items.each {
|li| sum += li.total}
 end
end
在方法前加上"self.",该方法就变ؓcL法,可以在类层面上直接调?Order.find_all_unpaid

4,实例变量的名字以"@"开?br />5,在rails目?font color="#0000ff">rake doc:app可以为rails目创徏html格式的文?攑֜doc/app目录里?br />6,模块(module)与类差不多,区别是无法创建模块的实例?br />  我的感觉是module是代码片D,可以在Q何类里引入作cȝ一部分?br />

leekiang 2010-02-17 11:47 发表评论
]]>
rails功能试http://www.aygfsteel.com/leekiang/archive/2010/02/15/313139.htmlleekiangleekiangMon, 15 Feb 2010 11:22:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/02/15/313139.htmlhttp://www.aygfsteel.com/leekiang/comments/313139.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/15/313139.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/313139.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/313139.html assert_select assert_not_nil assigns(:people)
assigns是一个特D的变量。如果您在控制器中创Z一个实例变量,那么q个变量
可以直接在视图模板中用。这一机制背后的原理其实很单:Rails首先通过反射
控制器中的变量拯C个容器中Q其后又该容器中的变量拯回视囑֮例?br />而这个容器其实就是上面提到的assignsQ所以前面的断言可以被理解ؓ“控制器应该
创徏一个名?strong>people的非I变量”?br />
http://www.javaeye.com/topic/481193
http://www.infoq.com/cn/articles/rails-for-java-excerpt
http://www.ibm.com/developerworks/cn/web/wa-rails4/
http://www.aygfsteel.com/cap/articles/rails_test.html

CRails Test Prescriptions

leekiang 2010-02-15 19:22 发表评论
]]>
Flash—“动作”间的通信http://www.aygfsteel.com/leekiang/archive/2010/02/15/313136.htmlleekiangleekiangMon, 15 Feb 2010 10:34:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/02/15/313136.htmlhttp://www.aygfsteel.com/leekiang/comments/313136.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/15/313136.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/313136.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/313136.htmlhttp://www.infoq.com/cn/articles/rails-for-java-excerpt
http://jbf034.javaeye.com/blog/222730

leekiang 2010-02-15 18:34 发表评论
]]>
“过滤器?before,after,around)http://www.aygfsteel.com/leekiang/archive/2010/02/15/313137.htmlleekiangleekiangMon, 15 Feb 2010 10:34:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/02/15/313137.htmlhttp://www.aygfsteel.com/leekiang/comments/313137.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/15/313137.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/313137.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/313137.html

leekiang 2010-02-15 18:34 发表评论
]]>
Rails for Java Developershttp://www.aygfsteel.com/leekiang/archive/2010/02/15/313066.htmlleekiangleekiangSun, 14 Feb 2010 19:19:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/02/15/313066.htmlhttp://www.aygfsteel.com/leekiang/comments/313066.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/15/313066.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/313066.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/313066.htmlJava开发者的Rails之\
Rails for Java Developers


leekiang 2010-02-15 03:19 发表评论
]]>
rails应用的认证和授权http://www.aygfsteel.com/leekiang/archive/2010/02/14/313003.htmlleekiangleekiangSun, 14 Feb 2010 13:00:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/02/14/313003.htmlhttp://www.aygfsteel.com/leekiang/comments/313003.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/14/313003.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/313003.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/313003.html 一个带完整的RBAC授权pȝ的rails应用
http://www.javaeye.com/topic/215074

RESTful_ACL


declarative_authorization
aegis
cancan           http://github.com/ryanb/cancan
Authologic
acl9             http://github.com/be9/acl9
role_requirement http://github.com/timcharper/role_requirement
ActiveRbac


restful_authentication
1Qruby script/plugin install http://svn.techno-weenie.net/projects/plugins/restful_authentication/
目右键->rails 插g->资源库里durlQhttp://svn.techno-weenie.net/projects/plugins
->新插仉扑ֈrestful_authentication然后安装
2, ruby script/generate authenticated user sessions
Right-click on your application in the projects pane and choose  
"Generate". In the dialog box that comes up, choose "authenticated"  
from the drop-down "Generator" menu near the top, and in the arguments  
field enter "user sessions" (without the quotes). Hit OK.
----------------------------------------------------------------------
Don't forget to:

Try these for some familiar login URLs if you like:

map.activate '/activate/:activation_code', :controller => 'users', :action => 'activate', :activation_code => nil
map.signup '/signup', :controller => 'users', :action => 'new'
map.login '/login', :controller => 'sessions', :action => 'new'
map.logout '/logout', :controller => 'sessions', :action => 'destroy'

----------------------------------------------------------------------
      create  app/views/sessions
      create  app/views/users
      create  app/models/user.rb
      create  app/controllers/sessions_controller.rb
      create  app/controllers/users_controller.rb
      create  lib/authenticated_system.rb
      create  lib/authenticated_test_helper.rb
      create  test/functional/sessions_controller_test.rb
      create  test/functional/users_controller_test.rb
      create  test/unit/user_test.rb
      create  test/fixtures/users.yml
      create  app/helpers/sessions_helper.rb
      create  app/helpers/users_helper.rb
      create  app/views/sessions/new.html.erb
      create  app/views/users/new.html.erb
      create  db/migrate/20100218184435_create_users.rb
      route  map.resource :session
      route  map.resources :users

q行试时要把SessionsControllerTest和UsersControllerTest都改为承ActionController::TestCase,同时把fixtures :users注释掉?br />
要用current_user和logged_in? helperҎ的话要在ApplicationController?span style="">include AuthenticatedSystem 

resource与resources的区别见http://api.rubyonrails.org/classes/ActionController/Resources.html

http://www.javaeye.com/topic/353831
http://www.javaeye.com/topic/177508
http://hideto.javaeye.com/blog/115157
https://github.com/nakajima/roleful


leekiang 2010-02-14 21:00 发表评论
]]>
rails2.3?.2的区?/title><link>http://www.aygfsteel.com/leekiang/archive/2010/02/14/312962.html</link><dc:creator>leekiang</dc:creator><author>leekiang</author><pubDate>Sun, 14 Feb 2010 10:51:00 GMT</pubDate><guid>http://www.aygfsteel.com/leekiang/archive/2010/02/14/312962.html</guid><wfw:comment>http://www.aygfsteel.com/leekiang/comments/312962.html</wfw:comment><comments>http://www.aygfsteel.com/leekiang/archive/2010/02/14/312962.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/leekiang/comments/commentRss/312962.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/leekiang/services/trackbacks/312962.html</trackback:ping><description><![CDATA[http://www.pragprog.com/wikis/wiki/ChangesInRails23<br />1Q?app/controllers下的application.rb is now application_controller.rb<img src ="http://www.aygfsteel.com/leekiang/aggbug/312962.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/leekiang/" target="_blank">leekiang</a> 2010-02-14 18:51 <a href="http://www.aygfsteel.com/leekiang/archive/2010/02/14/312962.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>rails主题(theme)http://www.aygfsteel.com/leekiang/archive/2010/02/14/312950.htmlleekiangleekiangSun, 14 Feb 2010 10:28:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/02/14/312950.htmlhttp://www.aygfsteel.com/leekiang/comments/312950.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/14/312950.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/312950.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/312950.html
2,Scribbish

leekiang 2010-02-14 18:28 发表评论
]]>
rails3http://www.aygfsteel.com/leekiang/archive/2010/02/14/312936.htmlleekiangleekiangSun, 14 Feb 2010 09:58:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/02/14/312936.htmlhttp://www.aygfsteel.com/leekiang/comments/312936.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/14/312936.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/312936.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/312936.htmlhttp://www.pragprog.com/wikis/wiki/ChangesInRails30


leekiang 2010-02-14 17:58 发表评论
]]>
rails调试以及日志http://www.aygfsteel.com/leekiang/archive/2010/02/14/312881.htmlleekiangleekiangSat, 13 Feb 2010 18:24:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/02/14/312881.htmlhttp://www.aygfsteel.com/leekiang/comments/312881.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/14/312881.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/312881.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/312881.htmlconfig.log_level = :debug
config.logger = Logger.new(STDERR)
同时在controller里加一行logger.info 'test'
成功了,但奇怪的是log_level设ؓdubug和info没有区别

2, http://wordpress.javaeye.com/blog/134544
rails的日志文件存在于app/log下面。对于不同环境生的日志内容会有差别。development下会把每ơ对数据库的讉K代码包含q去Qproduction会省略,不过也有很多的内宏V? 如果只希望在production环境下,输入量的log, 则只需要在config/environments/production.rb中更改:
config.log_level = :warn

附带log level:
Rails可以通过选择不同的log level来控制log文g的输出,可以使用的log level?debug, :info, :warn, :error, :fatal?:debug level提供最详细的log, 可以每一条sql都记录下来?info level是production环境下的默认讄Q不会写出sql的执行情况,但也会很详细Q如果是ActiveMailerQ它会记录下每封信的内容QLog文g内容是快速增ѝؓ了避免Log把空间塞满的情况发生Q要注意定期清除LogQ另外是选择:warn level{log level, 只记录重要的信息.

是否可以q么_environment.rb对三个环境都生效,production.rb只对生环境有效.


3Q在单元试cȝҎ里加了logger.dubug 'test'Q执行测试时报错Q后改ؓ
RAILS_DEFAULT_LOGGER.debug 'test' 成功?br />

Rails Logging Tips —?Rails写日志的提示http://www.cgpad.com/SPAN/articles_show/167
http://hlee.javaeye.com/blog/358516


leekiang 2010-02-14 02:24 发表评论
]]>
rails事务http://www.aygfsteel.com/leekiang/archive/2010/02/14/312873.htmlleekiangleekiangSat, 13 Feb 2010 17:04:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/02/14/312873.htmlhttp://www.aygfsteel.com/leekiang/comments/312873.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/14/312873.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/312873.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/312873.html1,around_filterq行action的自动事务处?br />在controller里面可以使用around_filter来进行action的包装,当action中弹出异常的时候渲染一个特D的出错 面。将action代码包装在ActiveRecord::Base.transaction函数的block中执行,当引发异常后截获q新抛Z? ActiveRecord::Rollback异常让rails数据回滚掉。ActiveRecord::Base.transaction? ActiveRecord::Rollback异常处理后不会再该异常往外面抛?/div>

around_filter :around_action_filter
protected
def transaction
ret = true
ActiveRecord::Base.transaction do
begin
yield if block_given?
rescue Exception => ex
set_notice(ex.message)
ret = ex.message
raise ActiveRecord::Rollback, ex.message
end
end
return ret
end
def around_action_filter
return yield if request.get?
redirect_to(:controller => "error_display", :action => "error_notice") if 
transaction { yield if block_given? } != true
end

q里的transaction函数可以用在action里面作ؓ手动事务处理的解军_法?br />http://www.cgpad.com/SPAN/articles_show/940


leekiang 2010-02-14 01:04 发表评论
]]>
netbeans下用ruby和railshttp://www.aygfsteel.com/leekiang/archive/2010/02/13/312844.htmlleekiangleekiangSat, 13 Feb 2010 10:34:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/02/13/312844.htmlhttp://www.aygfsteel.com/leekiang/comments/312844.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/13/312844.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/312844.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/312844.html1 在netbeans里徏一个rails目,名ؓrubyweblog
2 使用Scaffold生成post模型的全套文?/font>.?目"H口?code style="">rubyweblog目?/code>右键 Q点ȝ?generate),在“Rails 生成器”对话框中,从“生成”下拉列表中选择 "scaffold",在“模型名U”文本框中键?Post,在“属性对”文本框中键?title:string q单几Z确定”按钮?br />  语法:script/generate scaffold ModelName [field:type field:type]
3 生成数据库和?/font>
  在“项目”窗口中Q右键单?rubyweblog 目节点Q然后从弹出式菜单中选择“运?调试 Rake d?从“匹配Q务”列表中选择 db:create q单几Z完成?q时会在mysql中生成开发库.q一步也可以手工?也就相当?font color="#0000ff">rake db:create

  在“项目”窗口中Q右键单?rubyweblog 节点q择“迁UL据库?gt;“至当前版本?q样会生成表l构?br />4 修改"routes.rb" , 扑ֈ# map.root :controller => "welcome" q一?取消注释该行q将控制器更改ؓ "posts"。删除public下的index.htmlQRails 在 routes.rb 中寻N要显C的面。然后就可以q行了?br />5 向posts 表中d一?code style="">body
字段
  右键单击“数据库q移”节点,q从弹出菜单中选择“生成?q将打开“Rails 生成器”对话框Q它已经在“生成”下拉列表中选择了迁U?migration),当然也可以在目上右?gt;生成>migration?br />  在“参数”文本框中输?AddBodyToPost body:text,其他默认Q单几Z确定”?font color="#ff0000">q个"AddBodyToPost"只是一个名字?/font>
  IDE会创Z个受版本控制的迁U脚本。该脚本的名UC日期和时间开_q以 add_body_to_post.rb l束。在目上右键选择“迁UL据库?gt;“至当前版本”,或者在源文件中右键点击“运行文件”(q时要小心,可能会造成数据丢失Q?br />  修改new.html.erb、edit.html.erb和show.html.erb,增加与新字段相关的网代码?br />
生成试库与生成开发库cMQ在“项目”窗口中Q右键单?rubyweblog目Q然后选择“运?调试 Rake d”,在“参数”文本框中键?RAILS_ENV=test,扑ֈq双?db:create 条目Q以q行dQ从而创?rubyweblog_test 数据?接着扑ֈq双?db:test:prepare 条目?font color="#ff0000">我觉?db:test:prepare 可以不执行,因ؓ点击目右键"试"时会自动执行db:test:prepare和rake db:fixtures:load
?br />
http://cn.oiax.jp/rails/rails_step_by_step/rails_step1.html说了config/routes.rb末尾附近的以下两行可以删掉,试了果然如此
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'


http://zh-cn.netbeans.org/kb/docs/ruby/quickstart.html



leekiang 2010-02-13 18:34 发表评论
]]>
rake,gemhttp://www.aygfsteel.com/leekiang/archive/2010/02/13/312843.htmlleekiangleekiangSat, 13 Feb 2010 10:32:00 GMThttp://www.aygfsteel.com/leekiang/archive/2010/02/13/312843.htmlhttp://www.aygfsteel.com/leekiang/comments/312843.htmlhttp://www.aygfsteel.com/leekiang/archive/2010/02/13/312843.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/312843.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/312843.htmlruby之间的引用全部是源代码的引用Qؓ了规范类库的理Qgems出现了?
gems是ruby源代码管理工P代码按照一定的目录l构被组l成一个lib?br />详见http://www.javaeye.com/topic/320384
Gem是第三方Ruby库,netbeans提供了Ruby Gems理器,可以用来d和维护gem,Tools > Ruby Gems?br />rails和rake{都被rubygems理?br />

  查看本机的gems:  gem list --local 
 
看看rubyforge.org上的gems:  gem list --remote
  删除某个版本的gemQ例如gem uninstall rails -v=2.3.4

有一本书?lt;Ruby Gems开发实?gt;

2,
Rake(http://rake.rubyforge.org)是一门构aQ和make(www.gnu.org/software/make/)
ant(http://ant.apache.org)很相像。Rake是用Ruby写的Q它支持它自qDSL用来处理和维?br /> Ruby应用E序。Rails用rake的扩展来完成多种不同的Q?
详见http://www.javaeye.com/topic/300375
rake教程:http://railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial
    译:http://hi.baidu.com/%D0%C7203/blog/item/ebda2dd09f1d698ea1ec9c7a.html




leekiang 2010-02-13 18:32 发表评论
]]>
netbeansW记http://www.aygfsteel.com/leekiang/archive/2009/02/14/254629.htmlleekiangleekiangFri, 13 Feb 2009 17:17:00 GMThttp://www.aygfsteel.com/leekiang/archive/2009/02/14/254629.htmlhttp://www.aygfsteel.com/leekiang/comments/254629.htmlhttp://www.aygfsteel.com/leekiang/archive/2009/02/14/254629.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/254629.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/254629.html  代码自动完成:Ctrl+反斜U?br />


2,讄
  1)如果觉得NetBeans~省的工h按钮太大Q可以右键点dhQ从下拉菜单中选择Small Toolbar Icons
q可以选择"内存"Q会在工h昄内存占用情况?br />  2)讄字体:
Tools->Options->Fonts & Colors,在左边的cdCategory下选择~省(Default),再选择字体Q然后保存?一定要选一个CategoryQ因为刚q来旉认的cd?I白"Q会D换了字体也不会生?。可能中文会q,所以还要修改Comment,Stringq两个类别?br />我的字体讄
languages:all languages
Category:Default   Font:Courier New 13
Category:Comment   Font:Dialog 12
Category:String    Font:Dialog 12
  3)控制台出Cؕ?br />在Netbeans的安装目录下的etc目录下有一个netbeans.confQ?font color="#000000">?/font>netbeans_default_options引号内加?/font>"-J-Dfile.encoding=UTF-8" 可以了! 其它比如字体大小也可以在q里调整.? --font-size:12可以了!
-J-Duser.language=en -J-Duser.country=US 英文界面启动
  4)erb文g
# coding: utf-8

?目"H口中显C物理结?默认是逻辑l构):
tools->Miscellaneous(其他)->ruby标签?>取消"昄逻辑目视图"Q然后重启?br />
3,
maven风格的项目结?http://www.javaeye.com/topic/274136?page=5

4Q与eclipse׃n工程
http://tech.ddvip.com/2008-12/122916148599857.html
http://tech.ddvip.com/2008-12/122880588198603.html

5Q有在linux下这栯|一下界面比较好看:
在netbeans 在安装目录下扑ֈ etc/netbeans.conf 然后在netbeans_default_options d参数
-J-Dswing.aatext=true --locale en:US
  来源:http://www.aygfsteel.com/gml520/archive/2010/04/16/318507.html


leekiang 2009-02-14 01:17 发表评论
]]>
rails记录http://www.aygfsteel.com/leekiang/archive/2008/12/03/244052.htmlleekiangleekiangTue, 02 Dec 2008 18:53:00 GMThttp://www.aygfsteel.com/leekiang/archive/2008/12/03/244052.htmlhttp://www.aygfsteel.com/leekiang/comments/244052.htmlhttp://www.aygfsteel.com/leekiang/archive/2008/12/03/244052.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/244052.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/244052.htmlhttp://www.railsinside.com/elsewhere/100-7-barebones-rails-apps-to-kick-start-your-development-process.html
  下蝲bortQ放到netbeans6.5中,讄Z目Q启动报错,W一ơ报capistrano的错误,我在environment.rb中把那几个config.gem屏蔽了。接着又报 `load_missing_constant': uninitialized constant Authorization::AasmRoles::AASM (NameError) Q我照着http://rails_security.lighthouseapp.com/projects/15332/tickets/10-uninitialized-constant-authorization-aasmroles-aasm-nameerrorq个链接里的做法
在application.rb的ApplicationController里加了一?font color="#0000ff">require 'aasm'Q?font color="#000000">然后可以启动了。执行ruby db/migrate,重启后,首页能进Q但注册一个用h交后?/font>

Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
q个发生在app/views/users/new.html.erb
暂时到q里了,以上大多不懂Q先作个记录?br />
2Q这是一个基?.2.2的例?名叫starter
http://github.com/josevalim/starter/tree/master/app
可以在github里搜2.2.2Q或在code search里搜索RAILS_GEM_VERSION = '2.2.2'Q以LZ2.2.2的例子?br />http://github.com/brainopia/shop/tree/master
http://github.com/ccjr/play-eoj/tree/master
http://github.com/Radar/rboard/tree/master
http://github.com/rbarazi/simple_blog/tree/master
http://github.com/csiszarattila/webshop/tree/master
http://github.com/bushymark/depot/tree/master

q行starter,却报
  Missing these required gems:
  win32console
  ruby-debug
  ruby-prof

然后
starter>rake gems:install
(in c:/starter)
rake aborted!
no such file to load -- spec/rake/spectask
C: /starter/rakefile:10
(See full trace by running task with --trace)




leekiang 2008-12-03 02:53 发表评论
]]>rails知名应用和工?/title><link>http://www.aygfsteel.com/leekiang/archive/2008/12/01/243602.html</link><dc:creator>leekiang</dc:creator><author>leekiang</author><pubDate>Sun, 30 Nov 2008 18:30:00 GMT</pubDate><guid>http://www.aygfsteel.com/leekiang/archive/2008/12/01/243602.html</guid><wfw:comment>http://www.aygfsteel.com/leekiang/comments/243602.html</wfw:comment><comments>http://www.aygfsteel.com/leekiang/archive/2008/12/01/243602.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/leekiang/comments/commentRss/243602.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/leekiang/services/trackbacks/243602.html</trackback:ping><description><![CDATA[1,<em>博客,cmsc?br />  Mephisto 已升?.2.2Q?/em><em><br />  typo 已升U至2.3.5<br /></em><em>  radiantcms 内容理</em><br />  rubricks<br />  refinerycms<br />  locomative<br /><em>  simplelog:http://simplelog.net<br />  1stlog是一个针对中国用户开发的ZRubyOnRails的Blogpȝ<br />  http://www.h3rald.com/articles/rails-os-killer-apps<br />2Q项目管?br /></em>   Redmine 2.3.5<br />   retrospectiva  http://retrospectiva.org/  2.3.5<br />   Teambox<br />   Clocking IT 功能更ؓ强大<br />3Q论?br />  beastQrforum<br />  beast攚w版:http://code.google.com/p/savage-beast-2/<br />              http://github.com/courtenay/altered_beast<br />  rboard:https://github.com/radar/rboard<br />4,SNS<br />https://github.com/insoshi/insoshi<br />https://github.com/stevenbristol/lovd-by-lessQdemo见http://try.lovdbyless.com/   <br />https://github.com/bborn/communityengine  见http://communityengine.org/<br />https://github.com/timothyf/EngineY<br />?br />《Practical Rails Social Networking Sites?br />《RailsSpace: Building a Social Networking Website with Ruby on Rails?br /><br /><em>5Q进销?br />http://hamster.rubyforge.org/index.htm<br />Spree http://spreehq.org/  已升U至2.3.5<br />gal  http://gal.railsplayground.com/<br />     http://sourceforge.net/projects/gal<br />     https://gal.svn.sourceforge.net/svnroot/gal/trunk/<br />http://www.javaeye.com/news/5718-23-best-open-source-ruby-on-rails-application<br />6,</em><em>substruct</em><br /><em>http://code.google.com/p/</em><em>substruct</em><em>/<br /><br />tracks 个h旉理? http://www.getontracks.org 2.2.2<br /><br /><br />6 CRM,erp<br />fat_free_crm http://www.fatfreecrm.com/  目前Z2.3.4,g没有单元试<br /></em><em>extrails</em><br /><em>http://sourceforge.net/projects/extrails/<br />http://code.google.com/p/pa-manager/<br />官网为http://www.ev-manager.com<br /><br />文档理<br />http://github.com/bruparel/file_manager<br /><br />邮g<br />mailr<br /><br />C会化网l?br />Community Engine  http://communityengine.org/<br />onebody   insoshi<br />openmind<br />http://www.blog.railshouse.com/2009/04/17/Top-Open-Source-Ruby-On-Rails-Projects<br /><br />7Q?/em>Rools is a pure Ruby rules-engine.<br />8QopenWFEru is an open source Ruby workflow and <span id="wmqeeuq" class="caps">BPM</span> engine。又?em>Ruote</em><br />9QSpreadsheet can read, write and modify Spreadsheet Documents<br /><em>10Q?/em><em>sequel</em><br /><em>http://www.infoq.com/cn/news/2008/12/sequel-ruby-db-toolkit<br />11QRails  Metal是一个围l一般Rack中间件的装wrapperQ能够放在Railsh的前面ƈ使用Rails的session。Metal的出现给让Rails应用的运行速度极大加快Qƈ且能够每U钟同时处理成千上万的应?br /><br />12,rubycas-server  单点d<br />   http://chinaonrails.com/topic/view/1610.html<br />  http://code.google.com/p/rorjossoagent/   </em>destinyd.war@gmail.com<br /><em><br />13,</em><a >说到工作引?/a>Qruby的state machine非常不错Q在功能/开发效?可扩展性等斚wQ没有Q何一个开源的java工作引擎可以和它媲: <br /><a target="_blank">http://github.com/pluginaweek/state_machine/tree/master</a><br />http://www.javaeye.com/topic/362207<br /><br />http://www.aygfsteel.com/cap/archive/2005/07/17/7895.html<br />Graphviz的主在<a >http://www.graphviz.org/</a> Q?他是AT&T Labs-Research开发的囑Şl制工具,  他可以很方便的用来绘制结构化的图形网l,支持多种格式输出Q?生成囄的质量和速度都不?br /><br />acts_state_machine<br /><br />14,Bort<br /><span id="repository_description" rel="/fudgestudios/bort/edit/update" class="">A base rails app featuring: RESTful Authentication, Will Paginate, Rspec &amp; Rspec-rails, Exception Notifier, Asset Packager, Cap Recipe (multi-stage).</span><br />15 sinatra 微型web框架<br />16 pony 发邮?br />17 rest-client代替ActiveResource<br />18 报表 ruport   rails21-book   <span id="h8m.5" style="font-family: Arial;" class="Apple-style-span"><span id="hl9l" style="font-family: Lucida; line-height: 16px;" class="Apple-style-span">Prawn   </span></span>ActvieFPDF<br /><font color="red">   <a >HowtoGeneratePDFs</a></font><span id="h8m.5" style="font-family: Arial;" class="Apple-style-span"><span id="hl9l" style="font-family: Lucida; line-height: 16px;" class="Apple-style-span"><br />   http://wiki.rubyonrails.org/rails/pages/HowtoIntegrateJasperReports<br />19 RadiantQ一个顶的ZRails的CMS<br />20 </span></span>Mongrel<br />   http://chinaonrails.com/topic/view/206.html<br />   Mongrel 是一个ruby的webserver和类? Mongrel的特色就是快Q它比ruby自带的web serverq有其他的webserver都要快。把E序部v到这个上面是会给你带来速度上的惊喜的? 另外你也可以在rubyE序中直接用mongrelQ开发属于自׃用的web server。mongrel的安装超U简单,别忘了他是用rubygems打包的,一个命令完全搞定?gem install mongrel <br /> 在我们介l的五个武器总mongrel是唯一的一个类库。他是开放源代码的。他是一个很好的教我们如何把自己的品打包,市场化。当然他最吸引的就是他的作者从中教l我们如何写一个类库?<br /><br />21  InstantRailsQ一个All In One的套Ӟ可以帮助你快速搭建Ruby On Rails开发环?br /><br />22  Adhearsion is a new way to write voice-enabled applications. It's not just an API or library ?it's a <strong>fully-featured framework</strong>, the first of its kind, designed for maximal code reuse and intuitiveness. The name "Adhearsion" is a combination of "adhesion" and "hear" because Adhearsion shines best when integrating technologies with voice.<br /><br />23 http://www.h3rald.com/articles/rails-os-killer-apps<br /><br />24 Shoes只是玩具Q要用Rubyq行快速GUI开发,LwxRuby+wxSugar<br />   http://quake.javaeye.com/blog/295829<br /><br />25 权限插g<br />http://github.com/binarylogic/authlogic/tree/master<br /><br />26 查询<br />http://www.javaeye.com/topic/585348<br />http://book.csdn.net/bookfiles/879/10087927419.shtml<br />http://www.javaeye.com/topic/241343 <a >Searchgasm</a>  searchlogic<br />Where插g  ostruct<br /><a >simple_column_search</a> http://doruby.kbmj.com/tn_on_rails/20100120/<br /><br />27,<Rails高~程><br /><br />28,<font size="-1"><font color="#c60a00">Camping</font>自己定义ؓ个代码量保持?k字节大小以下Web开发框架这个项目已创徏?2个月q由 whytheluckystfl护个完整web应用可以在单文g中定义同旉循MVC框架(q得web应用以后更易于移??font color="#c60a00">Rails</font>的上)<font color="#c60a00">Camping</font>使用ActiveRecord作ؓORM解决Ҏ</font><br /><br />29,nokogiri 解析xmlQ用法类gjquery<br /><br />30Qmini_magick处理囄<br /><br />31,rcov<br />是你的E序不经常崩溃的理由之一?它分析你的代码, 高亮昄你的试代码遗漏的部分?它速度快, 不占资源Q?q且能减d?Q?<br /><br />32,hpricot 是一个快速、容易上手的 HTML 分析器?如果你发现自己需要解?HTML 抑或 XML 的内容, hpricot 是最LҎ之一<br /><br />33,Capistrano ?Rails 应用E序开发更加从宏V?它还是一个用来和q程服务器交互的聪明?framework ?事实上我已经备䆾了用 Capistrano 写的代码Q?作ؓ Rake/Net::SSH 或?shell 代码之外的另一个选择?br /><br />34,Turn 使你?Test::Unit 输出更易诅R?Turn 也行看v来不那么招h喜欢Q?但它实寚wL试结果有很大帮助?在维?Helicoid 的时候我Ҏ试严重依赖, 所以Q何能使这工作变得更z的东西我都乐于试。要安装 turnQ?使用 gem install turn 命o?br /><br />35, scruffy和Gruff可用来生图?br /><br />36, rubyscript2exe和Exerb可以~译为exe文g,后者生成的文g,如果后者生成的q行不了可以试前者?br /><br />37Q?JRails是用jQuery替代Prototype/script.aculo.us在Rails?helpers实现javascript的功?br />     http://kyoleelqh.javaeye.com/blog/250514<br /><br />38,GNMS是一个网l管理系l,囑Ş化工P用于监测|络元素的状?br />39QPlugin to kill N+1 queries<br />    http://github.com/flyerhzm/bullet   destinyd_ror@163.com<br /><br />http://www.opensourcerails.com<br /><em><br />http://www.infoq.com/cn/articles/changing-the-present-case-stud<br />http://www.roredu.com/rubyrails/category/ruby-on-rails-item/<br />http://www.javaeye.com/news/1993<br />http://hqmank.blog.bokee.net/bloggermodule/blog_viewblog.do?id=532562<br />http://www.opensourcerails.com/<br />http://www.practicalecommerce.com/blogs/post/432-Multiple-Attachments-in-Rails<br /></em><img src ="http://www.aygfsteel.com/leekiang/aggbug/243602.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/leekiang/" target="_blank">leekiang</a> 2008-12-01 02:30 <a href="http://www.aygfsteel.com/leekiang/archive/2008/12/01/243602.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>railsW记http://www.aygfsteel.com/leekiang/archive/2008/11/30/243501.htmlleekiangleekiangSat, 29 Nov 2008 22:11:00 GMThttp://www.aygfsteel.com/leekiang/archive/2008/11/30/243501.htmlhttp://www.aygfsteel.com/leekiang/comments/243501.htmlhttp://www.aygfsteel.com/leekiang/archive/2008/11/30/243501.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/243501.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/243501.html  在已存在的表的create_table的参CQ加?:force => trueQ如下:
  create_table :products:force => true do |t
2Q验?br />http://www.36sign.com/blog/working/ror-validation-problem.html
http://cvu.javaeye.com/blog/78066
3Q分?br />will_paginate
下蝲:http://github.com/mislav/will_paginate/wikis/installation
http://hideto.javaeye.com/blog/108118
http://trace.javaeye.com/blog/156736
http://www.cnblogs.com/ayuan/archive/2008/03/12/1102001.html
http://www.ruby-lang.org.cn/forums/thread-985-1-1.html
http://hi.baidu.com/%D0%C7203/blog/item/30f334ecd0a319d72e2e212c.html


leekiang 2008-11-30 06:11 发表评论
]]>
用几句ruby代码刷h??http://www.aygfsteel.com/leekiang/archive/2008/04/05/190899.htmlleekiangleekiangSat, 05 Apr 2008 05:04:00 GMThttp://www.aygfsteel.com/leekiang/archive/2008/04/05/190899.htmlhttp://www.aygfsteel.com/leekiang/comments/190899.htmlhttp://www.aygfsteel.com/leekiang/archive/2008/04/05/190899.html#Feedback0http://www.aygfsteel.com/leekiang/comments/commentRss/190899.htmlhttp://www.aygfsteel.com/leekiang/services/trackbacks/190899.html require  ' net/http '

count 
=   1 .. 100000    #  define an array

count.each{      
#  each 
| index |               #  element is index  1 2 3 4 5 6
printf  " #{index}  "   # print index and space
=  Net::HTTP.new( ' space.cnblogs.com ' , 80 #  create a object
resp, data  =  h.get( ' /group/topic/1605/ ' ,nil)  #  get 
if  resp.code  !=   " 200 "   #  if http response status code not is 200 
  puts resp.code     # put status code
  puts resp.message  # put status message
  
  resp.each{    
# put headers
   | key, val |
  puts 
" #{key}\t\t\t#{val} "
  }
  
  p data    
# put html
   break   #  break the eache
end
# sleep(1) #sleep  use second do inteval
}

来源:http://www.cnblogs.com/coderlee/archive/2008/03/25/1121652.html

leekiang 2008-04-05 13:04 发表评论
]]> վ֩ģ壺 | | | | | | | | IJ| | | | ̫| ߮| ڳ| ڰ| | | | ɯ| | ߰| ̩| | ˱| ͨ| ̽| ʼ| | | ˮ| | °| ī| | | ӳ| | ˰| | |