Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'release/misc-chapter1'

  • Loading branch information...
commit 93ffb4054f5a692d6aab63cb5b04a8b40ab17c66 2 parents d1009ae + fb4de1e
Kurtis Rainbolt-Greene authored
Showing with 1,473 additions and 1,601 deletions.
  1. +8 −11 Gemfile
  2. +21 −51 Gemfile.lock
  3. +22 −6 README
  4. +40 −4 config.ru
  5. +150 −318 content/book/chapter/1.markdown
  6. +320 −79 content/book/chapter/2.markdown
  7. +0 −2  content/book/chapter/3.markdown
  8. 0  content/book/chapter/4.markdown
  9. 0  content/book/chapter/5.markdown
  10. +30 −0 content/book/credits.markdown
  11. +32 −63 content/book/frequently-asked-questions.markdown
  12. +8 −3 content/book/license.markdown
  13. +0 −47 content/book/table-of-contents.markdown
  14. +23 −3 content/index.markdown
  15. +71 −71 content/style/extra/_mixins.sass
  16. +13 −15 content/style/extra/_variables.sass
  17. +52 −57 content/style/extra/reset.sass
  18. +64 −13 content/style/main.sass
  19. +2 −0  layouts/default.haml
  20. +1 −1  lib/filters/redcarpet_filter.rb
  21. +140 −313 output/book/chapter/1/index.html
  22. +369 −104 output/book/chapter/2/index.html
  23. +0 −38 output/book/chapter/3/index.html
  24. +0 −38 output/book/chapter/5/index.html
  25. +27 −3 output/book/{chapter/4 → credits}/index.html
  26. +36 −71 output/book/frequently-asked-questions/index.html
  27. +11 −11 output/book/license/index.html
  28. +0 −102 output/book/table-of-contents/index.html
  29. BIN  output/image/beige_paper.png
  30. BIN  output/image/black_denim.png
  31. +32 −5 output/index.html
  32. 0  output/source/task-0.rb
  33. +1 −1  output/style.css
  34. +0 −107 output/task-0.md
  35. +0 −38 output/task-1.md
  36. +0 −26 output/task-2.md
  37. BIN  tmp/dependencies
