Time of Update: 2014-07-02
標籤:blog http java 使用 檔案 os 1.前言
Time of Update: 2014-07-07
標籤:使用 檔案 os 代碼 io 安裝 安裝ruby yum install ruby irb rdoc 安裝Haskallyum install
Time of Update: 2014-06-27
標籤:blog http get 使用 檔案 資料 Ruby這個就不用多說了RVM用於幫你安裝Ruby環境,幫你管理多個Ruby環境,幫你管理你開發的每個Ruby應用使用機器上哪個Ruby環境。Ruby環境不僅僅是Ruby本身,還包括依賴的第三方Ruby外掛程式。都由RVM管理。Rails這個也
Time of Update: 2014-06-28
標籤:style blog http color 使用 strong 一、比較語句大部分和其他的語言一樣,這裡注意<=>、 條件陳述式如下幾種形式ifif ..else.. endif..elsif..else..endunless(if
Time of Update: 2014-06-25
標籤:class code com get strong 檔案 ruby comes with a set of predefined variables$: = default search path (array of paths)其他Ruby特殊變數:$! 最近一次的錯誤資訊[email&
Time of Update: 2014-08-11
標籤:style http color 使用 os io strong for 對於新入門的開發人員,怎樣安裝 Ruby, Ruby Gems 和 Rails 的執行環境可能會是個問題,本頁主要介紹怎樣用一條靠譜的路子高速安裝
Time of Update: 2014-08-09
標籤:style blog color strong div 代碼 new log 在ruby中,當某些特定的事件發生時,將調用回調方法和鉤子方法。事件有如下幾種:調用一個不存在的對象方法類混含一個模組定義類的子類給類添加一
Time of Update: 2014-07-30
標籤:style blog color 使用 代碼 div c++ new 上一篇講了ruby中的可調用對象proc和lambda,他們都是塊轉換成的對象。ruby中的可調用對象還有方法。通過使用method方法,並且以方法
Time of Update: 2014-07-23
標籤:ruby 擴充 makefile c extension # Loads mkmf which is used to make makefiles for Ruby extensions require 'mkmf' # Give it a name extension_name =
Time of Update: 2014-07-10
標籤:style blog http 使用 width os 寫ruby blog 系統的記錄下。也是對我學ruby的點滴記錄。先介紹下我的學習環境。系統:ubuntu12.04文檔:techotopia ,ruby文檔,the hard way learn ruby
Time of Update: 2018-12-08
前面我們測試了model和controller,學習了一些常用的測試方法,現在我們來深入學習幾個有關測試的主題。第一個是使用Mock對象。在很多時候,我們的程式和實際的環境有依存關係,比如現在的購物車,在匯款,結賬的時候要接入網路上的銀行帳號,這樣就造成了我們測試的時候必須要有internet環境。比如,我們在model目錄裡建立了一個payment_gateway.rb來處理網路銀行相關的操作,我們在store_control.rb的save_order方法裡這樣寫:gateway =
Time of Update: 2018-12-08
代碼如下:複製代碼 代碼如下:require 'date' day = Date.new(2008, 2, -1) end_of_month = day.strftime('%d').to_i year_and_month = day.strftime('%Y%m') for today in 1..end_of_month do p sprintf('%s%02d', year_and_month, today)
Time of Update: 2018-12-08
解釋的不錯,應該明確了不少 ruby symbol詳解 起因 最近在學習ruby on rails,的確是一個優秀的資料庫開發架構。但在過程中,發現在視圖檔案夾中的rhtml檔案裡有大量的類似於以下的語句: <td><%= link_to recipe.title, :action => “show”, :id => 1 %></td>
Time of Update: 2018-12-08
一、方法Ruby 的方法定義允許為參數設定預設值,不過在帶有預設值的參數後面不能出現不帶有預設值的參數(允許 * 和 &),也就是說下面的方法定義是不被允許的,解釋時會出現 parse error。 還有一點與 C# 不同的是,方法定義不能出現在方法調用的後面。# parse errordef Display(args1="proshea", args2)end# 允許def Display(args1="proshea", *args2)end# 允許def Display(args1
Time of Update: 2018-12-07
First, we need a simple view for our index defined in part 1index.rhtml in views/login<script type="text/javascript" src="/javascripts/login.js"></script> <p>Here comes the Content whichwill be used after the user logged on.
Time of Update: 2018-12-07
這段時間學習ruby on rails收集的一些網站,個人感覺不錯,有興趣可以看看InfoQ CodeBetternapcswebRidingRailsRubyOnRails道喜技術日記Rails架構技術講座LearningRubyA free, web-based course in Ruby programming along with a live instructor.Ruby Insideruby codeRubyCornerMeeting place for people
Time of Update: 2018-12-07
這裡主要是主要非貪婪量詞的用法, .+?"的意思是匹配任一字元,直到遇到第一個"另外是找到匹配的組,如下x[0]require 'open-uri'open('http://railslab.newrelic.com/category/masters-interviews') do |f| s="" f.each { |line| s<<line} urls= s.scan(/"(http:\/\/content.newrelic.com\/railslab\/videos\/
Time of Update: 2018-12-07
Matz是一個專業的軟體工程師,在日本有名的open source公司netlab.JP工作,而且他在日本也是一個高姿態的open source 佈道者。他參與了幾個開源軟體項目,包括cmail,這是一個基於emacs的郵件使用者代理,完全用emacs lisp 編寫。Ruby也是他的第一個在日本以外的國家如此出名的作品。 在1993年的時候,有一次他和同事們談論關於指令碼語言(scripting
Time of Update: 2018-12-07
這幾天在學ruby, 自己寫了一個簡單的單元測試庫, 有點DSL的感覺。似乎沒有ruby的格式化, 用Lua湊合一下吧。sample code:Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
從陌生,到有了初步認識;從閱讀到動手實踐,想說,你很美!Ruby 是一種純粹的物件導向的指令碼語言,它由日本的 Yukihiro Matsumoto 開發。設計這種語言主要是用來控制文本處理(和Regex又有關係了)和系統管理任務。轉自IBM:用 Ruby 語言編程正如下面的樣本所示,任何曾經編寫過如 Perl 或 PHP 等指令碼語言的人都會熟悉 Ruby 文法。但是,Perl 或 PHP 需要使用分號作為一個行結束符,Ruby