forked from bitmakerlabs/learn_ruby_rspec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
224 lines (169 loc) · 11.4 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
<html>
<head>
<title>Test-First Teaching: learn_ruby: learn_ruby</title>
<link href="assets/style.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="header">
<h1><a href="http://testfirst.org">TestFirst.org</a></h1>
<h2>the home of test-first teaching</h2>
</div>
<div class="nav">
<h2><a href="index.html">learn_ruby</a></h2>
<b>Labs:</b>
<ul>
<li><a href="00_hello/index.html">00 Hello</a></li>
<li><a href="01_temperature/index.html">01 Temperature</a></li>
<li><a href="02_calculator/index.html">02 Calculator</a></li>
<li><a href="03_simon_says/index.html">03 Simon Says</a></li>
<li><a href="04_pig_latin/index.html">04 Pig Latin</a></li>
<li><a href="05_silly_blocks/index.html">05 Silly Blocks</a></li>
<li><a href="06_performance_monitor/index.html">06 Performance Monitor</a></li>
<li><a href="07_hello_friend/index.html">07 Hello Friend</a></li>
<li><a href="08_book_titles/index.html">08 Book Titles</a></li>
<li><a href="09_timer/index.html">09 Timer</a></li>
<li><a href="10_temperature_object/index.html">10 Temperature Object</a></li>
<li><a href="11_dictionary/index.html">11 Dictionary</a></li>
<li><a href="12_rpn_calculator/index.html">12 Rpn Calculator</a></li>
<li><a href="13_xml_document/index.html">13 Xml Document</a></li>
<li><a href="14_array_extensions/index.html">14 Array Extensions</a></li>
<li><a href="15_in_words/index.html">15 In Words</a></li>
</ul>
</div>
<h1>learn_ruby</h1>
<div class="content"><h1>Learn Ruby Test-First</h1>
<h2>Setup</h2>
<ul>
<li><p>Install Ruby</p>
<ul>
<li>You will need Ruby, RubyGems and RSpec to Learn Ruby.</li>
<li>We recommend using <a href="http://rvm.beginrescueend.com">rvm</a> but you can use any Ruby you want. We officially support Ruby 1.9 but probably work with 1.8.7 as well.</li>
<li>Here are some <a href="http://www.wiki.devchix.com/index.php?title=Workshop_Installation_Notes_Rails_3">good instructions</a> for installing the required software.</li>
<li>Here are some <a href="http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec:rubygems">other good instructions</a>, using rvm.</li>
</ul>
</li>
<li><p>Open a terminal window. (On Mac OS X you can use the <code>Terminal</code> app.)</p></li>
<li><p>Install RSpec</p>
<pre><code> gem install rspec
</code></pre></li>
<li><p>Enter the course directory. (That's the same directory that this <code>index.html</code> file is in.)</p>
<pre><code> cd learn_ruby
</code></pre></li>
<li><p>Enter the <code>00_hello</code> lab.</p>
<pre><code> cd 00_hello
</code></pre></li>
<li><p>Open the lab's <a href="./00_hello/index.html">index.html</a> file in a web browser and follow the instructions there.</p>
<pre><code> open index.html # this works on Mac OS X only!
</code></pre></li>
</ul>
<h2>Using These Exercises</h2>
<p>Your course directory has a list of lab directories. Each
directory has a spec file. You will write all the code to make all the specs
in it pass.</p>
<p>To get your feet wet in this process, go into the "hello" lab with <code>cd
00_hello</code> and read the detailed instructions in its <code>index.html</code> file.</p>
<p>If you got through "hello", then congratulations! Now it's time to go to the
next directory (whose name begins with <code>01_</code>) and start learning Ruby!</p>
<h2>Course Outline</h2>
<p>Each course is different, so check with your instructor for details on the
curriculum he or she has chosen. Here is a survey of a few of the labs:</p>
<ul>
<li><strong>hello</strong>
Gives you a feel for how to use these tests.
See <a href="00_hello/index.html">00_hello/index.html</a> for detailed instructions.</li>
<li><strong>temperature</strong>
Write and class and do some basic math.</li>
<li><strong>calculator</strong> introduces a little more math, and you'll need to iterate.</li>
<li><strong>pig_latin</strong> lets you manipulate strings.</li>
<li><strong>in_words</strong> asks a number to say itself in English. Extend a built-in class. By the end you'll use conditionals, arrays, iteration, and maybe even some recursion.</li>
<li><strong>blocks</strong> introduces block syntax, including <code>yield</code></li>
</ul>
<h1>Advanced Setup</h1>
<p>After you're in the swing of things, you can read about <a href="advanced_setup.html">advanced setup techniques</a> like pulling changes and forking. But don't worry about it at first.</p>
<h1>Problems? Questions?</h1>
<p>First, ask your neighbor. Then, ask your instructor.</p>
<p>Then ask Google (seriously!). If there's an error, try copying the error string and pasting it into a <a href="http://google.com">Google</a> search box. If that doesn't help, do a search on one of these sites:</p>
<ul>
<li><a href="http://stackoverflow.com/">http://stackoverflow.com/</a></li>
<li><a href="http://www.ruby-forum.com">http://www.ruby-forum.com</a></li>
</ul>
<p>You can also find help at the <a href="http://testfirst.org">TestFirst.org</a> site or the <a href="http://groups.google.com/group/test-first-teaching">Test-First Teaching mailing list</a>.</p>
<p>And many related lectures, notes and videos are at <a href="http://CodeLikeThis.com">http://CodeLikeThis.com</a>.</p>
<p>Remember, if you post a technical question online, you should</p>
<ol>
<li><p>Include version numbers:</p>
<pre><code> $ ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
</code></pre></li>
<li><p>Note where you have already looked for an answer</p></li>
<li>If you can, include code snippets that reproduce the problem in isolation</li>
</ol>
<h1>Solutions and Submissions</h1>
<p>This Github repo (<code>learn_ruby</code>) is <em>generated</em> from a different Github repo, <a href="http://github.com/ultrasaurus/test-first-teaching">http://github.com/ultrasaurus/test-first-teaching</a>.</p>
<p>If you want to see how other students solved the problem, go to that repo and click around. (I'm not providing a direct link because I don't want it to be too easy to cheat!)</p>
<p>If you want to submit a patch or a solution, please fork the <a href="http://github.com/ultrasaurus/test-first-teaching">Test-First Teaching</a> repo and submit a Pull Request from there.</p>
<p>Also,</p>
<h1>Resources</h1>
<p>Here is a broad survey of many resources you may find useful. Don't try to read them all! Just browse around when you feel like learning more about Ruby.</p>
<h2>Learning Ruby via Tests (and/or Interactively)</h2>
<ul>
<li><a href="http://rubykoans.com">Ruby Koans</a> by Jim Weirich and Joe O'Brien (inspired by <a href="http://rubyquiz.com/quiz67.html">Metakoans</a> by ara.t.howard and <a href="http://clarkware.com/cgi/blosxom/2005/03/18">Ruby Learning Tests</a> by Mike Clark)</li>
<li><a href="http://testfirst.org">Test-First Teaching</a> by Sarah Allen and Alex Chaffee
<ul>
<li><a href="http://www.youtube.com/watch?v=KgfdlZuVz7I">Learning TDD Through Test First Teaching</a> talk by Sarah Allen at East Bay Ruby Meetup</li>
</ul>
</li>
<li><a href="http://www.exampler.com/blog/2009/12/17/growing-object-oriented-software-in-ruby/">Growing OO Software In Ruby</a> by Brian Marick - a Ruby version of <a href="http://www.growing-object-oriented-software.com/">Growing Object-Oriented Software Guided by Tests</a></li>
<li><a href="http://github.com/ryanb/ruby-warrior">ruby-warrior</a> by Ryan Bates - a game written in Ruby for learning Ruby</li>
<li><a href="https://github.com/JoshCheek/ruby-kickstart">Ruby Kickstart</a> by Josh Cheek - another set of test-driven exercises</li>
<li><a href="http://tryruby.org">Try Ruby</a> runs a Ruby interpreter in your browser, with hints and advice</li>
</ul>
<h2>Learning Ruby and Programming</h2>
<ul>
<li><a href="http://pine.fm/LearnToProgram/">Learn To Program</a> by <strong>Chris Pine</strong> - great Ruby tutorial, available online (1st ed.) or in a <a href="http://www.pragprog.com/titles/ltp2/learn-to-program-2nd-edition">PragProg book</a> (2nd ed.)</li>
<li><a href="http://rubylearning.com/satishtalim/tutorial.html">Ruby Learning</a> - Ruby tutorial</li>
<li><a href="http://railsforzombies.org">Rails for Zombies</a> - learn Ruby and Rails in your browser, no setup required</li>
<li><a href="http://ruby.learncodethehardway.org/">Learn Ruby The Hard Way</a> - a Ruby translation of Zed Shaw's "Learn Python The Hard Way"</li>
<li><a href="http://ruby.runpaint.org/">Read Ruby</a> a book about Ruby, quite technical but well written. Free online.</li>
<li><a href="http://github.com/alexch/mission">Ruby Mission</a></li>
<li><a href="http://groups.google.com/group/railsbridge">RailsBridge</a></li>
<li><a href="http://www.csunplugged.org/">CS Unplugged</a> - "CS Unplugged provides an extensive collection of free resources that teach principles of Computer Science such as binary numbers, algorithms and data compression through engaging games and puzzles that use cards, string, crayons and lots of running around."</li>
<li><a href="http://pragprog.com/titles/bmsft/everyday-scripting-with-ruby">Everyday Scripting with Ruby</a> by Brian Marick</li>
<li><a href="http://pragprog.com/titles/ruby/programming-ruby">Programming Ruby (the Pick Axe)</a> by Dave Thomas</li>
<li>Nice User's Guide: <a href="http://www.rubyist.net/~slagell/ruby/">http://www.rubyist.net/~slagell/ruby/</a></li>
<li>Michael Hartl's <a href="http://railstutorial.org">Rails Tutorial</a></li>
<li><a href="http://ruby4kids.com">http://ruby4kids.com</a></li>
<li><a href="http://jumpstartlab.com/resources/ruby-jumpstart/ruby/">Ruby in 100 Minutes</a> by <a href="http://jumpstartlab.com">Jeff Casimir</a></li>
<li><a href="http://university.rubymendicant.com">Ruby Mendicant University</a></li>
<li>Trainer on Rails <a href="http://www.public.traineronrails.com/courses/ruby/">"Ruby For Rails" tutorial</a></li>
<li><a href="http://yehudakatz.com/2009/08/24/my-10-favorite-things-about-the-ruby-language/">"My 10 Favorite Things About Ruby"</a> by Yehuda Katz</li>
<li><a href="http://stevenf.com/pages/book.html">"How To Count"</a> by Steven Frank, vol. 1 in "Programming for Mere Mortals", a series of books designed to introduce the concepts of programming from the ground up to a reader who has never written a line of code.</li>
</ul>
<h2>Test-Driven Development</h2>
<ul>
<li><a href="http://www.slideshare.net/alexchaffee/test-driven">Test-Driven</a> - presentation by Alex</li>
</ul>
<h2>Online Ruby References</h2>
<ul>
<li><a href="http://www.ruby-lang.org">http://www.ruby-lang.org</a></li>
<li><a href="http://www.ruby-doc.org/">http://www.ruby-doc.org/</a></li>
<li><a href="http://www.gotapi.com/rubyrails">http://www.gotapi.com/rubyrails</a></li>
<li><a href="http://apidock.com/">http://apidock.com/</a></li>
</ul>
<h2>Other good resources</h2>
<ul>
<li><code>irb</code> - when in doubt, try it out!</li>
<li><a href="http://rvm.beginrescueend.com/">Ruby Version Manager</a> (aka <code>rvm</code>) - cleanly manages multiple Ruby installations</li>
<li><a href="http://www.rubular.com/">http://www.rubular.com/</a> - an online Ruby regular expression calculator</li>
<li><a href="http://bit.ly/scott-chacon-git-101-tutorial">Git tutorial</a> by Scott Chacon</li>
</ul>
<h1>Credits</h1>
<ul>
<li>Concept by Alex Chaffee</li>
<li>Exercises by Alex Chaffee, Sarah Allen, Liah Hansen, Kai Middleton</li>
<li>Early quality assurance by Sumiki, Dimitri, Liah, Michael, and Brendan</li>
</ul>
</div>
<div class="footer"><a href="http://testfirst.org">TestFirst.org</a></div>
</body>
</html>