View
19 Gemfile
@@ -1,16 +1,13 @@
source :rubygems
-gem 'nanoc', '~> 3.1.7'
+gem 'nanoc', '3.1.7'
-gem 'haml', '~> 3.1.1'
-gem 'sass', '~> 3.1.1'
-gem 'redcarpet', '~> 1.15.2'
-gem 'coderay', '~> 0.9.8'
+gem 'haml', '3.1.2'
+gem 'sass', '3.1.3'
+gem 'redcarpet', '1.17.2'
+gem 'coderay', '0.9.8'
-gem 'heroku', '~> 2.1.4'
+gem 'heroku', '2.3.3'
-gem 'rspec', '~> 2.6.0'
-gem 'capybara', '~> 0.4.1.2'
-gem 'delorean', '~> 1.0.0'
-gem 'rbtrace', '~> 0.3.13'
-gem 'ruby-debug19', '~> 0.11.6', :require => 'ruby-debug'
+gem 'rspec', '2.6.0'
+gem 'capybara', '1.0.0'
View
72 Gemfile.lock
@@ -1,56 +1,40 @@
GEM
remote: http://rubygems.org/
specs:
- archive-tar-minitar (0.5.2)
- capybara (0.4.1.2)
- celerity (>= 0.7.9)
- culerity (>= 0.2.4)
+ capybara (1.0.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
- selenium-webdriver (>= 0.0.27)
- xpath (~> 0.1.3)
- celerity (0.8.9)
+ selenium-webdriver (~> 0.2.0)
+ xpath (~> 0.1.4)
childprocess (0.1.9)
ffi (~> 1.0.6)
- chronic (0.4.1)
coderay (0.9.8)
- columnize (0.3.2)
- configuration (1.2.0)
+ configuration (1.3.1)
cri (1.0.1)
- culerity (0.2.15)
- delorean (1.0.1)
- chronic
diff-lcs (1.1.2)
ffi (1.0.9)
- haml (3.1.1)
- heroku (2.1.4)
+ haml (3.1.2)
+ heroku (2.3.3)
launchy (>= 0.3.2)
rest-client (~> 1.6.1)
term-ansicolor (~> 1.0.5)
- json_pure (1.5.1)
+ json_pure (1.5.3)
launchy (0.4.0)
configuration (>= 0.0.5)
rake (>= 0.8.1)
- linecache19 (0.5.12)
- ruby_core_source (>= 0.1.4)
mime-types (1.16)
- msgpack (0.4.5)
nanoc (3.1.7)
nanoc3 (>= 3.1.7)
nanoc3 (3.1.7)
cri (>= 1.0.0)
- nokogiri (1.4.4)
+ nokogiri (1.4.6)
rack (1.3.0)
rack-test (0.6.0)
rack (>= 1.0)
- rake (0.9.1)
- rbtrace (0.3.13)
- ffi (>= 1.0.6)
- msgpack (>= 0.4.3)
- trollop (>= 1.16.2)
- redcarpet (1.15.2)
+ rake (0.9.2)
+ redcarpet (1.17.2)
rest-client (1.6.3)
mime-types (>= 1.16)
rspec (2.6.0)
@@ -61,25 +45,14 @@ GEM
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
- ruby-debug-base19 (0.11.25)
- columnize (>= 0.3.1)
- linecache19 (>= 0.5.11)
- ruby_core_source (>= 0.1.4)
- ruby-debug19 (0.11.6)
- columnize (>= 0.3.1)
- linecache19 (>= 0.5.11)
- ruby-debug-base19 (>= 0.11.19)
- ruby_core_source (0.1.5)
- archive-tar-minitar (>= 0.5.2)
rubyzip (0.9.4)
- sass (3.1.2)
- selenium-webdriver (0.2.1)
- childprocess (>= 0.1.7)
+ sass (3.1.3)
+ selenium-webdriver (0.2.2)
+ childprocess (>= 0.1.9)
ffi (>= 1.0.7)
json_pure
rubyzip
term-ansicolor (1.0.5)
- trollop (1.16.2)
xpath (0.1.4)
nokogiri (~> 1.3)
@@ -87,14 +60,11 @@ PLATFORMS
ruby
DEPENDENCIES
- capybara (~> 0.4.1.2)
- coderay (~> 0.9.8)
- delorean (~> 1.0.0)
- haml (~> 3.1.1)
- heroku (~> 2.1.4)
- nanoc (~> 3.1.7)
- rbtrace (~> 0.3.13)
- redcarpet (~> 1.15.2)
- rspec (~> 2.6.0)
- ruby-debug19 (~> 0.11.6)
- sass (~> 3.1.1)
+ capybara (= 1.0.0)
+ coderay (= 0.9.8)
+ haml (= 3.1.2)
+ heroku (= 2.3.3)
+ nanoc (= 3.1.7)
+ redcarpet (= 1.17.2)
+ rspec (= 2.6.0)
+ sass (= 3.1.3)
View
28 README
@@ -6,11 +6,11 @@ called Learn You The Ruby For
Awesome Power. Learn You The
Ruby For Awesome Power is a
book for those who want to
-hack with the Ruby Programming
-Language. The book attempts to
-be similar to Learn You A
+program with the Ruby Language.
+The book attempts to
+look like the Learn You A
Haskell, Learn You Some Erlang,
-and Learn Python The Hard Way.
+and Learn Python The Hard Way books.
This book also attempts to be
funny, but never really had
the nack for telling jokes.
@@ -24,8 +24,24 @@ complete tasks that over time
take what the reader has learned
and adds new layers. This book
also gives the reader pep talks,
-and advice concerning girls. The
+and advice concerning girls (or boys). The
conversations get awkward and the
book will, at times, start ranting
about some woman called "Vickey"
-and how it all really went down.
+and how it all really went down.
+
+
+Contributing
+------------
+
+1. Spacing:
+ * One space above and below: Paragraphs, Code, Quotes, Lists, Images, & Headers
+ * Two spaces above Headers
+ * Zero spaces above Chapter Headers
+
+2. Paragraph sentences should be followed by a return.
+
+3. Use this style for code blocks:
+ ~~~ language-ruby
+ print "ten"
+ ~~~
View
44 config.ru
@@ -1,6 +1,42 @@
-require './web/app'
+require 'rack'
+require 'rack/contrib'
+require 'rack-rewrite'
+require 'mime/types'
-Encoding.default_internal = 'utf-8'
-Encoding.default_external = 'utf-8'
+use Rack::ETag
-run Sinatra::Application
+module ::Rack
+ class TryStatic < Static
+
+ def initialize(app, options)
+ super
+ @try = ([''] + Array(options.delete(:try)) + [''])
+ end
+
+ def call(env)
+ @next = 0
+ while @next < @try.size && 404 == (resp = super(try_next(env)))[0]
+ @next += 1
+ end
+ 404 == resp[0] ? @app.call : resp
+ end
+
+ private
+ def try_next(env)
+ env.merge('PATH_INFO' => env['PATH_INFO'] + @try[@next])
+ end
+
+ end
+end
+
+use Rack::TryStatic,
+ :root => "output", # static files root dir
+ :urls => %w[/], # match all requests
+ :try => ['.html', 'index.html', '/index.html'] # try these postfixes sequentially
+
+errorFile='output/index.html'
+run lambda { [404, {
+ "Last-Modified" => File.mtime(errorFile).httpdate,
+ "Content-Type" => "text/html",
+ "Content-Length" => File.size(errorFile).to_s
+ }, File.read(errorFile)] }┌
View
468 content/book/chapter/1.markdown
@@ -1,345 +1,177 @@
-And Then There Was Ruby
-=======================
+---
+title: "Chapter One: Ruby"
+author: "Kurtis Rainbolt-Greene"
+---
-**Note: If you want to get straight to hacking start at [Chapter 2: Ready! Set! Hack](/chapter/2).**
-HCP: Hackers, Code, and Programming
------------------------------------------------------
+How This Book Works
+-------------------
+
+**Good,** you've heroically started reading the book!
+I promise the this chapter won't be too terribly boring.
+Each chapter will be brief, but important, so read it all.
+Inside of each chapter you will see *five sections*, and each section will have:
+
+* A brief summary of what the section will teach you
+* A bit of ruby code
+* The resulting output of the code
+* A detailed description of each (new) important part
+* Some extra credit tasks
+
+Now that I've given you the keys to this map lets figure out what you should do when you read a new chapter (some of this is explained later):
+
+1. Read the brief summary, don't worry if you don't fully understand it.
+2. In your *project directory* create a new file called `task-n.rb` where n is the task number.
+3. Write everything from the code into the file. **Do not copy and paste**.
+4. Read the detailed description and the code you just wrote.
+5. Run the code. **Note**: Some sections will have **secret bugs** just for you to figure out!
+6. If you feel confidant check out the extra credit, change the code, and get messy!
+
+Once you've followed each step you should understand another part of how Ruby works.
+Stick with it you'll be hacking out programs left and right.
+
+
+What Is Programming?
+--------------------
> The computer programmer is a creator of universes for which he alone is responsible.
> Universes of virtually unlimited complexity can be created in the form of computer programs.
-> ---
+> - - -
> **Joseph Weizenbaum**, Computer Power and Human Reason
-If you've watched any news in the last ten years, read any newspapers in the last fifteen (Some people still do!), or talked to that technically inclined cousin of yours, then you've probably heard three words that are specific to this field:
-
-1. Hacker (or Hacking)
-2. Code (or coding)
-3. Programming (Or programs)
-
-Lets talk about each one specifically since they're going to be so prevalent in the next ten years of your life should you decide to be a programmer.
-The first and most complicated word is *Hacker*.
-You've probably heard it in a very negative tone, often defined as a person who uses computers to illegally gain access to computers to hinder or damage.
-Hell, you've probably had some idiot claim to be a hacker in order to intimidate you into doing something.
-
-**Guess what**: That's not what _hacker_ means.
-No, there's already a name for people who do what I just described: Criminals.
-They don't need a special name to help them appear more mysterious or dangerous.
-In reality, a hacker is a member of the hacker subculture and simply an individual who seeks to learn as much as possible using technology.
-Usually under a self-defined code of ethics, not necessarily ones that reflect common law.
-Many consider the only method of learning is to examine, since the information necessary for their own enlightenment is not free.‏
-
-![Real Hackers](/image/hacker.png "Yeah, it's kinda like that.")
-
-The latter two terms are less culturally significant but should still be defined and talked about: _Programming_ is the act of writing code, using a programming language.
-A programming language is the language we, humans, use to instruct computers, dumb pieces of plastic, on what to do.
-A program (or script) is a list of instructions that you've laid out for the computer to follow and complete.
-Programs are sometimes called software, applications, or scripts depending on the complexity or detail involved in using them.
-
-The act of programming is to write these scripts or applications in a programming language, like Ruby.
-A computer only knows how and when to do things if you tell it to in it's own language, Binary.
-
-### Binary's Count 1 To 10, Print Sum
-
-``` language-binary
- 00110001 00000000 00000000
- 00110001 00000001 00000001
- 00110011 00000001 00000010
- 01010001 00001011 00000010
- 00100010 00000010 00001000
- 01000011 00000001 00000000
- 01000001 00000001 00000001
- 00010000 00000010 00000000
- 01100010 00000000 00000000
-```
-
-This program tells the computer to take every number from 1 to 10, add them together, and display the sum (55).
-It's complex, arcane, and completely unreadable to the naked eye for most people.
-Would you believe that people actually programmed applications this way?
-Simple software, like a calculator, required complex and time consuming work that was error prone and easily crashed.
-The same code is written here in Ruby:
-
-### Ruby's Count 1 To 10, Print Sum
-
-``` language-ruby
- total = 0
- count = 1
-
- while count <= 10
- total += count
- count += 1
- end
-```
-
-Or even:
-
-``` ruby
- print (1..10).sum
-```
-
-![Awesome Placeholder Image](http://dummyimage.com/300/00/44.png&text=Awesome%20Placeholder "So awesome.")
-
-It's obvious in the previous two examples that programming languages are a tool for making developing easier.
-Programming in Ruby works by writing text (like above), having the Ruby interpreter compile it, and getting the result of your work.
-The next two examples are exactly the same, first in Java a really powerful and common language, the second in Ruby:
-
-### Java's "Hello, World"
-
-``` java
- public class HelloWorld {
- public static void main(String[] args) {
- System.out.println("Hello, World");
- }
- }
-```
+Programming, Hacking, Coding, Developing, and many other words for the same thing:
+Writing instructions in a strange language that the computer will interperate and then act on.
+People have been doing it since the early 1970's.
+While the process is dramatically different, the ideas and concepts are nearly identical.
+
+To put it as vaguely as possible, because the fine details aren't important, programming is writing instructions for the computer to act on.
+That's it, no pretty wording or complex phrases, nothing really hard to comprehend.
+For Ruby that means something that'll look like this:
+
+~~~ language-ruby
+def chores
+ pick_up trash
+ take_out trash
+ vacuum(carpet)
+ mop kitchen
+end
+~~~
-### Ruby's "Hello, World"
+The Ruby Interpretor then reads each line and does as you've instructed, which can include making mistakes!
+One thing to remember in the following lessions: Computers are really dumb!
+If you told a computer to jump off a bridge, *they would jump off a bridge*.
+Consider the following:
-``` ruby
- print 'Hello, World'
-```
+~~~ language-ruby
+number = 1
-Meanwhile, _Code_ is a language agnostic term for the source code that we write.
-Further, source code is is any collection of statements or declarations written in some human-readable computer programming language.
-The above examples I've listed are exactly that: Code.
+while number == 1
+ print "I Love ruby"
+end
+~~~
+Even with your limited knowledge of programming you should be able to spot the problem.
+The computer would keep printing that statement *forever*, until the batteries ran out!
-def ruby
---------------------------
+
+What Is Ruby?
+-------------
> A dynamic, open source programming language with a focus on simplicity and productivity.
> It has an elegant syntax that is natural to read and easy to write.
> - - -
> **Ruby Lang**, http://ruby-lang.org
+So by now you're probably wondering what Ruby **is**, beyond a programming language I mean.
+In a lot of tech jargon (which I'm required by law to say) Ruby is:
+
+* Imperative
+* Procedural
+* Object-Oriented
+* Duck Typed
+* Expressive
+
+A lot of these terms are useless to know for now so I won't bother explaining them.
+That said it's a good idea to understand what they're used for!
+Programming languages have all one thing in common: You write some stuff in a specific syntax and a computer reads that to do what you want.
+Just like there are different Human speaking languages, and even different ways to write written languages, programming languages have different **traits**.
+These traits are used to define how well a language adheres to a type of use.
+For instance, Ruby is an **Object Oriented** programming language, but that only means it's *really* good at Object Oriented programming.
+How you use a language is entirely up to you.
+
+You may have noticed a strange word up there, the very last one, calling Ruby **expressive**.
+This is arguably the most important trait Ruby has and the meaning is quite interesting.
+Expressive is a trait word used to describe a language as Human.
+Here's an example, the first is a Hello World program in Java (non-expressive), the second in Ruby:
+
+**Java "Hello, World"**:
+
+~~~ language-java
+public class HelloWorld {
+ public static void main(String[] args) {
+ System.out.println("Hello, World");
+ }
+}
+~~~
+
-> Ruby is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.
-> Ruby originated in Japan during the mid-1990s and was initially developed and designed by Yukihiro "Mat.
-Matsumoto.
-> It is based on Perl, Smalltalk, Eiffel, Ada, and Lisp.
-> - - -
-> **Wikipedia**, http://en.wikipedia.org/wiki/Ruby_(programming_language)
-
-![It Came From Japana](/image/from-japan.png ":horror-face:")
-
-You didn't come here to read about a few definitions, though.
-You came here to learn about Ruby (or else you're going to be mildly disappointed).
-So let's learn about Ruby: Ruby is a programming language.
-Ok, so you probably figured that out already.
-Here's some important information that wont make sense yet: The Ruby programming language is expressive, imperative, and object-oriented.
-Ruby doesn't require a compile step, but instead is interpreted by an interpreter.
-The Ruby programming language is geared toward and designed for both simplicity and enjoyability.
-Ruby's goal is to make development very fun and easy for developers.
-
-> Experienced programmers should take note of the term "Object-Oriented.
-> That's not "Object-Curious", or "Object-Casual.
-> This isn't that one time at band camp when your program let another modify his orientation for the night.
-
-This is an object-oriented language and you'll be dealing with Classes and Objects the entire time.
-Everything, and I do mean everything, is an Object in Ruby, even the results from methods (a more manlier word for function) are an Object.
-
-Ruby was officially named on 1993-02-24 in Japan by it's creator Yukihiro "Mat" Matsumoto.
-The language went public 1995-12-21 with Ruby v0.95.
-Ruby v1.0 wouldn't crawl around until a year later, 1996-12-25.
-Somewhere during the year 2000 Ruby would finally become used mainstream outside of Japan, and on 2001-12-15 the Pragmatic Programmers released Programming Ruby, otherwise known as _Pickaxe_.
-2001 also happened to be the year of the ever successful convention, RubyConf?
-which was first called RubyConf?.new(2001).
+**Ruby "Hello, World"**
+
+~~~ language-ruby
+print 'Hello, World'
+~~~
+
+You might think at first glance that Ruby is clearly the superior here!
+Look how much we didn't have to write to get the same exact output!
+That's a trap though, because the brevity was gained at the sacrifice of fine control.
+There are some things Ruby will never be able to do that Java can, and one of those is speed.
+A **highly optimized** Java application, tuned to the brink, is *hare-vs-tutrle* fast.
+
+
+The Red Culture
+---------------
+
+*Note*: You can skip this section and it wont hurt your learning, this is mostly for nerds.
+
+Now that you know what Ruby is it's time to learn about the history.
+Ruby was officially given it's name on 1993-02-24, in Japan by it's creator [Yukihiro "Matz" Matsumoto](http://en.wikipedia.org/wiki/Yukihiro_Matsumoto).
+The language went public 1995-12-21 with Ruby version 0.95.
+Ruby version 1.0 wouldn't crawl out until a year later, 1996-12-25.
+Somewhere during the year 2000 Ruby would finally become used mainstream outside of Japan.
+2001-12-15 the Pragmatic Programmers released Programming Ruby, otherwise known as * ThePickaxe Guide*.
+2001 also happened to be the year of the ever successful convention *RubyConf*, which was first called RubyConf?.new(2001).
It's an inside joke you'll get later.
-![The Real Matz](/image/matz.png "Matz: The Original Ruby Goatee")
-
-The ball didn't start really rolling until David "DH.
-Heinmeier hit the scene.
-Mr.
-Heinemeier designed and created Rails (Usually called Ruby On Rails) and opened the source on 2004-07.
-He didn't give commit rights (The right to change the code) to anyone else until 2005-02 and even then it's a strict list.
-Rails exploded onto the web development scene like the Virut virus on an unsuspecting computer.
-DHH had single handedly made web development enjoyable, the cad.
-Apple Inc.
-picked up on this crazy development in the webtech scene and announced that Mac OS X (10.5, Leopard) would ship with the latest Rails in 2004-08.
-
-The real question you want to know (most likely) is what the language is "good for", or at least used for.
-The answer to this is easy: Everything.
-Want a script that sorts, edits, or deletes your files?
-Can do.
-Want to write a pretty GUI (Graphic User Interface)?
-Yep, in spades.
-Pushing out an extensive and complex web application?
-Twitter, YelloPages, and Github did it with Rails.
-You will be doing simpler things of course, but all these projects and more are within the grasp of even average people if they put their mind to it.
-In fact, here's a (very small) list of examples:
-
-* [Sinatra](http://sinatrarb.com), a micro-web framework and DSL for creating tiny (or complex) web applications! * [Hackety Hack](http://hacketyhack.heroku.com/), a wonderful programming introduction for children, by \_why.
-* [Event Machine](http://rubyeventmachine.com/), an event based server.
-* [Mongrel](http://github.com/fauna/mongrel), the powerful HTTP server built by Zed Shaw.
-* [Rake](http://rake.rubyforge.org/), all the simplicity of Ruby for powerful makes.
-
-Ruby has a lot of good facets (haha, precious gem joke) that are very easy to identify: Ruby is powerful and elegant, easy to read and detailed, with enterprise and open source in mind.
-All these are pretty much buzz words when you get down too it so the real good side of Ruby is that it's easy and fun.
-These are traits not often found in programming languages.
-Like all programming languages and tools Ruby has a place and use that it is best fit for: Web development.
-
-![Awesome Placeholder Image](http://dummyimage.com/300/00/44.png&text=Awesome%20Placeholder "So awesome.")
-
-Like every other language Ruby has some bad parts too.
-The Ruby Community is so terrible that I've devoted an entire chapter just to the culture around Ruby.
-The standard Ruby interpreter (1.8) is really slow compared to pretty much every other modern used language.
-The latest stable version (1.9) is only just now coming into broad usage by developers.
-Ruby isn't scalable naturally for the most part, and requires external sources and languages to assist it.
-One programmer has told me that the long time solution to this was, "Run more machines with Ruby.
-which is an obviously flawed approach.
-Open Ruby projects tend to have serious little or poor documentation and for the most part hasn't improved.
-
-
-[The Ruby Revolution & Renaissance](id:section-three)
---------------------------------------------------------
-
-Now that you know what Ruby is (or at least the definition of Ruby) and how it started, it's time to learn about the history.
-The era, called the _Ruby Revolution_ by some, of most significance started in 2004.
-The Ruby Revolution concerns the period of time where Rails hit the scene and started to cause a fuss among web developers.
-The "fus.
-would be called _Ruby Philosophy_.
-The core philosophy behind Ruby is "DRY: Don't Repeat Yourself".
-During this time period you can see at least three sides forming in the web development community: The older fellows who liked what they had (JavaEE, PHP) and didn't think this new fangled Ruby On Rails was worth the change, the younger developers who quite enjoyed the ease Rails and Ruby gave them, and those that didn't care either way.
-
-While web development and web frameworks existed long before Rails, it was commonly considered that web application development sucked.
-It was something you had to really plow through without much help.
-The idea that web development could be significantly easier made a lot of people happy.
-Of course, Ruby and Rails wasn't (and isn't) perfect, but it was the initial push toward making things easier that mattered.
-The thing is the Ruby Revolution wouldn't have happened without the success of Ruby On Rails with American developers.
-Thanks to the Rails phenomenon the number of Ruby developers in the United states and European Union grew by incredible amounts.
-Even though there is an even smaller divide among Rubyists on Rails, we owe a lot of Ruby's following and popularity to Rails.
-
-![David Heineiehem Handsomface](/image/dhh.png "DHH: The Ruby Pretty Boy")
-
-As with all revolutions there had to end, and it did end around the year 2009.
-Though while the _Ruby Revolution_ ended many claimed that 2010 will be the start of the _Ruby Renaissance_.
-An era for Ruby to refine many aspects of the language and it's parts.
-At the end of 2009 Ruby already had four variations, the beginning of a Standard, and the rise of three other major web frameworks beyond Rails.
-More importantly many companies were (and are) specifically hiring Ruby and Ruby On Rails developers.
-
-A lot of articles have been written and will be written about the Ruby Revolution and the change that Ruby has made in the web development area.
-It's a good idea to keep in mind that Ruby's Revolution and Renaissance didn't sprout from a void.
-The real source of Ruby's success is you, future developers and users.
-
-
-[Rock Out To The Rock Star](id:section-four)
---------------------------------------------
-The term Rockstar, or Rock Star, in the context of developers or developing is commonly meant to describe someone who has a cult like following.
-Rock Stars are programmers who do things (sometimes amazing things) and advance the community or the language.
-Like Jimi Hendrix, Elvis, and Lynyrd Skynyrd, the Rock Stars usually have a large amount of followers and disciples that watch their every word and movement.
-Rock Stars don't have everything going for them however.
-Much like the music gods they're titled after eventually the Rock Star burns out and either becomes destructive or washes away in mystery.
-I know, who thought Programming could be so dramatic?
-
-The Ruby Community has two Rock Stars worth taking serious notice of.
-Both of these Rock Stars are people I look up to and look forward to matching one day.
-They have changed the face of Ruby and will be remembered for a very long time.
-It's hard to look at Ruby and not see the areas that they've changed and so they are in my Ruby Rock Star Hall of Fame, if you will.
-The first is Zed Shaw, someone whom you might already know from his rants and usual internet ravings.
-A musician and a talent, he has since left the Ruby community.
-The second is Why The Lucky Stiff, or \_why, and has paved the path for a kinder and more enjoyable Ruby experience for a lot of new people.
-He is also considered to be one of the more wild aspects of Ruby developing.
-He has since left the internet completely, committing what many consider to be "Internet Suicide."
-
-![why the lucky stiff](/image/_why.png "_why: Pure Imagination")
-
-Zed Shaw developed Mongrel, an open-source HTTP library and web server for Ruby web applications and is mostly recognized for that accomplishment.
-He has since moved on to building Mongrel 2 (Not Ruby), Lamson, and the Liberlist.
-Attaining Rock Star status due to his heavy influence in how the community deals with Corporate presence, Zed Shaw burned out finally with a blog post called "Rails Is A Ghetto."
-The blog post no longer exists on his web site and all that remains is a note by him for programmers to follow the quiet helpers who look after those in need rather than the tough jocks of our community, like himself.
-
-![Zed Shaw](/image/zed-shaw.png "Zed Shaw: Born to code.")
-
-You might wonder why I don't use \_why's real name, and instead use his moniker Why The Lucky Stiff.
-This is because no one currently knows his true identity and is willing to tell.
-\_why has developed many projects that have changed the face of the Ruby Community.
-His efforts to guide the Ruby Community into a place where new people are met with enthusiasm and not disgust have put him in the Rock Star Hall of Fame along with Zed Shaw.
-Unlike most Rock Stars he went out with a serious whimper, rather than a dramatic bang.
-One day all of his repositories and social networking accounts were closed and gone.
-Many of his works are now mirrored, but developers of Ruby have all felt his impact.
-
-While Rock Stars have a limited time to do good before they burn out it's important to understand that Rock Stars do in fact do good.
-Think of them as Nitrous Oxide Systems, that for a short period drastically increase the speed the community moves at.
-The Ruby Community has a lot to gain from these men of action, despite their short social life spans.
-
-
-[The Cherry Kool-Aid](id:section-five)
---------------------------------------
-
-Like many geek cultures that exist today the programming communities tend to have a very common problem: Power users, fanboys, and evangelists.
-Fanatics of a religion, political party, or creed have always existed and the programming culture is no less afflicted by them.
-In fact due to the social ineptitude many geeks live with we are more prone to the red haze of cultism.
-You're mistaken if you think I'm joking when I say that there have been actual fist fights over which indentation style to use in C, or what command line editor to write with.
-Despite the Hacker culture's focus on individuality and freedom, the Ruby world is still a geek world.
-
-![Awesome Placeholder Image](http://dummyimage.com/300/00/44.png&text=Awesome%20Placeholder "So awesome.")
-
-Ever since Rails rolled out the Ruby community has stepped knee deep in hype and hyperbole.
-It started off as lot of programmers becoming very enthusiastic about a new and expressive language.
-It didn't help that the community had a lot of early Rock Stars emerging from Rails, and that they talked a lot of smack about other languages.
-Many touted Ruby as the Great White Hope of Programming.
-It's a general consensus among Rubyits that the egotism and dickery comes directly from Rails's growth.
-
-The reality here is that geeks of any flavor tend to gush over new toys and geeks of any flavor tend to rant about others gushing.
-In recent years the type of behavior described has slowly ground to a halt as the fanatics are pushed aside and the community, and language, matures.
-It is important to realize that his behavior stems from ignorance and the best cure is education.
-We as a group cannot abide by this blind fervor because it will ultimately ruin a lot of what Ruby stands for: The enjoyment of developing.
-
-![Awesome Placeholder Image](http://dummyimage.com/300/00/44.png&text=Awesome%20Placeholder "So awesome.")
-
-
-[Credits & Licensing](id:section-six)
--------------------------------------
-Alright, you've gotten through the boring part of the book.
-You know about Ruby, the history, and some of the pitfalls of the community.
-You're equipped, now, to start learning Ruby and building applications.
-Hopefully you can start understand why I've written this guide, especially this way, once you get into Ruby developing on your own.
-This book is of course not the last thing you'll read.
-In fact you should go on to read these great books, because they inspired me to write this:
-
-* [Learn Python The Hard Way](http://learnpythonthehardway.org/) (Read Chapter 1 first, then you can read either book.)
-* [Poignant Guide To Ruby](http://mislav.uniqpath.com/poignant-guide/) (Written in an odd but fun way.)
-* [Eloquent Javascript](http://eloquentjavascript.net/) (Also free and web/pdf)
-* [Think Python](http://www.greenteapress.com/thinkpython/thinkpython.html) (Also free and web/pdf)
-* [Programming Ruby](http://ruby-doc.org/docs/ProgrammingRuby/) (Not free/Web)
-* [Learn You A Haskell For Great Good](http://learnyouahaskell.com/)
-* [Learn You Some Erlang For Great Good](http://learnyousomeerlang.com/)
-* [Learning Clojure](http://en.wikibooks.org/wiki/Learning_Clojure)
-
-Also, here's the [copyright](/book/copyright).
-
-
-[How This Book Works](id:section-seven)
----------------------------------------
-
-**Good!** You've heroically made it to the end of Chapter One.
-I promise the next chapter won't be too terribly long.
-In fact chapters three through ten will all be ten sections long, while chapter two will have 1 setup section and 10 learning sections.
-Each section of each chapter will be in five important sections:
+The ball didn't start really rolling until [David "DHH" Heinemeier Hansson](http://en.wikipedia.org/wiki/David_Heinemeier_Hansson) hit the scene.
+DHH developed the Rails framework (Usually called Ruby On Rails) and opened sourced it 2004-07.
+He didn't give commit rights to anyone else until 2005-02 and even after it's kept to a strict few.
+Rails exploded the web development scene, for Rails made web development easy and enjoyable.
+In 2004-08, Apple Inc. announced that Mac OS X (10.5, Leopard) would ship with the latest Rails stable and Ruby.
-* A brief summary of what the section will teach you
-* A bit of source code
-* A result of running the code
-* A detailed description of each (new) important part
-* And some extra credit tasks
+From Rails' success came many Ruby libraries and projects that opened a whole new door for many developers.
+There you have it, Ruby's history all in two paragraphs.
-![Awesome Placeholder Image](http://dummyimage.com/300/00/44.png&text=Awesome%20Placeholder "So awesome.")
-Now that we know all the pieces to the puzzle it's time to learn how to read and use this book.
-Follow each step exactly and then go wild:
+Other Resources
+---------------
-1. Read the brief description, don't worry if you don't fully understand it
-2. Create a new file, in your projects directly (We'll get to that), called `lytr#.rb` and replace the # with the task number.
-3. Write each line from the source code into the file. **Do not copy and paste**. The point is to learn by doing.
-4. Read the detailed description and the code you just wrote.
-5. Run the code, see if you get the desired output. If you don't, return to step 3. _**Note**: Some sections will have **secret bugs** just for you to figure out!_
-6. If you feel confidant check out the extra credit portions, change the code around, and get messy!
+Now you're probably wondering, what happens if I have a problem or something I can't figure out?
+Well you're in luck, because I've thought of that exactly!
+To solve most problems you have others who want to help will need detailed *logs* of your problem.
+These are usually called *error logs* and the helper will need you to share.
+
+The first step is to copy all the output from the error and paste it to somewhere like [http://gist.github.com].
+You'll notice there is a huge text box, in here you should describe the steps that you took to get where you are in the problem.
+Then you'll want to paste the actual output of the error.
+The person helping you should, after you've shared the link with them, be able to pick out the problem.
-It is very important that you type each bit of source code out.
-It will make the learning process a whole lot easier and give you a deeper, first hand, understanding of writing Ruby code.
-Once you've followed each step carefully you should understand another portion of how to program with Ruby.
-Initially this might be a very difficult way of learning how to program with Ruby, but if you stick with it you'll be hacking out apps left and right.
-One last thing before we start you on the really interesting things: Have.
-Fun.
+Who are these mysterious helpers I'm talking about?
+Why they're other developers, like yourself, who have probably screwed up more code than you've seen!
+The best places to find people willing to help is at [Stack Overflow](http://stackoverflow.com).
+Simply follow the instructions I've given, and the ones on Stack Overflow, and you should have a solution in no time!
+What if you didn't get a solution?
+Here are some other, less effective, alternatives:
+* [Ruby Mailing List](http://www.ruby-lang.org/en/community/mailing-lists/), an email list with tons of experts.
+* [Ruby IRC Channel](http://irc.lc/freenode/ruby-lang/t4nk@@@), an old way of communicating on the internet.
+* [My Email](mailto:kurtisrainboltgreene@gmail.com), if all else fails.
View
399 content/book/chapter/2.markdown
@@ -1,104 +1,345 @@
-Ready! Set! Hack.
-=================
-**Note: I adore notes.**
+---
+title: "Values"
+author: "Kurtis Rainbolt-Greene"
+---
-[T0](id:section-one) Installing Ruby
------------------------------------------------------
-\![Awesome Placeholder Image](http://dummyimage.com/300/00/44.png&text=Awesome%20Placeholder "So awesome.")
+Task Zero
+---------
-### Summary
+**Summary**: Install & Setup
-This is the most important Task in the entire book.
+This is the most important *task* in the entire book.
This task will detail each step required to get Ruby running on your computer.
Without Ruby you can't run the code you build and that makes this entire thing worthless.
Oh we also talk about your workstation.
-### Source Code
+**Source Code**
#### Ubuntu
-1. Open up Terminal:
- 1. Click on the magnifying glass in the top right of your screen.
- 2. Type `Terminal` and press enter.
- 3. Type in the parts that look like `this` into Terminal and press enter.
-2. Install dependencies:
- 2. `sudo apt-get install build-essential bison autoconf g++ \ `
- 3. `zlib1g-dev libreadline-dev libsqlite3-dev \ `
- 4. `libxslt-dev libxml2-dev libssl-dev \ `
- 5. `curl git-core subversion` then `yes`.
-3. Install Ruby & Friends
- 1. `bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )`
- 2. `source ~/.rvm/scripts/rvm && rvm install --default 1.9.2`
-4. Setup your environment:
- 1. `mkdir ~/repo ~/repo/rb ~/repo/rb/lytr && cd ~/repo/rb/lytr`
- 2. `rvmsrc='[[ -s "~/.rvm/scripts/rvm" ]]' && echo $rvmsrc >> ~/.bash_profile && echo $rvmsrc >> ~/.bashrc`
- 3. `curl https://github.com/krainboltgreene/dotfiles/blob/master/gemrc -o ~/.gemrc && gedit ~/.bashrc`
- 4. In gedit add `# ` in front (On the same line) as: `[ -z "$PS1" ] && return` if it's there.
-5. Make yourself comfortable in Gedit:
- 1. Turn on `Highlight Cur...` and `Highlight Mat...`
- 2. Go to the Editor tab.
- 3. `Tab Width` change to 4. Turn On `Insert Spaces Inst...` and `Enable Auto...`
-6. Save and close gedit. Type `exit` in the Terminal.
-7. Add the Terminal & Gedit shortcuts to the panel
+1. Open A Terminal
+ * Type in the parts that look like `this` into Terminal.
+2. Install RVM Dependencies
+ * `sudo apt-get install curl git-core`
+3. Install RVM
+ * `bash < <(curl http://rvm.beginrescueend.com/releases/rvm-install-head)`
+ * `rvmsrc='[[ -s "~/.rvm/scripts/rvm" ]]'`
+ * `echo $rvmsrc >> ~/.bash_profile && echo $rvmsrc >> ~/.bashrc`
+4. Install Ruby Dependencies
+ * `source ~/.rvm/scripts/rvm && rvm notes`
+ * Read the instructions from the above command, you're looking for the `mri` dependencies.
+5. Install Ruby
+ * `rvm install --default 1.9.2`
+6. Setup Environment
+ * `mkdir -p ~/Repository/lytr/`This is your project directory.
+ * `rvm -v`
+ * `ruby -v`
+ * `gem -v`
+ * Make sure all of the above commands didn't result in an error.
+7. Install Gedit
+ * `sudo apt-get install gedit`
+ * If already installed, then type `gedit`
+8. Setup Gedit
+ * In gedit, open the Edit menu and go to Preferences.
+ * Turn on **Highlight Current Line**.
+ * Go to the Editor tab.
+ * Change **Tab Width** to 4.
+ Turn On **Insert Spaces Inst...** and **Enable Auto...**
+ * Save and close Gedit.
#### Windows
-1. Magic Happens.
+1. Open up Terminal
+ * Type in the parts that look like `this` into Terminal.
+7. Install Gedit
+ * ...
+ * Open Gedit
+6. Setup Environment
+ * `mkdir -p ~/Repository/lytr/` This is your project directory.
+ * `rvm -v`
+ * `ruby -v`
+ * `gem -v`
+ * Make sure all of the above commands didn't result in an error.
+8. Setup Gedit
+ * In gedit, open the Edit menu and go to Preferences.
+ * Turn on **Highlight Current Line**.
+ * Go to the Editor tab.
+ * Change **Tab Width** to 4.
+ Turn On **Insert Spaces Inst...** and **Enable Auto...**
+ * Save and close Gedit.
+
#### Mac OS X
-1. Open up Terminal:
- 1. Click on the magnifying glass in the top right of your screen.
- 2. Type `Terminal` and press enter.
- 3. Type in the parts that look like `this` into Terminal.
-2. Install brew:
- 1. `ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)"`
- 2. `open https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20792`
- 3. Login and install XCode.
-3. Install Ruby & Friends:
- 1. `brew install curl git`
- 2. `bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )`
-4. Setup your environment:
- 1. `mkdir ~/repo ~/repo/rb ~/repo/rb/lytr && cd ~/repo/rb/lytr`
- 2. `source ~/.rvm/scripts/rvm && rvm install --default 1.9.2`
- 3. `rvmsrc='[[ -s "$HOME/.rvm/scripts/rvm" ]] && echo $rvmsrc >> ~/.bash_profile && echo $rvmsrc >> ~/.bashrc`
- 4. `curl https://github.com/krainboltgreene/dotfiles/blob/master/gemrc -o ~/.gemrc && open ~/.bashrc`
- 5. In gedit add `# ` in front (On the same line) as: `[ -z "$PS1" ] && return` if it's there.
-5. Install and setup GEdit:
- 1. ...
- 2. ...
- 3. ...
- 4. In gedit, open the Edit menu and go to Preferences.
- 5. Turn on `Highlight Cur...` and `Highlight Mat...`
- 6. Go to the Editor tab.
- 7. `Tab Width` change to 4. Turn On `Insert Spaces Inst...` and `Enable Auto...`
- 8. Save and close gedit. Type `exit` in the Terminal.
- 9. Add the Terminal & Gedit shortcuts to the dock
-
-### Results
-
-You should have working instances of Ruby Version Manager, Ruby 1.9.2, and Gedit.
-With a interpeter, an editor, and a computer you're well on your way to becoming a developer!
-If you happened to encoutner an error simply go to http://gist.github.com.
-Paste the error message (if you can) along with the step you were on.
-Then create a new issue at [my issues page](http://github.com/krainboltgreene/learn-you-the-ruby-for-awesome-power/issues) with the link to Gist.
-
-
-### Task Details
+1. Open up Terminal
+ * Type in the parts that look like `this` into Terminal.
+2. Install RVM Dependencies:
+ * `ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)"`
+ * `open https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20792`
+ * Login and install XCode.
+ * `brew install curl git`
+3. Install RVM
+ * `bash < <(curl http://rvm.beginrescueend.com/releases/rvm-install-head)`
+ * `rvmsrc='[[ -s "~/.rvm/scripts/rvm" ]]'`
+ * `echo $rvmsrc >> ~/.bash_profile && echo $rvmsrc >> ~/.bashrc`
+4. Install Ruby Dependencies
+ * `source ~/.rvm/scripts/rvm && rvm notes`
+ * Read the instructions from the above command, you're looking for the `mri` dependencies.
+5. Install Ruby
+ * `rvm install --default 1.9.2`
+6. Setup Environment
+ * `mkdir -p ~/Repository/lytr/` This is your project directory.
+ * `rvm -v`
+ * `ruby -v`
+ * `gem -v`
+ * Make sure all of the above commands didn't result in an error.
+7. Install Gedit
+ * ...
+ * Open Gedit
+8. Setup Gedit
+ * In gedit, open the Edit menu and go to Preferences.
+ * Turn on **Highlight Current Line**.
+ * Go to the Editor tab.
+ * Change **Tab Width** to 4.
+ Turn On **Insert Spaces Inst...** and **Enable Auto...**
+ * Save and close Gedit.
+
+**Results**
+
+You should have Git, RVM, Ruby 1.9.2, and Gedit installed and ready to use.
+
+**Details**
The steps above assume one thing: You know the very basics about using your computer.
If you don't understand how your computer works you need to take some classes, explore, and learn.
Don't go beyond this point until you do.
Ruby, and other languages, are tools and tools require that much respect to use.
+**Extra Credit**
+
+* Open a few text files with Gedit, get to know the interface.
+* Customize Gedit, Terminal, and your Operating System to better suit your style.
+* Type these in the Terminal:
+ * `rvm use 1.9.2@global`
+ * `gem install bundler rake`
+ * `rvm use 1.9.2`
+
+
+Task One
+--------
+
+**Summary**: Text & Output
+
+Now that you've gone through the installation and setup task you should know what the Terminal is.
+This task will show you how to print text directly to the Terminal.
+Don't remember what to do?
+Look [here](/book/chapter/1/).
+
+**Source Code**: File `~/Repository/lytr/task-1.rb`
+
+~~~ language-ruby
+puts "A Boy And His Lucky Dog"
+puts "================="
+puts "It was a cold winter morning in the Forgotten Valley."
+puts 'The boy looked to his dog and said, "Look there, Lucky!"'
+puts '"The Temple of Golden Arches!" The dog glumly barked.'
+puts "Venturing forth they climb down from the mountainside."
+puts '"We are sure to find lost treasure!"'
+puts 'The abandoned temple to the Golden Arches awaited.'
+~~~
+
+**Results**: Run `ruby task-1.rb`
+
+~~~ language-terminal
+A Boy And His Lucky Dog
+=================
+It was a cold winter morning in the Forgotten Valley.
+The boy looked to his dog and said, "Look there, Lucky!"
+"The Temple of Golden Arches!" The dog glumly barked.
+Venturing forth they climb down from the mountainside.
+"We are sure to find lost treasure!"
+The abandoned temple to the Golden Arches awaited.
+~~~
+
+**Details**
+
+Hey, look you just wrote your first Ruby Program!
+Just think, this time tomorrow you'll have written at least two programs, maybe three.
+I know it's pretty exciting, but lets calm down no need to exaust ourselves.
+What have we actually done by writing and running this problem, you ask?
+
+Well, lets see:
+
+1. You've written your first method.
+2. You've written your first string.
+3. You've used the `"` and `'` characters to signify a String.
+
+Running this script made a small story form before your very eyes.
+It's time to describe each portion of this source code:
+
+* Each line in the source code tells the Ruby interpreter to print the string out to the display.
+* The `puts` method, an action in Ruby, sends text to the output.
+ Specifically the Terminal, in this case.
+* `"` or the *double quote* and the `'` or the *single quote* are the syntax characters used to denote a String, in Ruby.
+* A String is a series of characters connected together.
+
+Notice that there is a space between `puts` and the first `"` or `'`.
+This is a single *whitespace* space character.
+You can put as many whitespace space characters as you want between `puts` and the String.
+The Ruby interpretor will ignore those spaces.
+Other *whitespace* characters include the tab character and the return character.
+
+**Extra Credit**
+
+* Change some of the words (other than puts) in the story.
+* Add some extra words and characters to the story.
+* Add some extra lines to the story with extra puts methods.
+* Change the `'` to `"` characters and run the code.
+ What happens?
+ Then revert to the original.
+* Change the `puts` method to something else and run the code.
+ What happens?
+ Then revert to the original.
+
+
+Task Two
+--------
+
+**Summary**: Numbers & Comments
+
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
+tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
+quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
+consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
+cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
+proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+
+**Source Code**: File `~/Repository/lytr/task-2.rb`
+
+~~~ language-ruby
+# This line is a comment. A comment is used to
+# document source code. This makes it easier to
+# read for others, and yourself.
+
+puts "The Wealthiest Merchant And His Daughter"
+puts "========================================"
+
+# Any part of a line after the pound sign is a comment, and not interpreted.
+
+puts "The boy and his lucky dog travelled along the wasteland together." # Like this.
+puts "They saw many things, but mostly trash and death." # These are comments
+puts "The adventurous two wandered through abandoned cities and towns."
+
+# puts "Avoiding raiders and wastelanders." # This is line is a comment.
+
+print "One time the two happened on a small village named "
+puts '"Wall Mart Town"'
+
+### You can put multiple pound signs, but it doesn't read anything after the
+## first pound sign. ##
+ # You can even indent the comments!
+
+print "\"Hey Lucky,\" the boy says"
+print " "
+puts "\"Lets check this place out!\""
+puts "The dog didn't think this was a good idea."
+~~~
+
+**Results**: Run `ruby task-2.rb`
+
+~~~ language-terminal
+The Wealthiest Merchant And His Daughter
+========================================
+The boy and his lucky dog travelled along the wasteland together.
+They saw many things, but mostly trash and death.
+The adventurous two wandered through abandoned cities and towns.
+One time the two happened on a small village named "Wall Mart Town"
+"Hey Lucky," the boy says "Lets check this place out!"
+The dog didn't think this was a good idea.
+~~~
+
+**Details**
+
+In the previous task you were introduced to the `puts` method.
+In this task we see a new method being used, the `print` method.
+You may notice something different about the output `print` produces.
+This is because `print` does **not** append a `\n` or *new line* character to the text, where `puts` does.
+This means that two lines of `print` will concatenate (or plug together) in the output.
+
+You may also notice two new characters introduced in this task.
+The first is the `#` character or *pound* sign, sometimes called a *hash*.
+You will notice in the Result that the text after the `#` are completely ignored!
+This is called a *comment*. Comments are bits of text used to describe the intent or process of the code around them.
+This is a great documentation tool and should be used when necessary to help others, and yourself, later understand things.
+
+The second special character you might have noticed is `\` character or *blackslash*.
+The `\` does two things depending on what character it is prepended to.
+In this source they are prepended to `"` characters.
+This use, inside `"` wrapped strings tells the interpreter to treat the `"` as a regular character instead of the start or end of a string.
+The `\` is printed directly if inside a `'` wrapped string.
+
+**Extra Credit**
+
+* Remove the first `#` character on line 14 and run the code.
+ What happens?
+* Add more string arguments to the `puts` and `print` methods.
+* Delete line 24 and run the code.
+ What happens?
+ Then revert the changes.
+* Insert `\n` characters into one of the strings wrapped with `"` characters and run the code.
+ What happens?
+ Then revert the changes.
+* Insert `\n` characters into one of the strings wrapped with `'` characters and run the code.
+ What happens?
+ Then revert the changes.
+
+
+Task Three
+--------
+
+**Summary**: Numbers, Lists & Expressions
+
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
+tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
+quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
+consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
+cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
+proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+
+**Source Code**: File `~/Repository/lytr/task-.rb`
+
+~~~ language-ruby
+"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
+tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
+quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
+consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
+cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
+proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
+~~~
+
+**Results**: Run `ruby task-.rb`
+
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
+tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
+quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
+consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
+cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
+proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+
+**Details**
+
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
+tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
+quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
+consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
+cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
+proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-### Extra Credit
+**Extra Credit**
-1. Open a few text files with gedit and get to know the interface.
-2. Customize Gedit, Terminal, and your Operating System to better suit your style.
-3. Go to the Learn You The Ruby website and read through the glossary.
-4. Type these in the Terminal:
- 1. `rvm use 1.9.2@global`
- 2. `gem install bundler heroku rake rack`
- 4. `rvm use 1.9.2`
+* Lorem ipsum dolor sit amet, consectetur adipisicing elit
+* Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+* Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.
View
2  content/book/chapter/3.markdown
@@ -1,2 +0,0 @@
-The Trail To Neverland
-======================
View
0  content/book/chapter/4.markdown
No changes.
View
0  content/book/chapter/5.markdown
No changes.
View
30 content/book/credits.markdown
@@ -0,0 +1,30 @@
+---
+title: "Credits"
+author: "Kurtis Rainbolt-Greene"
+---
+
+
+Inspiring Books
+---------------
+
+In no particular order:
+
+* [Learn You A Haskell For Great Good](http://learnyouahaskell.com/)
+* [Learn You Some Erlang For Great Good](http://learnyousomeerlang.com/)
+* [Learn Python The Hard Way](http://learnpythonthehardway.org/)
+* [Poignant Guide To Ruby](http://mislav.uniqpath.com/poignant-guide/)
+* [Eloquent Javascript](http://eloquentjavascript.net/)
+
+
+Inspiring Developers
+--------------------
+
+In no particular order:
+
+* [Michael Richter](http://ttmrichter.blogspot.com/)
+* [Fred Obermann]()
+* [Steve Klabnik](http://blog.steveklabnik.com/)
+* [Zachary Scott](http://zacharyscott.net/)
+* [Simon Eskildsen](http://sirupsen.com/)
+* [Zed Shaw](http://zedshaw.com/)
+* [_why-the-lucky-stiff](http://viewsourcecode.org/why/)
View
95 content/book/frequently-asked-questions.markdown
@@ -1,84 +1,53 @@
-FREQUENTLY ASKED QUESTIONS
-==========================
+---
+title: "Frequently Asked Questions"
+author: "Kurtis Rainbolt-Greene"
+---
-> **Q**: Is (Ruby||Programming) hard to learn?
-**A**: Programming is largely four things: Effort, Learning, Syntax, and Paradigms.
-This shouldn't be surprising, but the effort is the hardest part about learning how to program.
-Without the effort to work on things yourself you'll never go forward as a learner, no matter how much you read.
-The latter three are self explanitory, but here you go: You have to be willing to learn, constantly.
+Is This Going To Be Hard?
+-------------------------------------
+
+Programming is largely three things: Concepts, Syntax, and Paradigms.
+Concepts in programming tend to be universally the same, but Syntax and Paradigms can be wildly different.
+Paradigms are generally formed from the way languages use Syntax to abstract Concepts.
+So it should make sense that once you learn the Syntax, Concepts and Paradigms naturally follow.
+That said you have to be willing to learn, constantly, and forever.
Programming is a moving target even if you want to work with old stuff.
-Finally, learning any language requires learning the facets of the Paradigm and the particular syntax the language uses.
+In short: No, not hard, but not a trivial task.
-> **Q**: Who are you?
+Who Are You?
+------------
-**A**: I'm a hacker, writer, designer, and father.
-I have a keen interest in pushing the programming community forward by making it easier to jump into.
-Luckily I was gifted with the ability, fortitude, and foolishness to write a learning book.
+I'm the author of this book, a father, hacker, designer, and writer (as you may have gathered).
-> **Q**: Why do you like Ruby?
+Why Do You Like Ruby?
+---------------------
-**A**: I like Ruby because it's expressive syntax, and it's affinity for Domain Specific Languages.
-It was the first language I ever used seriously, and I hope to continue working with it.
+As a writer I find myself naturally enjoying the Ruby expressive syntax.
+It's a very human form of communication between man and machine, and that helped me ease into it.
It also happens that I can make a lot of money developing in Ruby.
-> **Q**: Who built this website?
+Who Built This Site?
+-----------------------
-**A**: I built this website!
+This is an easy one: I built this website!
All of it.
To elaborate I wrote the HTML with HAML, and the CSS with SASS.
-Each chapter is formatted with the Discount markdown language.
-The web site runs on Sinatra, a simple micro web framework.
-
-
-> **Q**: Why did you build this website?
-
-**A**: I built this website because I felt the tutorials out there, excluding \_why's, were dry and unapproachable.
-For a language that is as expressive and fun to develop with as Ruby, this seems like such a tragedy.
-
-
-> **Q**: Have you built any others?
-
-**A**: Other **Learn You The**'s? Not yet, but I seriously plan to.
-I look forward to finishing the LYTR website only to do a Factor, HTML/CSS, and many many more if I have the time.
-It's a rather time consuming task and I do love to bog myself down in projects.
-
-
-> **Q**: Can you help me make my own?
-
-**A**: I can and will help those who want to help others, all you have to do is contact
-me.
-
-
-> **Q**: You stole this from (LYAH || LYSE || LPTHW), didn't you!?
-
-**A**: Arrrgh, you found out my diabolical scheme...
-Actually, no it's more like "I was incredibly inspired by that book."
-The creators seem to enjoy my book, and that's really awesome for me.
-
-
-> **Q**: Is this website available in Russian?
-
-**A**: No, sadly it isn't available in Russian...Yet!
-I plan to have this work translated into as many languages as I possibly can.
-At the very least provide links to Google Translate.
-Because I'm lazy and poor, and that is easy and free.
+Each chapter is formatted with the RedCloth markdown language.
+The web site (and pdf) runs on Nanoc, a simple static site generating framework.
-> **Q**: What's with the duck and Soviet theme then?
+Why Did You Build This Website?
+--------------------------------
-**A**: That's actually a good question.
-It's a rather obscure joke that I will attempt to explain:
-You see, Ruby is a Duck-Typed language, right?
-And Ruby, the precious gem, is red (So is the color, obviously)!
-...Which is the primary color in Soviet Russia!
-So you see, it all makes sense:
-*In Soviet Ruby, Duck Types You!*
+I found that teaching was as much of a learning experience for me as it was for others.
-> **Q**: Are you a Socialist/Communist/Leninist?
+Can You Help Me?
+----------------
-**A**: I do sport an awesome goatee.
+I can and will help those who want to help others, all you have to do is contact
+me.
View
11 content/book/license.markdown
@@ -1,7 +1,11 @@
-Copyright
-============
+---
+title: "License"
+author: "Kurtis Rainbolt-Greene"
+---
+
+
This work is split into two parts: Literature and Source Code.
-Each part has a different license attached.
+Each part has a different license attached, as noted below:
Literature
@@ -16,6 +20,7 @@ Literature
[2]: http://creativecommons.org/licenses/by-sa/3.0/
[3]: http://learnyoutheruby.org/source.tar.gz
+
Source Code
-----------
View
47 content/book/table-of-contents.markdown
@@ -1,47 +0,0 @@
-Table Of Contents
-=================
-
-1. [And Then There Was Ruby](/book/chapter/1)
- * [HCP: Hackers, Code, And Programming](/book/chapter/1#section-one)
- * [def ruby](/book/chapter/1#section-two)
- * [The Ruby Revolution & Renaissance](/book/chapter/1#section-three)
- * [Rock Out To The Rock Star](/book/chapter/1#section-four)
- * [The Cherry Kool-Aid](/book/chapter/1#section-five)
- * [Credits & License](/book/chapter/1#section-six)
- * [How This Book Works](/book/chapter/1#section-seven)
-
-2. [Ready! Set! Hack.](/book/chapter/2)
- * [Task 0 - Installing](/book/chapter/2#section-one)
- * [Task 1 - Puts and Strings](/book/chapter/2#section-two)
- * [Task 2 - Print, Comments, and Backslash Characters](/book/chapter/2#section-three)
- * [Task 3 - Numbers, Math, and Interpolation](/book/chapter/2#section-four)
- * [Task 4 - ](/book/chapter/2#section-five)
- * [Task 5 - ](/book/chapter/2#section-six)
- * [Task 6 - ](/book/chapter/2#section-seven)
- * [Task 7 - ](/book/chapter/2#section-eight)
- * [Task 8 - ](/book/chapter/2#section-nine)
- * [Task 9 - ](/book/chapter/2#section-ten)
-
-3. [The Trail To Neverland](/book/chapter/3)
- * [Task 10 - ](/book/chapter/3#section-one)
- * [Task 11 - ](/book/chapter/3#section-two)
- * [Task 12 - ](/book/chapter/3#section-three)
- * [Task 13 - ](/book/chapter/3#section-four)
- * [Task 14 - ](/book/chapter/3#section-five)
- * [Task 15 - ](/book/chapter/3#section-six)
- * [Task 16 - ](/book/chapter/3#section-seven)
- * [Task 17 - ](/book/chapter/3#section-eight)
- * [Task 18 - ](/book/chapter/3#section-nine)
- * [Task 19 - ](/book/chapter/3#section-ten)
-
-4. [It's Rubies All The Way Down](/book/chapter/4)
- * [Task 20 - ](/book/chapter/4#section-one)
- * [Task 21 - ](/book/chapter/4#section-two)
- * [Task 22 - ](/book/chapter/4#section-three)
- * [Task 23 - ](/book/chapter/4#section-four)
- * [Task 24 - ](/book/chapter/4#section-five)
- * [Task 25 - ](/book/chapter/4#section-six)
- * [Task 26 - ](/book/chapter/4#section-seven)
- * [Task 27 - ](/book/chapter/4#section-eight)
- * [Task 28 - ](/book/chapter/4#section-nine)
- * [Task 29 - ](/book/chapter/4#section-ten)
View
26 content/index.markdown
@@ -1,3 +1,23 @@
-Learn You The Ruby For Awesome Power
-====================================
-![In Soviet Russia, Duck Types You!](/image/soviet-duck.png "In Soviet Russia, Duck Types You!")
+---
+title: "Learn You The Ruby For Awesome Power"
+author: "Kurtis Rainbolt-Greene"
+---
+
+
+Table Of Contents
+-----------------
+
+1. [Chapter One: Ruby](/book/chapter/1/)
+ 1. How This Book Works
+ 2. What Is Programming?
+ 3. What Is Ruby?
+ 4. The Red Culture
+ 5. Other Resources
+2. [Chapter Two: Values](/book/chapter/2/)
+ 1. Task Zero: Install & Setup
+ 2. Task One: Text & Output
+ 3. Task Two: Comments & Escapes
+ 4. Task Three: Numbers, Lists & Expressions
+ 5. Task Four: Pairs, Interpolation & Input
+3. [Frequently Asked Questions](/book/frequently-asked-questions/)
+4. [Credits](/book/credits/)
View
142 content/style/extra/_mixins.sass
@@ -1,31 +1,31 @@
-@mixin center
+=center
display: block
- @include margin-x(auto)
+ +margin-x(auto)
$outline_width: 5px
-@mixin outline($o: $outline_width)
- @include margin($o)
- @include padding($o)
+=outline($o: $outline_width)
+ +margin($o)
+ +padding($o)
$margin_width: 5px
-@mixin margin($m: $margin_width)
- @include margin-x($m)
- @include margin-y($m)
-@mixin margin-x($m: $margin_width)
+=margin($m: $margin_width)
+ +margin-x($m)
+ +margin-y($m)
+=margin-x($m: $margin_width)
margin-left: $m
margin-right: $m
-@mixin margin-y($m: $margin_width)
+=margin-y($m: $margin_width)
margin-top: $m
margin-bottom: $m
$padding_width: 5px
-@mixin padding($p: $padding_width)
- @include padding-x($p)
- @include padding-y($p)
-@mixin padding-x($p: $padding_width)
+=padding($p: $padding_width)
+ +padding-x($p)
+ +padding-y($p)
+=padding-x($p: $padding_width)
padding-left: $p
padding-right: $p
-@mixin padding-y($p: $padding_width)
+=padding-y($p: $padding_width)
padding-top: $p
padding-bottom: $p
@@ -33,85 +33,85 @@ $padding_width: 5px
$width: 1px
$style: solid
$color: rgba(0,0,0,1)
-@mixin thick-border($c: $color)
- @include border(2px, solid, $c)
-@mixin border($w: $width, $s: $style, $c: $color)
- @include border-north-east($w, $s, $c)
- @include border-south-west($w, $s, $c)
-
-@mixin border-north-west($w: $width, $s: $style, $c: $color)
- @include border-north($w, $s, $c)
- @include border-west($w, $s, $c)
-@mixin border-north-east($w: $width, $s: $style, $c: $color)
- @include border-north($w, $s, $c)
- @include border-east($w, $s, $c)
-@mixin border-south-west($w: $width, $s: $style, $c: $color)
- @include border-south($w, $s, $c)
- @include border-west($w, $s, $c)
-@mixin border-south-east($w: $width, $s: $style, $c: $color)
- @include border-south($w, $s, $c)
- @include border-east($w, $s, $c)
-
-@mixin border-north($w: $width, $s: $style, $c: $color)
+=thick-border($c: $color)
+ +border(2px, solid, $c)
+=border($w: $width, $s: $style, $c: $color)
+ +border-north-east($w, $s, $c)
+ +border-south-west($w, $s, $c)
+
+=border-north-west($w: $width, $s: $style, $c: $color)
+ +border-north($w, $s, $c)
+ +border-west($w, $s, $c)
+=border-north-east($w: $width, $s: $style, $c: $color)
+ +border-north($w, $s, $c)
+ +border-east($w, $s, $c)
+=border-south-west($w: $width, $s: $style, $c: $color)
+ +border-south($w, $s, $c)
+ +border-west($w, $s, $c)
+=border-south-east($w: $width, $s: $style, $c: $color)
+ +border-south($w, $s, $c)
+ +border-east($w, $s, $c)
+
+=border-north($w: $width, $s: $style, $c: $color)
border-top-width: $w
border-top-style: $s
border-top-color: $c
-@mixin border-south($w: $width, $s: $style, $c: $color)
+=border-south($w: $width, $s: $style, $c: $color)
border-bottom-width: $w
border-bottom-style: $s
border-bottom-color: $c
-@mixin border-west($w: $width, $s: $style, $c: $color)
+=border-west($w: $width, $s: $style, $c: $color)
border-left-width: $w
border-left-style: $s
border-left-color: $c
-@mixin border-east($w: $width, $s: $style, $c: $color)
+=border-east($w: $width, $s: $style, $c: $color)
border-right-width: $w
border-right-style: $s
border-right-color: $c
$horizontal: 3px
$vertical: 3px
-@mixin round($h: $horizontal, $v: $vertical)
- @include round-top($h, $v)
- @include round-bottom($h, $v)
-@mixin round-top($h: $horizontal, $v: $vertical)
- @include round-top-left($h, $v)
- @include round-top-right($h, $v)
-@mixin round-bottom($h: $horizontal, $v: $vertical)
- @include round-bottom-left($h, $v)
- @include round-bottom-right($h, $v)
-@mixin round-left($h: $horizontal, $v: $vertical)
- @include round-top-left($h, $v)
- @include round-bottom-left($h, $v)
-@mixin round-right($h: $horizontal, $v: $vertical)
- @include round-top-right($h, $v)
- @include round-bottom-right($h, $v)
-@mixin round-top-left($h: $horizontal, $v: $vertical)
+=round($h: $horizontal, $v: $vertical)
+ +round-top($h, $v)
+ +round-bottom($h, $v)
+=round-top($h: $horizontal, $v: $vertical)
+ +round-top-left($h, $v)
+ +round-top-right($h, $v)
+=round-bottom($h: $horizontal, $v: $vertical)
+ +round-bottom-left($h, $v)
+ +round-bottom-right($h, $v)
+=round-left($h: $horizontal, $v: $vertical)
+ +round-top-left($h, $v)
+ +round-bottom-left($h, $v)
+=round-right($h: $horizontal, $v: $vertical)
+ +round-top-right($h, $v)
+ +round-bottom-right($h, $v)
+=round-top-left($h: $horizontal, $v: $vertical)
$value: $h $v
-moz-border-radius-topleft: $value
-webkit-border-top-left-radius: $value
-o-border-top-left-radius: $value
border-top-left-radius: $value
-@mixin round-top-right($h: $horizontal, $v: $vertical)
+=round-top-right($h: $horizontal, $v: $vertical)
$value: $h $v
-moz-border-radius-topright: $value
-webkit-border-top-right-radius: $value
-o-border-top-right-radius: $value
border-top-right-radius: $value
-@mixin round-bottom-left($h: $horizontal, $v: $vertical)
+=round-bottom-left($h: $horizontal, $v: $vertical)
$value: $h $v
-moz-border-radius-bottomleft: $value
-webkit-border-bottom-left-radius: $value
-o-border-bottom-left-radius: $value
border-bottom-left-radius: $value
-@mixin round-bottom-right($h: $horizontal, $v: $vertical)
+=round-bottom-right($h: $horizontal, $v: $vertical)
$value: $h $v
-moz-border-radius-bottomright: $value
-webkit-border-bottom-right-radius: $value
-o-border-bottom-right-radius: $value
border-bottom-right-radius: $value
-@mixin column($columns, $gap: 5px)
+=column($columns, $gap: 5px)
-moz-column-count: $columns
-webkit-column-count: $columns
-o-column-count: $columns
@@ -126,7 +126,7 @@ $vertical_offset: 2px
$blur_radius: 2px
$spread_radius: 1px
$shadow_color: rgba( 10, 10, 10, .35)
-@mixin shadow($h: $horizontal_offset, $v: $vertical_offset, $c: $shadow_color, $b: $blur_radius, $s: $spread_radius)
+=shadow($h: $horizontal_offset, $v: $vertical_offset, $c: $shadow_color, $b: $blur_radius, $s: $spread_radius)
$value: $h $v $b $s $c
-moz-box-shadow: $value
-webkit-box-shadow: $value
@@ -138,7 +138,7 @@ $vertical_offset: 2px
$blur_radius: 3px
$spread_radius: 1px
$shadow_color: rgba( 10, 10, 10, .45)
-@mixin in-shadow($h: $horizontal_offset, $v: $vertical_offset, $c: $shadow_color, $b: $blur_radius, $s: $spread_radius)
+=in-shadow($h: $horizontal_offset, $v: $vertical_offset, $c: $shadow_color, $b: $blur_radius, $s: $spread_radius)
$value: $h $v $b $s $c inset
-moz-box-shadow: $value
-webkit-box-shadow: $value
@@ -149,14 +149,14 @@ $horizontal_offset: 1px
$vertical_offset: 1px
$blur_radius: 2px
$shadow_color: rgba( 10, 10, 10, .45)
-@mixin text-shadow($h: $horizontal_offset, $v: $vertical_offset, $c: $shadow_color, $b: $blur_radius)
+=text-shadow($h: $horizontal_offset, $v: $vertical_offset, $c: $shadow_color, $b: $blur_radius)
$value: $h $v $b $c
-moz-text-shadow: $value
-webkit-text-shadow: $value
-o-text-shadow: $value
text-shadow: $value
-@mixin rotate($r)
+=rotate($r)
-webkit-transform: rotate($r)
-moz-transform: rotate($r)
-o-transform: rotate($r)
@@ -165,7 +165,7 @@ $shadow_color: rgba( 10, 10, 10, .45)
$end: rgba(255,255,255,1)
$start: rgba(0,0,0,1)
-@mixin gradient-x($e: $end, $s: $start)
+=gradient-x($e: $end, $s: $start)
background: $e
background-image: -moz-linear-gradient(left, $s, $e)
background-image: -webkit-gradient(linear, left center, right center, from($s), to($e))
@@ -175,7 +175,7 @@ $start: rgba(0,0,0,1)
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=$s, endColorstr=$e, GradientType=1)
-ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=$s, endColorstr=$e, GradientType=1)
background-image: -ms-linear-gradient(left, $s, $e)
-@mixin gradient-y($e: $end, $s: $start)
+=gradient-y($e: $end, $s: $start)
background: $e
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=$s, endColorstr=$e)
-ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=$s, endColorstr=$e)
@@ -187,14 +187,14 @@ $start: rgba(0,0,0,1)
background-image: linear-gradient(top, $s, $e)
$stripe_color: rgba(0,0,0,1)
-@mixin background-stripes($sc: $stripe_color)
+=background-stripes($sc: $stripe_color)
background-image: -webkit-repeating-linear-gradient(35deg, transparent, transparent 35px, $sc 35px, $sc 70px)
background-image: -moz-repeating-linear-gradient(35deg, transparent, transparent 35px, $sc 35px, $sc 70px)
background-image: -o-repeating-linear-gradient(35deg, transparent, transparent 35px, $sc 35px, $sc 70px)
background-image: repeating-linear-gradient(35deg, transparent, transparent 35px, $sc 35px, $sc 70px)
$stripe_color: rgba(0,0,0,1)
-@mixin background-stripes($sc: $stripe_color)
+=background-stripes($sc: $stripe_color)
background-image: -webkit-repeating-linear-gradient(35deg, transparent, transparent 35px, $sc 35px, $sc 70px)
background-image: -moz-repeating-linear-gradient(35deg, transparent, transparent 35px, $sc 35px, $sc 70px)
background-image: -o-repeating-linear-gradient(35deg, transparent, transparent 35px, $sc 35px, $sc 70px)
@@ -202,23 +202,23 @@ $stripe_color: rgba(0,0,0,1)
$before: 1.0
$after: 0.5
-@mixin fade-out($b: $before, $a: $after)
+=fade-out($b: $before, $a: $after)
opacity: $b
&:hover
opacity: $a
$before: 0.50
$after: 1.0
-@mixin fade-in($b: $before, $a: $after)
+=fade-in($b: $before, $a: $after)
opacity: $b
&:hover
opacity: $a
-@mixin serif-font($ff: 'Georgia')
+=serif-font($ff: 'Georgia')
font-family: $ff, Georgia, Garamond, Palatino, Trajan, Baskerville, "Droid Serif", "Groudy old Style", serif
-@mixin sans-serif-font($ff: 'Helvetica')
+=sans-serif-font($ff: 'Helvetica')
font-family: $ff, Helvetica, Myriad, Optima, Futura, Trebuchet, "Droid Sans", Tahoma, sans-serif
-@mixin monospace-font($ff: 'Inconsolata')
+=monospace-font($ff: 'Inconsolata')
font-family: $ff, Inconsolata, "Anonymous Pro", "Droid Sans Mono", monospace
View
28 content/style/extra/_variables.sass
@@ -1,17 +1,15 @@
-// Theme Pallet
-$major_theme_color: rgba(232,232,232,1) // Congress Grey
-$base_theme_color: rgba(246,246,246,1) // Stone White
-$minor_theme_color: rgba(153,1,0,1) // Bloodstain Red
-
-$dark_theme_color: rgba(51,51,51,1) // Asphalt Gravel
-$bright_theme_color: rgba(185,5,4,1) // Fresh Blood
+// Basic Colors
+$black: rgba(0,0,0,1)
+$white: rgba(255,255,255,1)
+$grey: rgba(127,127,127,1)
-$black: rgba(15,15,15,1)
-$grey: rgba(125,125,125,1)
-$white: rgba(240,240,240,1)
+$red: rgba(255,0,0,1)
+$green: rgba(0,255,0,1)
+$blue: rgba(0,0,255,1)
-// Typography
-$font_size: 10px
-$link_color: $minor_theme_color
-$text_color: $black
-$background_color: $white
+// Theme Pallet
+$major_color: #F6F6F6 // Steel Grey
+$minor_color: #E8E8E8 // Congress Grey
+$base_color: #FAF5E6 // Paper Tan
+$dark_color: #333333 // Graphite Grey
+$bright_color: #990100 // Dry Blood
View
109 content/style/extra/reset.sass
@@ -1,10 +1,10 @@
@import "mixins", "variables"
html,body,div,span,object,iframe,hr,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,button,label,legend,input,textarea,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,figure,footer,header,hgroup,menu,nav,section,menu,time,mark,audio,video
- margin: 0
- padding: 0
- border: 0 none
- outline: 0
- outline-offset: 0
+ margin: 0px
+ padding: 0px
+ border: 0px none
+ outline: 0px
+ outline-offset: 0px
font-size: inherit
text-decoration: none
vertical-align: baseline
@@ -25,7 +25,7 @@ del
text-decoration: line-through
ins,mark
background-color: #ff9
- color: #000
+ color: $black
ins
text-decoration: none
mark
@@ -33,97 +33,92 @@ mark
font-weight: bold
table
border-collapse: collapse
- border-spacing: 0
+ border-spacing: 0px
hr
height: 1px
- border-top: 1px solid #ccc
- margin: 1em 0
+ border-top: 1px solid $grey
+ margin: 1em 0px
abbr[title],dfn[title]
- border-bottom: 1px dotted #000
+ border-bottom: 1px dotted $black
cursor: help
input,select
vertical-align: middle
\:focus
- outline: 0
+ outline: 0px
html
overflow-y: scroll
body
width: 100%
- background: #fff
- color: #000
- @include sans-serif-font
- font-size: $font_size
+ background: $white
+ color: $black
+ +sans-serif-font
+ font-size: 10px
-webkit-font-smoothing: antialiased
text-rendering: optimizeLegibility
h1, h2, h3, h4, h5, h6
- @include outline
+ +outline
text-rendering: optimizeLegibility
h1, h2, h6
- @include sans-serif-font('Nobile')
+ +sans-serif-font
font-weight: bold
h3, h4, h5
font-weight: normal
h1
- font-size: $font_size * 6
+ font-size: 72px
h2
- font-size: $font_size * 5
+ font-size: 64px
h3
- font-size: $font_size * 4
+ font-size: 48px
h4
- font-size: $font_size * 3
+ font-size: 32px
h5
- font-size: $font_size * 2
+ font-size: 24px
h6
- font-size: $font_size * 1.5
+ font-size: 18px
+
p, ol, ul, pre
- @include outline
+ +outline
line-height: 1.75
blockquote
- @include outline
+ +outline
padding-left: 4.5em
& p
- @include outline
- @include serif-font('Merriweather')
+ +outline
+ +serif-font
font-size: 1.2em
font-style: italic
& cite
font-size: .75em
text-decoration: underline
p
- @include serif-font
- font-size: $font_size * 1.6
+ +serif-font
+ font-size: 16px
text-align: left
pre, code
- white-space: pre
- white-space: pre-wrap
- white-space: pre-line
word-wrap: break-word
- @include monospace-font
+ +monospace-font
+ white-space: pre
+ //white-space: pre-wrap
+ //white-space: pre-line
ul, ol
- font-size: $font_size * 1.6
+ font-size: 16px
& li
- @include margin-y(1em)
- @include margin-x(1.75em)
+ +margin-y(5px)
+ margin-left: 5px
& ul, & ol
- @include margin-y(0)
- @include margin-x(1.75em)
+ +margin-y(0px)
+ margin-left: 5px
ul
list-style: disc inside
ol
list-style: decimal inside
hr
height: .25px
- @include center
- border: 1px dotted rgba(25,25,25,.75)
+ +center
+ border: 1px dotted $grey
a
- color: $link_color
+ color: blue
text-decoration: none
- &:hover
- color: $link_color - 100
- boder-bottom: 1px dotted
- &:active
- color: #607890
- outline: none
&:focus
outline: thin dotted
&:link
@@ -136,22 +131,22 @@ sup
vertical-align: super
form
& label
- @include outline
- @include sans-serif-font
- font-size: $font_size * 1.8
+ +outline
+ +sans-serif-font
+ font-size: 18px
font-weight: bold
line-height: 1.75
& select
- @include sans-serif-font
- color: $text_color
- font-size: $font_size * 1.8
+ +sans-serif-font
+ color: $black
+ font-size: 18px
& input, & textarea
border: 1px solid $black
width: auto
- @include outline
- @include sans-serif-font
- color: $text_color
- font-size: $font_size * 1.4
+ +outline
+ +sans-serif-font
+ color: $black
+ font-size: 14px
&[type=text], &[type=email], &[type=password]
background: $white
& textarea
View
77 content/style/main.sass
@@ -1,14 +1,65 @@
@import "extra/mixins", "extra/variables", "extra/reset"
-pre
- width: 400px
- @include outline
- @include center
- @include round
- @include in-shadow
- background: $grey + 45
- & code.language-ruby
- @include outline
- @include center
- font-size: 14px
- & .i
- color: $bright_theme_color
+
+body
+ background: $base_color
+ & header
+ +outline
+ margin-bottom: 150px
+ +center
+ width: 960px
+ & h1
+ +outline(25px)
+ & h5
+ text-align: right
+ & article
+ +outline
+ +center
+ width: 840px
+ & h2
+ +padding-y(25px)
+ +center
+ color: $bright_color
+ text-align: center
+ & p, & li, & blockquote
+ color: $dark_color
+ font-size: 18px
+ & code
+ +outline(3px)
+ +round
+ color: $base_color
+ background: $dark_color url(image/black_denim.png) repeat
+ & blockquote
+ width: 600px
+ +padding
+ +center
+ & hr, & p
+ +margin(0px)
+ +padding-x(10px)
+ color: $major_color
+ background: $dark_color
+ & pre
+ +outline(25px)
+ +padding(0px)
+ +round
+ background: $dark_color url(image/black_denim.png) repeat
+ & code
+ color: $base_color
+ font-size: 14px
+ & .no
+ +padding
+ color: $dark_color
+ background: $base_color
+ white-space: pre-line
+ & .i
+ color: $bright_color
+ font-weight: bold
+ & .r
+ color: $major_color
+ font-weight: bold
+ & .dl
+ & .s
+ color: $green
+ & footer
+ +outline
+ +center
+ width: 960px
View
2  layouts/default.haml
@@ -17,6 +17,8 @@
%body
%header
%h1= @item[:title]
+ %hr
+ %h5 By #{@item[:author]}
%article
= yield
View
2  lib/filters/redcarpet_filter.rb
@@ -5,6 +5,6 @@ class RedcarpetFilter < Nanoc3::Filter
type :text
def run(content, params={})
- Redcarpet.new(content, :smart, :filter_html, :generate_toc, :fenced_code).to_html
+ Redcarpet.new(content, :filter_html, :fenced_code).to_html
end
end
View
453 output/book/chapter/1/index.html
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<html lang='en'>
<head>
-<title></title>
+<title>Chapter One: Ruby</title>
<meta charset='utf-8' />
<meta content='en' name='language' />
-<meta content='2011-06-05 07:25:53 -0700' name='created' />
+<meta content='2011-06-24 23:38:17 -0700' name='created' />
<meta content='Kurtis Rainbolt-Greene' name='author' />
<meta content='A Book On How To Program With The Ruby Language' name='description' />
<meta content='ruby, programming, hacking, learning, tutorial, book, free' name='keywords' />
@@ -16,348 +16,175 @@
</head>
<body>
<header>
-<h1></h1>
+<h1>Chapter One: Ruby</h1>
+<hr />
+<h5>By Kurtis Rainbolt-Greene</h5>
</header>
<article>
-<h1 id="toc_0">And Then There Was Ruby</h1>
+<h2>How This Book Works</h2>
-<p><strong>Note: If you want to get straight to hacking start at <a href="/chapter/2">Chapter 2: Ready! Set! Hack</a>.</strong></p>
+<p><strong>Good,</strong> you've heroically started reading the book!
+I promise the this chapter won't be too terribly boring.
+Each chapter will be brief, but important, so read it all.
+Inside of each chapter you will see <em>five sections</em>, and each section will have:</p>
-<h2 id="toc_1">HCP: Hackers, Code, and Programming</h2>
-<blockquote>
-<p>The computer programmer is a creator of universes for which he alone is responsible.</p>
-
-<h2 id="toc_2">Universes of virtually unlimited complexity can be created in the form of computer programs.</h2>
-
-<p><strong>Joseph Weizenbaum</strong>, Computer Power and Human Reason</p>
-</blockquote>
-<p>If you’ve watched any news in the last ten years, read any newspapers in the last fifteen (Some people still do!), or talked to that technically inclined cousin of yours, then you’ve probably heard three words that are specific to this field:</p>
+<ul>
+<li>A brief summary of what the section will teach you</li>
+<li>A bit of ruby code</li>
+<li>The resulting output of the code</li>
+<li>A detailed description of each (new) important part</li>
+<li>Some extra credit tasks</li>
+</ul><p>Now that I've given you the keys to this map lets figure out what you should do when you read a new chapter (some of this is explained later):</p>
<ol>
-<li>Hacker (or Hacking)</li>
-<li>Code (or coding)</li>
-<li>Programming (Or programs)</li>
-</ol><p>Lets talk about each one specifically since they’re going to be so prevalent in the next ten years of your life should you decide to be a programmer.
-The first and most complicated word is <em>Hacker</em>.
-You’ve probably heard it in a very negative tone, often defined as a person who uses computers to illegally gain access to computers to hinder or damage.
-Hell, you’ve probably had some idiot claim to be a hacker in order to intimidate you into doing something.</p>
-
-<p><strong>Guess what</strong>: That’s not what <em>hacker</em> means.
-No, there’s already a name for people who do what I just described: Criminals.
-They don’t need a special name to help them appear more mysterious or dangerous.
-In reality, a hacker is a member of the hacker subculture and simply an individual who seeks to learn as much as possible using technology.
-Usually under a self-defined code of ethics, not necessarily ones that reflect common law.
-Many consider the only method of learning is to examine, since the information necessary for their own enlightenment is not free.‏</p>
-
-<p><img src="/image/hacker.png" alt="Real Hackers" title="Yeah, it's kinda like that."></p>
-
-<p>The latter two terms are less culturally significant but should still be defined and talked about: <em>Programming</em> is the act of writing code, using a programming language.
-A programming language is the language we, humans, use to instruct computers, dumb pieces of plastic, on what to do.
-A program (or script) is a list of instructions that you’ve laid out for the computer to follow and complete.
-Programs are sometimes called software, applications, or scripts depending on the complexity or detail involved in using them.</p>
-
-<p>The act of programming is to write these scripts or applications in a programming language, like Ruby.
-A computer only knows how and when to do things if you tell it to in it’s own language, Binary.</p>
-
-<h3 id="toc_3">Binary’s Count 1 To 10, Print Sum</h3>
-
-<pre><code class="language-binary"><span class="no"> 1</span> 00110001 00000000 00000000
-<span class="no"> 2</span> 00110001 00000001 00000001
-<span class="no"> 3</span> 00110011 00000001 00000010
-<span class="no"> 4</span> 01010001 00001011 00000010
-<span class="no"> 5</span> 00100010 00000010 00001000
-<span class="no"> 6</span> 01000011 00000001 00000000
-<span class="no"> 7</span> 01000001 00000001 00000001
-<span class="no"> 8</span> 00010000 00000010 00000000
-<span class="no"> 9</span> 01100010 00000000 00000000
-</code></pre>
-
-<p>This program tells the computer to take every number from 1 to 10, add them together, and display the sum (55).
-It’s complex, arcane, and completely unreadable to the naked eye for most people.
-Would you believe that people actually programmed applications this way?
-Simple software, like a calculator, required complex and time consuming work that was error prone and easily crashed.
-The same code is written here in Ruby:</p>
-
-<h3 id="toc_4">Ruby’s Count 1 To 10, Print Sum</h3>
-
-<pre><code class="language-ruby"><span class="no">1</span> total = <span class="i">0</span>
-<span class="no">2</span> count = <span class="i">1</span>
-<span class="no">3</span>
-<span class="no">4</span> <span class="r">while</span> count &lt;= <span class="i">10</span>
-<span class="no">5</span> total += count
-<span class="no">6</span> count += <span class="i">1</span>
-<span class="no">7</span> <span class="r">end</span>
-</code></pre>
-
-<p>Or even:</p>
-
-<pre><code class="ruby"> print (1..10).sum
-</code></pre>
-
-<p><img src="http://dummyimage.com/300/00/44.png&amp;text=Awesome%20Placeholder" alt="Awesome Placeholder Image" title="So awesome."></p>
-
-<p>It’s obvious in the previous two examples that programming languages are a tool for making developing easier.
-Programming in Ruby works by writing text (like above), having the Ruby interpreter compile it, and getting the result of your work.
-The next two examples are exactly the same, first in Java a really powerful and common language, the second in Ruby:</p>
+<li>Read the brief summary, don't worry if you don't fully understand it.</li>
+<li>In your <em>project directory</em> create a new file called <code>task-n.rb</code> where n is the task number.</li>
+<li>Write everything from the code into the file. <strong>Do not copy and paste</strong>.</li>
+<li>Read the detailed description and the code you just wrote.</li>
+<li>Run the code. <strong>Note</strong>: Some sections will have <strong>secret bugs</strong> just for you to figure out!</li>
+<li>If you feel confidant check out the extra credit, change the code, and get messy!</li>
+</ol><p>Once you've followed each step you should understand another part of how Ruby works.
+Stick with it you'll be hacking out programs left and right.</p>
-<h3 id="toc_5">Java’s “Hello, World”</h3>
+<h2>What Is Programming?</h2>
+<blockquote>
+<p>The computer programmer is a creator of universes for which he alone is responsible.
+Universes of virtually unlimited complexity can be created in the form of computer programs.</p>
-<pre><code class="java"> public class HelloWorld {
- public static void main(String[] args) {
- System.out.println(“Hello, World”);
- }
- }
+<hr>
+<p><strong>Joseph Weizenbaum</strong>, Computer Power and Human Reason</p>
+</blockquote>
+<p>Programming, Hacking, Coding, Developing, and many other words for the same thing:
+Writing instructions in a strange language that the computer will interperate and then act on.
+People have been doing it since the early 1970's.
+While the process is dramatically different, the ideas and concepts are nearly identical.</p>
+
+<p>To put it as vaguely as possible, because the fine details aren't important, programming is writing instructions for the computer to act on.
+That's it, no pretty wording or complex phrases, nothing really hard to comprehend.
+For Ruby that means something that'll look like this:</p>
+
+<pre><code class="language-ruby"><span class="no">1</span> <span class="r">def</span> <span class="fu">chores</span>
+<span class="no">2</span&