Skip to content

Commit

Permalink
Merge branch 'release/misc-chapter1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurtis Rainbolt-Greene committed Jun 25, 2011
2 parents d1009ae + fb4de1e commit 93ffb40
Show file tree
Hide file tree
Showing 37 changed files with 1,473 additions and 1,601 deletions.
19 changes: 8 additions & 11 deletions 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'
72 changes: 21 additions & 51 deletions 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)
Expand All @@ -61,40 +45,26 @@ 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)

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)
28 changes: 22 additions & 6 deletions README
Expand Up @@ -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.
Expand All @@ -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"
~~~
44 changes: 40 additions & 4 deletions 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)] }

0 comments on commit 93ffb40

Please sign in to comment.