Time of Update: 2014-10-09
標籤:ruby on rails win7 Ruby on Rails 在window平台各種坑,配置過程相當痛苦。預計安裝內容:mysql server ruby 2.0.0rails 4.0.2mysql2
Time of Update: 2014-07-08
標籤:singleton design pattern instance ruby Singleton is one design pattern in the software engineering. Ruby has its own special feature to declare singleton class. I will
Time of Update: 2014-07-02
標籤:blog http java 使用 檔案 os 1.前言
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-27
標籤:des style blog code java http 構造字串字面量方法一:最簡單的使用單引號或者雙引號括起來的字串,比如"hello"。方法二:使用%q配合分界符,%q代表單引號str=%q!he/lo!方法三:使用%Q配合分界符,%Q代表雙引號str=%Q{he/lo
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-10-02
標籤:style blog color os 使用 ar sp div c 我們可以認為module是一個專門存放一系列方法和常量的工具箱。module和class非常像,
Time of Update: 2014-10-01
標籤:rails總共分為11章節,一個簡單的微博系統。完全是以測試去驅動開發,所以書裡面有很多測試代碼,剛開始會覺得很不習慣,然後過了一段時間後,還是不習慣這樣的開發方式。最後選擇以自己的方式來整理書裡面的知識點。也就是說,我把開發的部分,跟測試部分,區分開來。後面想了下,覺得知識點可以分為以下4點。1.git的使用初始化項目 git init新增內容 git add .提交到本地倉庫 git commit -m "備忘"提交到遠程分支 git push拉取內容 git pull查看分支
Time of Update: 2014-09-23
標籤:ar strong for sp art cti on c amp In Ruby, you check with nil? if an object is
Time of Update: 2014-09-16
標籤:des style blog http color io os 使用 java 零、Ubuntu的安裝官網下載,我裝的是12.04的x64版。 一、系統升級更換ubuntu的源1
Time of Update: 2014-09-11
標籤:ruby rails 模型 命令列 前幾天學習rails的時候用的是IDE開發,沒感覺出來rails的效率到底有多快。今天我使用命令列試了下,結果我驚呆了,在沒有寫一行代碼的情況下,居然完成了一個簡單的增刪改查的模型。 如下:首先是配置環境我這裡就不羅嗦了。執行命令:rails new blog
Time of Update: 2014-09-04
標籤:strong ar for art cti sp on amp c In Ruby, you check with nil? if an object is
Time of Update: 2014-08-18
標籤:style http 使用 os strong 檔案 ar html require、load、autoload是Kernel模組中定義的方法,由於Class類和Object類都混入了Kernel模組,所以無論
Time of Update: 2014-08-11
標籤:style http color 使用 os io strong for 對於新入門的開發人員,怎樣安裝 Ruby, Ruby Gems 和 Rails 的執行環境可能會是個問題,本頁主要介紹怎樣用一條靠譜的路子高速安裝
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: 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的數組可以適應不同的物件類型 ruby> ary = [1, 2, "3"] [1, 2, "3"] 就像前面提到的字串一樣.數組也可以相乘或相加 ruby> ary + ["foo", "bar"] [1, 2, "3", "foo", "bar"] ruby> ary * 2 [1, 2, "3", 1, 2, "3"] 我們可用索引來訪問數組的任意一部分. ruby>
Time of Update: 2018-12-08
Ruby將字串像數字一樣處理.我們用單引號('...')或雙引號("...")將它們括起來.ruby> "abc" "abc"ruby> 'abc' "abc"單引號和雙引號在某些情況下有不同的作用.一個由雙引號括起來的字串允許字元由一個前置的斜杠引出,而且可以用#{}內嵌運算式.而單引號括起來的字串並不會對字串作任何解釋;你看到的是什麼便是什麼.幾個例子:ruby> print "a\nb\nc","\n"ac nilruby> print 'a\nb\n'
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