forked from otobrglez/webruby
/
index.html
351 lines (330 loc) · 12.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
<!DOCTYPE html>
<html>
<head>
<title>Programming for the Web with Ruby</title>
<meta charset="utf-8" >
<meta name="author" content="Satish Talim" >
<meta name="keywords" content="programming, Ruby, Rack, Sinatra" >
<meta name="description" content="A Ruby programming tutorial on topics that hopefully will help those that have some knowledge of Ruby programming to get started with web programming." >
<link rel="stylesheet" href="stylesheets/intruby.css">
</head>
<body>
<div id="content">
<h1 class="title">Programming for the Web with Ruby</h1>
<hr />
<div id="table-of-contents">
<p><b><a href="http://rubylearning.org/class/course/view.php?id=81">REGISTER FOR THIS COURSE.</a></b></p>
<p><b>Please note</b>: We never share your personal information. Please see our <a href="privacy.html" target="_blank">Privacy Policy</a> for more information.</p>
<h2>Sponsors</h2>
<p>Support us by making a donation of whatever amount you find suitable, so that people from across the globe can learn Ruby programming for free. There are costs involved in developing course-ware, writing eBooks, hosting and maintaining the site and over time it gets expensive. Click on the Donate link below.</p>
<div id="paypal">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p><input type="hidden" name="cmd" value="_s-xclick" /></p>
<p><input type="hidden" name="hosted_button_id" value="Z8P9TENNQ7VWN" /></p>
<p><input type="image" src="images/btn_donate_150wx70h.gif" style="border: 0px none ;" name="submit" alt="PayPal - The safer, easier way to pay online." /></p>
</form>
</div>
<p>We have so far collected <b>US$ 225</b> only.</p>
<h2>Foreword</h2>
<p>Web-based applications offer numerous advantages, such as instant access, automatic upgrades, and opportunities for collaboration on a massive scale. However, creating Web applications requires different approaches than traditional applications and involves the integration of numerous technologies. RubyLearning.org has scheduled a free, online course on topics that hopefully will help those that have some knowledge of Ruby programming to get started with web programming - call it "Programming for the Web with Ruby" (this does not cover Ruby on Rails). The course material is almost ready and I am looking for help from you to add / subtract / modify the topics and material for this course. We also require many problems/solutions for the course participants. Can you help?</p>
<p>The course is scheduled for 20th Feb. 2012 and we would have 3-4 mentors helping out the participants during the course.</p>
<h2>Contributing to this project</h2>
<ul>
<li>The best ways to start contributing to this project is by opening an issue and mentioning whatever bugs / typos you have discovered.</li>
<li>You can just fork the <a href="https://github.com/SatishTalim/webruby">repository</a> and add things relevant to web programming in Ruby. Michael or Satish can commit your pull requests.</li>
</ul>
<h2>Course Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="chapter1.html">Day 1 - Git, GitHub, RVM, Pik, Gem, Heroku, Bundle (the basics)</a></li>
<li>Using Git
<ul>
<li>What's Version Control</li>
<li>What's Git?
<ul>
<li>Downloading and Installing Git</li>
<li>Create a local folder</li>
<li>Let us start using Git</li>
<li>Introduce yourself to Git</li>
<li>Create your SSH Key</li>
</ul>
</li>
</ul>
</li>
<li>Using GitHub
<ul>
<li>What's GitHub?
<ul>
<li>Set up your GitHub account</li>
<li>Creating a new repository</li>
<li>Add your SSH key to GitHub</li>
</ul>
</li>
</ul>
</li>
<li>Using RVM (for *nix)
<ul>
<li>What is RVM?</li>
<li>Prerequisites</li>
<li>Installing RVM</li>
<li>Loading RVM into your shell</li>
<li>Reload shell configuration and test</li>
<li>Install a Ruby interpreter</li>
</ul>
</li>
<li>Using pik (for Windows)
<ul>
<li>What's pik?</li>
<li>Installing pik</li>
<li>Using pik</li>
</ul>
</li>
<li>What's a Ruby Gem?</li>
<li>What's Heroku?
<ul>
<li>Create an account on Heroku</li>
</ul>
</li>
<li>Install Bundle</li>
<li>Exercise: URL of your GitHub repo</li>
<li>Fun Exercise: Watching Repos</li>
<li><a href="chapter2.html">DAY 2</a></li>
<li>Creating a simple webpage using HTML5, CSS and JavaScript
<ul>
<li>A Webpage, Step by Step</li>
<li>Before we begin, Launch a Text Editor
<ul>
<li>Step 1: Start with content</li>
<li>Step 2: Give the document structure</li>
<li>Step 3: Identify text elements</li>
<li>Step 4: Add an image</li>
<li>Step 5: Change the look with a style sheet</li>
<li>Add some JavaScript</li>
</ul>
</li>
</ul>
</li>
<li>Store your webpage files on GitHub</li>
<li>Exercise: URL of GitHub repo for your webpage</li>
<li><a href="chapter3.html">DAY 3</a></li>
<li>Understanding HTTP concepts
<ul>
<li>What's HTTP?
<ul>
<li>Loading a web page</li>
</ul>
</li>
<li>HTTP request methods (verbs)
<ul>
<li>GET</li>
<li>POST</li>
<li>PUT</li>
<li>DELETE</li>
</ul>
</li>
<li>Using cURL</li>
<li>HTTP response codes</li>
<li>cURL Exercise</li>
<li>net/http library
<ul>
<li>Using URI</li>
</ul>
</li>
<li>Using open-uri</li>
<li>Using Hpricot</li>
<li>Using Nokogiri
<ul>
<li>Fetching documents from web</li>
<li>Searching inside HTML documents</li>
</ul>
</li>
</ul>
</li>
<li>Exercise: Using net/http library and URI, open-uri, Hpricot, Nokogiri</li>
<li><a href="chapter4.html">DAY 4</a></li>
<li>Creating one's own Ruby Gem
<ul>
<li>Let us create a simple Ruby library</li>
<li>Steps for publishing our gem</li>
</ul>
</li>
<li>Exercise - Create your gem</li>
<li>Deleting your gem at Rubygems.org</li>
<li><a href="chapter5.html">DAY 5 and 6</a></li>
<li>Learning Rack
<ul>
<li>Revisiting Ruby's proc object
<ul>
<li>my_proc1.rb</li>
</ul>
</li>
<li>Rack Documentation</li>
<li>Rack Source Code</li>
<li>Why Rack is important</li>
<li>Rack Specification
<ul>
<li>A Rack App without using the Rack gem
<ul>
<li>A simple Rack app - my_rack_proc</li>
<li>my_rack_proc.rb</li>
<li>A Simple Rack Exercise</li>
</ul>
</li>
</ul>
</li>
<li>Installing Rack gem
<ul>
<li>my_rack_proc2.rb</li>
<li>Another Rack app - my_method
<ul>
<li>my_rack2.rb</li>
</ul>
</li>
<li>A Simple Rack Exercise with rack gem</li>
</ul>
</li>
<li>Using rackup
<ul>
<li>my_app.rb</li>
<li>Exercise: A Simple Rack app with rackup</li>
<li>Using Rack::Request and Rack::Response</li>
<li>A very basic practical Rack app</li>
<li>Another practical Rack app</li>
<li>Exercise: An app using Rack::Request and Rack::Response</li>
<li>Rack middleware</li>
<li>An Exercise on Rack middleware</li>
<li>Using Lobster</li>
</ul>
</li>
<li>Rack::Builder</li>
<li>More on Rack</li>
</ul>
</li>
<li><a href="chapter6.html">DAY 7</a></li>
<li>Deploying Pure Rack Apps to Heroku
<ul>
<li>Deploy your app to Heroku</li>
<li>Exercise on deployment</li>
</ul>
</li>
<li><a href="chapter7.html">DAY 8</a></li>
<li>Deploying a static webpage to Heroku</li>
<li>Exercise: Deploy your static site to Heroku</li>
<li><a href="chapter8.html">DAY 9</a></li>
<li>What's JSON?</li>
<li>Using MongoDB with Ruby Mongo driver
<ul>
<li>What's NoSQL?</li>
<li>What's MongoDB?</li>
<li>Setup MongoDB</li>
<li>MongoDB Core Concepts</li>
<li>The Basics
<ul>
<li>Switch databases</li>
<li>Insert a document</li>
<li>Use find()</li>
<li>Removing all documents</li>
<li>Query Selectors</li>
<li>Updating a document</li>
</ul>
</li>
<li>MongoDB Ruby Driver - mongo
<ul>
<li>Installation</li>
<li>Using the mongo gem</li>
<li>Making a Connection</li>
<li>Getting a List Of Collections</li>
<li>Getting a Collection</li>
<li>Inserting a Document</li>
<li>Updating a Document</li>
</ul>
</li>
<li>MongoHQ the hosted database
<ul>
<li>Sign Up</li>
<li>Create a database</li>
<li>Accessing the database</li>
<li>Exercise: Create a database on MongoHQ<li>
</ul>
</li>
</ul>
</li>
<li><a href="chapter9.html">DAY 10</a></li>
<li>Sinatra with MongoDB
<ul>
<li>What's Sinatra?</li>
<li>Create a folder on your hard disk</li>
<li>Install Sinatra</li>
<li>Which web server?</li>
<li>Our trivial Sinatra application</li>
<li>ERB and View
<ul>
<li>ERB</li>
<li>View</li>
<li>Handlers and Form parameters</li>
</ul>
</li>
<li>Exercise: A simple text reversing service</li>
<li>Deploy a Sinatra app to Heroku</li>
<li>Exercise: Deploy the simple text reversing service app to Heroku</li>
<li>Sinatra and Rack Middleware</li>
<li>Sinatra and Rack HTTP Basic Authentication</li>
<li>References</li>
</ul>
</li>
</ul>
</div>
</div>
<h2>Acknowledgments</h2>
<ul>
<li><a href="https://github.com/jasnow">Al Snow</a> for his various suggestions.</li>
<li><a href="https://github.com/punjab">Arvinder Singh Kang</a> for beautifying the css and for the note on "Using RVM"</li>
<li><a href="https://github.com/rkh">Konstantin Haase</a> for providing us with another practical Rack app.</li>
<li><a href="https://github.com/mattetti">Matt Aimonetti</a> for the GET/POST example related to Rack.</li>
<li><a href="https://github.com/citizen428">Michael Kohl</a> for proof reading and making relevant corrections to chapters 1 and 2.</li>
<li><a href="https://github.com/otobrglez">Oto Brglez</a> for the note on "Using Nokogiri"</li>
<li><a href="https://github.com/samnang">Samnang Chhun</a> for suggesting changes in chapter 1.</li>
<li><a href="https://github.com/kotp">Victor Goff</a> for his various suggestions.</li>
<li><a href="https://github.com/PotHix">Willian Molinari</a> for creating the GitHub page for this project.</li>
<li><a href="https://github.com/zhhailon">Zhang Hailong</a> for making relevant corrections in chapter 2.</li>
</ul>
<h2>About RubyLearning.org</h2>
<p><a href="http://rubylearning.org/">RubyLearning.org</a>, since 2005, has been helping Ruby Newbies go from zero to awesome!</p>
<h2>Copyright and license</h2>
<p>Intermediate Ruby Tutorial: Preparing Ruby newbies for web programming. Copyright @ 2012 by Satish Talim. All source code in Programming for the Web with Ruby Tutorial is available under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT License</a> and the <a href="http://en.wikipedia.org/wiki/Beerware">Beerware License</a>.</p>
<pre>
Copyright (c) 2012 RubyLearning.org
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
/*
* ------------------------------------------------------------
* "THE BEERWARE LICENSE" (Revision 42):
* Satish Talim wrote this file. As long as you retain this
* notice, you can do whatever you want with this stuff. If we
* meet someday, and you think this stuff is worth it, you can
* buy me a beer in return.
* ------------------------------------------------------------
*/
</pre>
<div id="footer">
<p>© 2006-2012 <strong>RubyLearning.org - Programming for the Web with Ruby</strong> Page Updated: 21st Jan. 2012</p>
</div>
</div>
</body>
</html>