|
1 | 1 | img src: "img/Start_page.png", alt: "Start Page"
|
2 | 2 |
|
3 | 3 | goals do
|
4 |
| - goal "Create Your New Application" |
5 |
| -message "Let's get started! By the end of this step, we'll have a brand-spankin'-new (empty) rails app." |
| 4 | + goal "建立你的 New Application" |
| 5 | + message "來,開始吧!在這一步驟的最後,我們會得到一個全新的(空白)Rails 應用程式。" |
6 | 6 | end
|
7 | 7 |
|
8 | 8 | steps do
|
9 | 9 |
|
10 |
| - tip "If you have _any_ problems, contact a TA immediately." |
| 10 | + tip "有*「任何」*問題,請立刻舉手問助教。" |
11 | 11 |
|
12 | 12 | step do
|
13 | 13 | insert 'switch_to_home_directory'
|
14 | 14 | end
|
15 | 15 |
|
16 | 16 | step do
|
17 | 17 | console "mkdir railsbridge"
|
18 |
| - message "This command creates a new directory for us to store our project in." |
| 18 | + message "這會新增一個資料夾,讓我們把專案放在裡面。" |
19 | 19 | end
|
20 | 20 |
|
21 | 21 | step do
|
22 | 22 | console "cd railsbridge"
|
23 | 23 | end
|
24 | 24 |
|
25 | 25 | step do
|
26 |
| - message "Check to see if you have any existing suggestotron apps from a previous workshop." |
| 26 | + message "確定一下你有沒有之前工作坊留下來的 suggestotron 應用程式在裡面" |
27 | 27 | console "ls"
|
28 |
| - message "That command will list the files in your railsbridge directory. If you have any old suggestotron apps in that list, you can remove them to prevent hiccups:" |
| 28 | + message "這指令會列出 railsbridge 資料夾裡面的檔案。如果列出了舊的 suggestotron 應用程式,你可以刪掉它們來避免干擾:" |
29 | 29 | console "rm -rf suggestotron"
|
30 | 30 | end
|
31 | 31 |
|
32 | 32 | step do
|
33 | 33 | console "rails new suggestotron"
|
34 |
| - message "'rails new' creates a new rails project with the name you give." |
35 |
| - message "In this case we told it to create a new project called `suggestotron`. We'll go into detail on what it created shortly." |
| 34 | + message "'rails new' 會用你給的名字來建立新的 Rails 專案" |
| 35 | + message "這次我們叫它建立叫做 `suggestotron` 的新專案。我們馬上就會詳述它到底建立了什麼。" |
36 | 36 | end
|
37 | 37 |
|
38 | 38 | step do
|
39 | 39 | console "cd suggestotron"
|
40 |
| - message "'cd' stands for change directory." |
41 |
| - message "'cd suggestotron' makes suggestotron our current directory." |
| 40 | + message "'cd' 指的是切換目錄 (change directory)。" |
| 41 | + message "'cd suggestotron' 把 suggestotron 資料夾設成當前資料夾。" |
42 | 42 | end
|
43 | 43 |
|
44 | 44 | step do
|
45 | 45 | console "ls"
|
46 |
| - message "'ls' stands for 'list (stuff)'." |
47 |
| - message "It shows you the contents of the current folder." |
| 46 | + message "'ls' 指的是列出東西 (list stuff)。" |
| 47 | + message "它會把目前資料夾的內容列出來給你看。" |
48 | 48 | end
|
49 | 49 |
|
50 | 50 | step do
|
51 | 51 | message <<-MARKDOWN
|
52 |
| -Open the suggestotron folder as a project in your text editor. |
| 52 | +在你的文字編輯器裡面用專案的方式打開 suggestotron 資料夾。 |
53 | 53 |
|
54 |
| -In **Sublime Text 2**, you can use the `Project > Add Folder to Project...` menu option: |
| 54 | +在 **Sublime Text 2** 裡面,你可以選擇 `Project > Add Folder to Project...`。 |
55 | 55 |
|
56 | 56 | <img src='img/sublime_add_folder_to_project.png' />
|
57 | 57 |
|
58 |
| -Select your `suggestotron` folder from the file picker that opens. If everything works out Sublime should look something like this: |
| 58 | +然後在檔案對話方塊裡面選擇 `suggestotron` 資料夾。如果一切沒問題的話,Sublime 會變得像這樣: |
59 | 59 |
|
60 | 60 | <img src='img/sublime_project_as_folder.png' />
|
61 | 61 | MARKDOWN
|
62 | 62 | end
|
63 | 63 |
|
64 | 64 | message <<-MARKDOWN
|
65 |
| - You can see that <code>rails new</code> created a lot directories and |
66 |
| - files. The ones we want to focus on today are: |
| 65 | + 你會發現 <code>rails new</code> 開了一大堆資料夾和檔案。今天我們要看的是這些: |
67 | 66 | MARKDOWN
|
68 | 67 |
|
69 | 68 | table border: "1", cellspacing: "0", cellpadding: "3", align: "center" do
|
70 | 69 | tr {
|
71 |
| - th "File/Folder" |
72 |
| - th "Purpose" |
| 70 | + th "檔案/資料夾" |
| 71 | + th "用途" |
73 | 72 | }
|
74 | 73 | tr {
|
75 | 74 | td "app/"
|
76 |
| - td "Contains the controllers, models, and views for your application. You will do most of your work here." |
| 75 | + td "包含你應用程式的 controllers、models、views。你要改的東西大多是這些。" |
77 | 76 | }
|
78 | 77 | tr {
|
79 | 78 | td "config/"
|
80 |
| - td "Configure your application's runtime rules, routes, database, and more." |
| 79 | + td "設定應用程式的執行階段規則、路由設定(routes)、資料庫等等。" |
81 | 80 | }
|
82 | 81 | tr {
|
83 | 82 | td "db/"
|
84 |
| - td "Shows your current database schema, as well as the database migrations." |
| 83 | + td "顯示你目前資料庫的 schema(結構定義),以及資料庫的 migrations。" |
85 | 84 | }
|
86 | 85 | tr {
|
87 | 86 | td "public/"
|
88 |
| - td "The only folder seen to the world as-is. If you put files in here, they will be served directly without any processing by Rails." |
| 87 | + td "這是唯一一個資料夾會是放什麼就出現什麼的。如果你把檔案放裡面,server 會直接回傳,不會經過 Rails 的處理。" |
89 | 88 | }
|
90 | 89 | tr {
|
91 | 90 | td "app/assets/"
|
92 |
| - td "This is where your images, JavaScript, stylesheets (CSS), and other static files should go. Modern rails apps use something called the Assets Pipeline, which combines all the JavaScript and CSS files in this directory into a single file for speediness." |
| 91 | + td "你會要把圖片、JavaScript、stylesheets (CSS) 還有其他靜態檔案放在裡面。現代的 Rails 應用程式使用一種叫做 Assets Pipeline 的東西,把在這資料夾裡面的所有 JavaScript 和 CSS 檔合併成一個檔案來加速。" |
93 | 92 | }
|
94 | 93 | end
|
95 | 94 |
|
96 |
| - message "There is a lot more that `rails new` created. Probably enough to fill a book, so we're going to ignore them for now." |
| 95 | + message "`rails new` 還建立了其他很多東西。大概可以寫一本書來講,所以我們現在先無視它們。" |
97 | 96 | end
|
98 | 97 |
|
99 | 98 | next_step "add_the_project_to_a_git_repo"
|
0 commit comments