Permalink
Browse files

Adding new gems, filters, and styles.

Signed-off-by: Kurtis Rainbolt-Greene <kurtisrainboltgreene@gmail.com>
  • Loading branch information...
Kurtis Rainbolt-Greene
Kurtis Rainbolt-Greene committed Jun 5, 2011
1 parent d1839d0 commit faace2fb55ff65d024a0f6812621f65615b285a6
View
@@ -4,8 +4,8 @@ gem 'nanoc', '~> 3.1.7'
gem 'haml', '~> 3.1.1'
gem 'sass', '~> 3.1.1'
-gem 'rdiscount', '~> 1.6.8'
-gem 'highlight', '~> 1.1.2', :require => 'simplabs/highlight'
+gem 'redcarpet', '~> 1.15.2'
+gem 'coderay', '~> 0.9.8'
gem 'heroku', '~> 2.1.4'
View
@@ -1,102 +0,0 @@
-GEM
- remote: http://rubygems.org/
- specs:
- activesupport (3.0.7)
- archive-tar-minitar (0.5.2)
- capybara (0.4.1.2)
- celerity (>= 0.7.9)
- culerity (>= 0.2.4)
- 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)
- childprocess (0.1.9)
- ffi (~> 1.0.6)
- chronic (0.4.0)
- columnize (0.3.2)
- configuration (1.2.0)
- 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)
- launchy (>= 0.3.2)
- rest-client (~> 1.6.1)
- term-ansicolor (~> 1.0.5)
- highlight (1.1.2)
- activesupport (>= 2.0.0)
- json_pure (1.5.1)
- 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)
- 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)
- rdiscount (1.6.8)
- rest-client (1.6.3)
- mime-types (>= 1.16)
- rspec (2.6.0)
- rspec-core (~> 2.6.0)
- rspec-expectations (~> 2.6.0)
- rspec-mocks (~> 2.6.0)
- rspec-core (2.6.3)
- 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)
- ffi (>= 1.0.7)
- json_pure
- rubyzip
- term-ansicolor (1.0.5)
- trollop (1.16.2)
- xpath (0.1.4)
- nokogiri (~> 1.3)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- capybara (~> 0.4.1.2)
- delorean (~> 1.0.0)
- haml (~> 3.1.1)
- heroku (~> 2.1.4)
- highlight (~> 1.1.2)
- nanoc (~> 3.1.7)
- rbtrace (~> 0.3.13)
- rdiscount (~> 1.6.8)
- rspec (~> 2.6.0)
- ruby-debug19 (~> 0.11.6)
- sass (~> 3.1.1)
View
2 Rules
@@ -9,7 +9,7 @@ compile '/style/*' do
end
compile '*' do
- filter :rdiscount, { :autolink => true, :smart => true }
+ filter :redcarpet
filter :colorize_syntax
layout 'default'
end
@@ -3,7 +3,7 @@ And Then There Was Ruby
**Note: If you want to get straight to hacking start at [Chapter 2: Ready! Set! Hack](/chapter/2).**
-[HCP: Hackers, Code, and Programming](id:section-one)
+HCP: Hackers, Code, and Programming
-----------------------------------------------------
> The computer programmer is a creator of universes for which he alone is responsible.
@@ -41,7 +41,7 @@ A computer only knows how and when to do things if you tell it to in it's own la
### Binary's Count 1 To 10, Print Sum
-
+~~~ { language-binary }
00110001 00000000 00000000
00110001 00000001 00000001
00110011 00000001 00000010
@@ -51,6 +51,7 @@ A computer only knows how and when to do things if you tell it to in it's own la
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.
@@ -60,11 +61,21 @@ The same code is written here in Ruby:
### Ruby's Count 1 To 10, Print Sum
-<script src="http://gist.github.com/654757.js?file=count-to-ten.rb"></script>
+``` ruby
+ total = 0
+ count = 1
+
+ while count <= 10
+ total += count
+ count += 1
+ end
+```
Or even:
-<script src="http://gist.github.com/654757.js?file=alt-count-to-ten.rb"></script>
+``` ruby
+ print (1..10).sum
+```
![Awesome Placeholder Image](http://dummyimage.com/300/00/44.png&text=Awesome%20Placeholder "So awesome.")
@@ -74,18 +85,26 @@ The next two examples are exactly the same, first in Java a really powerful and
### Java's "Hello, World"
-<script src="http://gist.github.com/654757.js?file=hello-world.java"></script>
+``` java
+ public class HelloWorld {
+ public static void main(String[] args) {
+ System.out.println("Hello, World");
+ }
+ }
+```
### Ruby's "Hello, World"
-<script src="http://gist.github.com/654757.js?file=hello-world.rb"></script>
+``` ruby
+ print 'Hello, World'
+```
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.
-[def ruby](id:section-two)
+def ruby
--------------------------
> A dynamic, open source programming language with a focus on simplicity and productivity.
@@ -1,3 +1,104 @@
-# Ready! Set! Hack.
+Ready! Set! Hack.
+=================
**Note: I adore notes.**
+[T0](id:section-one) Installing Ruby
+-----------------------------------------------------
+
+\![Awesome Placeholder Image](http://dummyimage.com/300/00/44.png&text=Awesome%20Placeholder "So awesome.")
+
+### Summary
+
+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
+
+#### 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
+
+#### Windows
+
+1. Magic Happens.
+
+#### 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
+
+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
+
+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`
View
@@ -1 +1,15 @@
@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
+ margin-top: -15px
+ @include center
+ font-size: 14px
+ & .i
+ color: $bright_theme_color
@@ -0,0 +1,10 @@
+require 'redcarpet'
+
+class RedcarpetFilter < Nanoc3::Filter
+ identifier :redcarpet
+ type :text
+
+ def run(content, params={})
+ Redcarpet.new(content, :smart, :filter_html, :generate_toc, :fenced_code).to_html
+ end
+end
Oops, something went wrong.

0 comments on commit faace2f

Please sign in to comment.