Skip to content

Commit 95ea35c

Browse files
committed
Imported the "zh_TW" content.
1 parent 4cda973 commit 95ea35c

File tree

29 files changed

+2678
-1
lines changed

29 files changed

+2678
-1
lines changed

index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
'ko': 'ko',
2323
'pl': 'pl',
2424
'tr': 'tr',
25-
'zh_cn': 'zh_cn'
25+
'zh_cn': 'zh_cn',
26+
'zh_TW': 'zh_TW'
2627
};
2728

2829
var language = languages[window.navigator.language];

zh_TW/about/index.md

+176
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
---
2+
layout: page
3+
title: "關於 Ruby"
4+
lang: zh_TW
5+
---
6+
7+
想知道Ruby為何如此受歡迎嗎? 為什麼它的支持者會稱它是個美麗、靈巧而且方便又實用的程式語言?
8+
9+
### Ruby 發明者的理想
10+
11+
![](http://redhanded.hobix.com/images/ruby-lang-matz.png){:
12+
style="padding-left:8px;"}
13+
{: style="float:right"}
14+
15+
Ruby 是一個注重均衡的語言. 它的發明者, [松本行弘 Yukihiro “matz” Matsumoto][1], 混合了他喜歡的語言
16+
(如 Perl, Smalltalk, Eiffel, Ada, and Lisp) 產生了一個具有函數式與指令式程式設計語言特性的新語言。
17+
18+
他常說他是: “試著讓 Ruby 更為自然,而不是簡單”,就像生活一樣。
19+
20+
除此之外, 他還提到:
21+
22+
> Ruby 就像人的身體一樣,表面上看來簡單,但是內在卻是相當的複雜,\[1\].
23+
24+
### Ruby 的成長
25+
26+
自從在 1995 年公開發表以來, Ruby 在全球吸引了許多忠實的程式設計師. 在 2006 年, Ruby 被廣泛的接受.
27+
在各大城市都有活躍的使用者社群並舉辦了許許多多場場爆滿的研討會.
28+
29+
![Graph courtesy of
30+
Gmane.](http://gmane.org/plot-rate.php?group=gmane.comp.lang.ruby.general&width=280&height=140&title=Ruby-Talk+Activity+over+4+Years
31+
"Graph courtesy of Gmane."){: style="padding-left:8px;"}
32+
{: style="float:right"}
33+
34+
在主要的 [郵件論壇: Ruby-Talk](/en/community/mailing-lists/) 上,討論 Ruby
35+
語言的文章爬升到每日 200 封.
36+
37+
[TIOBE 的最流行開發語言排名調查][2]中, Ruby 排名為全球第 11. 根據這樣的成長情況, 他們預測 “在半年之中 Ruby
38+
將會進入最受歡迎的第 10 名.” 有越來越多受歡迎的軟體如 Ruby on Rails web
39+
framework<sup>[2](#fn2)</sup> 是使用 Ruby 撰寫而成,也是造成了 Ruby 如此的成長因素.
40+
41+
同時,Ruby 是個[自由軟體](/zh_TW/about/license.txt). 不只是免費,而且可以自由的使用, 修改與散佈.
42+
43+
### 所見即物件
44+
45+
最初,Matz 從其他語言中找尋理想的語法。 想起他做的研究,他說:”我想要一個比 Perl 更強大,比 Python 更物件導向的
46+
scripting language \[3\]”.
47+
48+
在 Ruby 中,所有的東西都是個物件。所有的資訊與程式碼都可以給與他們所擁有的 屬性(properties) 與 行為(actions)
49+
。物件導向程式設計中稱屬性為 *實體變數*(*instance variables*) 而行為稱為
50+
*方法*(*methods*)。從下列程式碼中看到 Ruby 能夠給 “數字(number)” 賦予 “行為(actions)”
51+
這特點來看,可以證明 Ruby 是個純物件導向的語言。
52+
53+
5.times { print "We *love* Ruby -- it's outrageous!" }
54+
{: .code .ruby-code}
55+
56+
在許多的語言中,數字與其他的原生資料型態(primitive types) 都不是物件。 而 Ruby 受到了 Smalltalk
57+
語言讓所有的資料型態都可賦予方法與產生實體變數的影響。更進而讓這規則適用於 Ruby 中所有物件。
58+
59+
### Ruby 的彈性
60+
61+
Ruby 是個相當具有彈性的語言, 它可以讓使用者自由的去改變它的本身。 Ruby
62+
的必要部份也可以隨意地被移除或重新定義。已存在的部份也可以被繼續添加內容。Ruby 試著不去限制程式設計人員。
63+
64+
舉例而言,我們使用 (`+`) 運算元來執行加法。但是如果你打算使用 `plus` 來取代,你可以加入以下的方法到 Ruby 的內建
65+
`Numeric` 類別之中。
66+
67+
class Numeric
68+
  def plus(x)
69+
    self.+(x)
70+
  end
71+
end
72+
73+
y = 5.plus 6
74+
# y is now equal to 11
75+
{: .code .ruby-code}
76+
77+
Ruby 的運算元其實就是個方法(method)\[4\]。你也可以重新定義運算元。
78+
79+
### 區塊(Blocks), 很有意思的功能
80+
81+
Ruby 的區塊可說是它強大彈性的來源。 程式設計師可以為任何的 method 加上 closure(閉包) , 來描述這個 method
82+
該做什麼。此處的 closure 稱為 *block* 同時這也是從指令式程式設計語言如 PHP 或 Visual Basic 轉換到 Ruby
83+
的新手最喜歡的功能。
84+
85+
Block 的靈感是由函數式程式設計語言而來。Matz 說到:”在 Ruby closures 之中, 我要向 Lisp culture
86+
致敬\[5\].”
87+
88+
search_engines =
89+
  %w[Google Yahoo MSN].map do |engine|
90+
    "http://www." + engine.downcase + ".com"
91+
  end
92+
{: .code .ruby-code}
93+
94+
在上方的程式碼中,block 是在 `do ... end` 之間。其中 `map` method 提供一個字串陣列給 block。Ruby
95+
中還有許多其他的 methods 提供了類似的方式可以讓程式設計師撰寫自己的 block 來完成此 method 該做的事。
96+
97+
### Ruby 與 Mixin
98+
99+
和其他許多的物件導向語言不同,Ruby 故意的只提供 單一繼承(single inheritance)。但是 Ruby 提供
100+
模組(module) 的觀念(在 Objective-C 中稱為 Categories)。 Module 是許多 method 的集合。
101+
102+
類別(Class) 可以 混入(mixin) 模組並且可以自由的取用模組內的所有方法。舉例而也,所有要實作 `each` 方法的類別都可以 混入
103+
`Enumerable` 模組進來,就可以使用 `each` 方法來達到執行迴圈的目的。
104+
105+
class MyArray
106+
  include Enumerable
107+
end
108+
{: .code .ruby-code}
109+
110+
一般來說,Ruby 使用者使用這種方式會比使用複雜且有很多限制的多重繼承來得清楚。
111+
112+
### Ruby 的面貌
113+
114+
Ruby 常使用某些符號與英文關鍵字來輔助撰寫程式。Ruby 不需要事先宣告變數。它使用簡單的命名規則來說明變數的生命範圍。
115+
116+
* `var` 表示變數是個 區域變數(local variable).
117+
* `@var` 表示變數是個 實體變數(instance variable).
118+
* `$var` 表示變數是個 全域變數(global variable).
119+
120+
這些符號讓程式設計師可以輕易的定義每個變數的角色進而增加了程式的易讀性。另外 Ruby 也省略了累贅的 `self.`
121+
方便直接來存取每個實體成員。
122+
123+
### 更上一層樓
124+
125+
Ruby 還具有以下的特點:
126+
127+
* Ruby 具有 例外處理(exception handling) 的能力。就如 Java 或 Python
128+
一樣,可以讓使用者輕鬆的處理錯誤狀況。
129+
^
130+
131+
* Ruby 對於所有的物件具有一個真正的 標記-清除(mark and sweep) 式的垃圾收集器(garbage
132+
collector)。使用者不必去維護擴充函式庫中的 參考計數器(reference counts)。如 Matz說的:”這樣有益健康”。
133+
^
134+
135+
* 在 Ruby 中撰寫 C 的擴充程式比在 Perl 或 Python 中方便,它擁有許多方便的 API 可以讓 C 呼叫
136+
Ruby。這樣可以將 Ruby 當成 script language 嵌入到其他軟體之中。它也具有 SWIG 的呼叫界面。
137+
^
138+
139+
* 如果作業系統支援,Ruby 可以動態的載入擴充函式庫。
140+
^
141+
142+
* Ruby 具有與作業系統無關的多緒(threading)能力。可以在所有可以執行 Ruby
143+
的平台上都能夠達到多緒的目標,而不必管作業系統是否支援,就算是 MS-DOS 也行。
144+
^
145+
146+
* Ruby 具有高度的移植性:它大部份是在 GUN/Linux 上發展出來,但是可以執行於多種的作業系統如: UNIX, MAC OS
147+
X,Windows 95/98/Me/NT/2000/XP, DOS, BeOS, OS/2, 等等。
148+
149+
#### 參考資料
150+
151+
<sup>1</sup> Matz, 於 Ruby-Talk 郵件論壇上的發言, [May 12th, 2000][3].
152+
{: #fn1}
153+
154+
<sup>2</sup> 請參考 [Ruby on Rails][4] 官方首頁有更多資料.
155+
{: #fn2}
156+
157+
<sup>3</sup> Matz, in [An Interview with the Creator of Ruby][5], Nov.
158+
29th, 2001.
159+
{: #fn3}
160+
161+
<sup>4</sup> 原文直譯:運算元是方法的語法糖衣(syntactic sugar),Ruby’s operators are
162+
syntactic sugar for methods.
163+
{: #fn4}
164+
165+
<sup>5</sup> Matz, in [Blocks and Closures in Ruby][6], December 22nd,
166+
2003.
167+
{: #fn5}
168+
169+
170+
171+
[1]: http://www.rubyist.net/~matz/
172+
[2]: http://www.tiobe.com/index.htm?tiobe_index
173+
[3]: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/2773
174+
[4]: http://rubyonrails.org/
175+
[5]: http://www.linuxdevcenter.com/pub/a/linux/2001/11/29/ruby.html
176+
[6]: http://www.artima.com/intv/closures2.html

zh_TW/about/license.txt

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
RUBY LICENSE
2+
3+
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.co.jp>.
4+
You can redistribute it and/or modify it under either the terms of the GPL
5+
(see COPYING.txt file), or the conditions below:
6+
7+
1. You may make and give away verbatim copies of the source form of the
8+
software without restriction, provided that you duplicate all of the
9+
original copyright notices and associated disclaimers.
10+
11+
2. You may modify your copy of the software in any way, provided that
12+
you do at least ONE of the following:
13+
14+
a) place your modifications in the Public Domain or otherwise
15+
make them Freely Available, such as by posting said
16+
modifications to Usenet or an equivalent medium, or by allowing
17+
the author to include your modifications in the software.
18+
19+
b) use the modified software only within your corporation or
20+
organization.
21+
22+
c) rename any non-standard executables so the names do not conflict
23+
with standard executables, which must also be provided.
24+
25+
d) make other distribution arrangements with the author.
26+
27+
3. You may distribute the software in object code or executable
28+
form, provided that you do at least ONE of the following:
29+
30+
a) distribute the executables and library files of the software,
31+
together with instructions (in the manual page or equivalent)
32+
on where to get the original distribution.
33+
34+
b) accompany the distribution with the machine-readable source of
35+
the software.
36+
37+
c) give non-standard executables non-standard names, with
38+
instructions on where to get the original software distribution.
39+
40+
d) make other distribution arrangements with the author.
41+
42+
4. You may modify and include the part of the software into any other
43+
software (possibly commercial). But some files in the distribution
44+
are not written by the author, so that they are not under this terms.
45+
46+
They are gc.c(partly), utils.c(partly), regex.[ch], st.[ch] and some
47+
files under the ./missing directory. See each file for the copying
48+
condition.
49+
50+
5. The scripts and library files supplied as input to or produced as
51+
output from the software do not automatically fall under the
52+
copyright of the software, but belong to whomever generated them,
53+
and may be sold commercially, and may be aggregated with this
54+
software.
55+
56+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
57+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
58+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
59+
PURPOSE.

