1. ruby已成為1.872. 必須先安裝安裝光碟片裡的新的xcode,在"optional"目錄裡3. 可能需要重新安裝macporthttp://trac.macports.org/wiki/Migration4. 或者升級macporthttp://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard$ sudo port selfupdate$ sudo port sync$ sudo port upgrade
不顯示瀏覽器$HIDE_IE = true怎樣獲得當前檔案的路徑 File.dirname(__FILE__).to_s 讀檔案:第一種方法:$result='d://rs.txt'File.open($result, "r") do |file| file.each_line do |line| if line.length>20 puts line.chop.length #去掉最後一個換行字元,並顯示該行實際字串的長度 puts line
一、Ruby Introduction: Ruby is "an interpreted scripting language for quick and easy object-oriented programming"。 1. Interpreted scripting languageability to make operating system calls directlypowerful string operations and regular
This example will show you how to escape and un-escape a value to be included in a URI and within HTML.require 'cgi'# escapename = "ruby?"value = "yes"url = "http://example.com/?" + CGI.escape(name) + '=' + CGI.escape(value) + "&var=T"# url:
關於Ruby的介紹請參照:http://www.ruby-lang.org/zh_CN/about/一、IRB 互動式Ruby協助和控制台程式,Windows下成為fxri。 在IRB中可以直接執行Ruby代碼。如:Code highlighting produced by Actipro CodeHighlighter