Time of Update: 2014-10-13
標籤:style ar 檔案 on ad ef size as 程式 classtrace.rb: #encoding: utf-8module ClassTrace T = [] #
Time of Update: 2014-10-06
標籤:style color sp c r bs as 對象 測試 操作符 含義== 測試值是否相等==== 用來比較ca
Time of Update: 2014-10-03
標籤:style blog http color io ar for sp div 直接上代碼:module Action def jump @distance = rand(4) +
Time of Update: 2014-10-02
標籤:style blog color io 使用 ar for sp div Ruby繼承的文法class DerivedClass < BaseClass #some
Time of Update: 2014-10-02
標籤:style blog color 使用 java sp div c on Ruby是一種物件導向程式設計語言,這意味著它操縱的編程結構稱為"對象"先上代碼,
Time of Update: 2014-09-23
標籤:io ar div sp on c ad ef r 有時候看源碼的時候看到類名之間存在<.<=操作,頓時一頭霧水,類名之間也可以比較嗎?查了下api,豁然開朗Class的父類是
Time of Update: 2014-09-23
標籤:style blog http 使用 ar strong for 2014 sp 在ruby中使用format(或
Time of Update: 2014-09-12
標籤:style blog color 使用 ar div sp 代碼 log ruby中的alias和alias_method都可以重新命名一個方法,它們的區別如下:
Time of Update: 2014-09-07
標籤:ruby on rails上傳報錯Encoding::UndefinedConversionError in ProductsController#create"\xFF" from ASCII-8BIT to UTF-8在使用ruby1.9.3做上傳照片的時候,報這個錯誤,解決辦法是將控制器裡的File.open("#{Rails.root}/app/assets/images/"+new_name, "w") { |file|
Time of Update: 2014-09-04
標籤:ruby安裝安裝ruby on rails 的步驟應該是先安裝ruby,然後安裝devkit,之後安裝rails;但我安裝的時候是安裝完ruby後直接安裝rails所以報錯了,我以我的錯誤路線為順序記錄下整個過程,以便有遇到同樣問題的人可以參考,我就是菜鳥,沒太多花哨的東西,遇到什麼,怎麼解決的,記錄下以備後用;安裝rubyhttps://www.ruby-lang.org/en/downloads/安裝時有三個勾選的,全選了650) this.width=650;" src="http:
Time of Update: 2014-09-03
標籤:http os 使用 java ar 檔案 art div 代碼 訪問http://www.ruby-lang.org/en/downloads/ 使用第三方工具安裝ruby,經
Time of Update: 2014-08-05
標籤:ansible 安裝ruby ansible playbook ruby ansible install ruby ansible playbook
Time of Update: 2014-08-03
標籤:style blog http color 使用 os io for http://rvm.io/rvm/install Install RVM (development version):\curl -sSL
Time of Update: 2014-07-29
標籤:style blog color strong 問題 div new size ruby中的方法調用都是 對象.方法
Time of Update: 2014-07-28
標籤:style blog color strong div ar new log ruby中的私人方法是指方法只能被隱含調用,不能被顯示調用。而當沒有顯示接收者的時候,會把self當成接收者。因此,只能在自身中調用私人方法
Time of Update: 2014-07-22
標籤:style blog http java color 使用 先看一道題,這道題是codewars上的一道題,我很早就看到了,但是不會寫。等到又看到這道題的時候,我剛看完元編程那本書,覺得是可以搞定它的時候了。廢話不多說,先看這道題,題目最開始是為JavaScript寫的,但是也放在了r
Time of Update: 2014-07-21
標籤:style blog http color os 檔案 強烈推薦線上學習網站:http://tryruby.org/筆記:Ruby會預設返回方法中的最後一個值。如果需要返回多個值,可以用數組來實現。可以通過強制聲明return來傳回值。基礎的輸出方法是用puts(輸出一行),print(直
Time of Update: 2014-07-10
標籤:使用 代碼 line div 學習 re 變數在ruby的世界裡,變數有5種,全域變數 局部變數 執行個體變數 常量 類變數以及偽變數常用的:全域:在全域使用,使用$開頭,因為是全域的,所以在任何的代碼例子中都可以改變其值,造成混亂,所以不建議使用。局部:在一定範圍內有作用。如 i = 1
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: 2014-10-18
部署Ruby伺服器,部署ruby# 建立項目相關目錄/opt/logs/tv-cibn-cms#ruby 使用者下安裝 rbenv 及 ruby 1.9.3# 安裝編譯相關包yum install -y gcc openssl-devel libyaml-devel readline-devel zlib-develsu - ruby #/home/ruby# 安裝 rbenvgit clone https://github.com/sstephenson/rbenv.git ~/.