zh_TW/community/conferences/index.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
layout: page
3+
title: "Ruby 研討會"
4+
lang: zh_TW
5+
---
6+
7+
全世界有越來越多的研討會讓 Ruby 程式設計師可以參與,分享他們的工作經驗、討論 Ruby 的未來,同時也歡迎新成員的加入。
8+
9+
### 主要的 Ruby 大會
10+
11+
[RubyConf][1]
12+
: 自 2001 年開始,每年由 [Ruby Central, Inc.][2] 主辦的國際性 Ruby 大會。參加的人數從 2001 到
13+
2006 有十倍的成長。RubyConf 提供了各種 Ruby 相關技術的發表機會,例如 Test Unit 函式庫的作者
14+
Nathaniel Talbott、Rake 的作者 Jim Weirich、Ruby on Rails 的創造者 David
15+
Heinemeier Hansson、YAML 函式庫作者 Why the Lucky Stiff 以及 YARV 的作者 Sasada
16+
Koichi on YARV。當然,還有 Ruby 發明人 Matz 也會在這裡演講。
17+
18+
[RubyKaigi][3]
19+
: 自 2006 年開始的日本 Ruby 大會,由 [日本Rubyの会][4] 主辦。”Kaigi” 日文”研討會”的意思。RubyKaigi
20+
有非常多的新鮮又有趣的演講,當然也包括了 Matz 的演講。
21+
22+
[EuRuKo][5]
23+
: 自 2003 年開始的歐洲 Ruby 大會 - European Ruby Conference
24+
(EuRuKo)。第一次主辦在德國的卡爾斯魯厄(Karlsruhe)。由一群德國的 Ruby 愛好者,包括 Armin
25+
Roehrl、Michael Neumann 等所主辦。EuRuKo 逐漸成長為 Ruby 世界的第二大年度盛事。
26+
27+
[RubyConf Taiwan][6]
28+
: 自 2010 年起,由 [Ruby Taiwan][7] 社群主辦,為台灣唯一的 Ruby 程式語言年會,目標對象為所有 Ruby 相關的
29+
IT 技術人員、系統管理員及程式開發者,並邀請來自國內外專業講者來分享他們的專案及經驗。
30+
31+
[OSDC.TW][8]
32+
: 這是台灣的年度開放原碼開發者大會。雖然主題不限於 Ruby,但是每年也都有 Ruby 的相關演講。
33+
34+
[RubyConf China][9]
35+
: 自 2009 年開始的中國 Ruby 大會,由 [ShanghaiOnRails][10] 所主辦。
36+
37+
### 地區性的 Ruby 研討會
38+
39+
[Ruby Central][2] 提供了 [地區性研討會贊助計畫][11] ,提供一些經費給地區性團體來組織活動。
40+
41+
自 2007 年起,Ruby Central 也與 [SDForum][12] 合作主辦矽谷的 Ruby 研討會。
42+
43+
[RubyNation][13] 則是美國東岸(Virginia, West Virginia, Maryland, and
44+
Washington, DC 等地區)的 Ruby 年度大會。
45+
46+
### 其他研討會
47+
48+
自 2004 年起的 [O’Reilly Open Source Conference][14] (OSCON) 研討會也包括了一整軌的
49+
Ruby 演講,並逐年增加中。也有許多研討會以 [Ruby on Rails][15] 為主題,包括了 Ruby Central 的
50+
[RailsConf][16][RailsConf Europe][17] 以及 Canada on Rails.
51+
52+
53+
54+
[1]: http://rubyconf.org/
55+
[2]: http://www.rubycentral.org
56+
[3]: http://jp.rubyist.net/RubyKaigi2008/
57+
[4]: http://jp.rubyist.net/
58+
[5]: http://euruko2010.org/
59+
[6]: http://rubyconf.tw
60+
[7]: http://ruby.tw
61+
[8]: http://osdc.tw
62+
[9]: http://rubyconfchina.org
63+
[10]: http://groups.google.com/group/shanghaionrails
64+
[11]: http://www.rubycentral.org/rcg2006.pdf
65+
[12]: http://www.sdforum.org
66+
[13]: http://rubynation.org/
67+
[14]: http://conferences.oreillynet.com/os2006/
68+
[15]: http://www.rubyonrails.org
69+
[16]: http://www.railsconf.org
70+
[17]: http://europe.railsconf.org

zh_TW/community/index.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
layout: page
3+
title: "社群"
4+
lang: zh_TW
5+
---
6+
7+
良好的社群是支持程式語言發展的一個很重要的因素。Ruby
8+
擁有了一個有活力、不斷茁壯的社群,無論是你是初學者或是程式好手,我們歡迎來自不同程度背景的朋友。
9+
10+
如果你有興趣參與,可以從這幾個地方開始:
11+
12+
[Ruby Taiwan 社群][1]
13+
: Ruby Taiwan 社群成立於2008年10月,主要是針對 Ruby
14+
程式語言及軟體開發,進行業界的交流及分享,提昇開發人員的技術深度與廣度。詳見 [關於 Ruby Taiwan][2]
15+
16+
[Ruby 使用者群組](/zh_TW//community/user-groups/)
17+
: 本地的 Ruby 使用者群組可以讓你與其他程式設計師進行交流。Ruby
18+
使用者群組都是自發性的,通常會有每月的聚會、郵件論壇以及一個社群網站。運氣好的話,也許還會有編程節 (codefests)。
19+
20+
[Ruby 郵件論壇和新聞群組](/zh_TW//community/mailing-lists/)
21+
: Ruby 擁有各種不同主題及語言的郵件論壇。如果你有 Ruby 的問題,透過論壇發問是個不錯的方式。台灣的 Ruby 論壇則有
22+
[RailsFun][3] 以及 [PTT](telnet://ptt.cc) Ruby 版。
23+
24+
[Ruby 的 IRC](irc://irc.freenode.net/ruby-lang)
25+
: 您可以在 Ruby 的 IRC 頻道上與其他 Ruby 愛好者聊天。Ruby Taiwan 的 IRC 頻道則為
26+
[irc://irc.freenode.net/ruby-tw](irc://irc.freenode.net/ruby-tw)
27+
28+
[Ruby 核心](/zh_TW/community/ruby-core)
29+
: 歡迎加入正在開發中的 Ruby 2.0。如果您有興趣幫忙,可以從這裡開始。
30+
31+
[關於 Ruby 的部落格](/zh_TW//community/weblogs/)
32+
: Ruby 社群中有著各式各樣的部落格。這裡是一份推薦清單。
33+
34+
[Ruby 研討會](/zh_TW/community/conferences/)
35+
: 全世界有越來越多的研討會讓 Ruby 程式設計師可以參與,分享他們的工作經驗、討論 Ruby 的未來,同時也歡迎新成員的加入。台灣的
36+
Ruby 年度研討會為 [RubyConf Taiwan][4]
37+
38+
39+
40+
[1]: http://ruby.tw
41+
[2]: http://ruby.tw/about
42+
[3]: http://railsfun.tw/index.php
43+
[4]: http://rubyconf.tw

0 commit comments

Comments
 (0)