Skip to content

Commit

Permalink
bundle update; fix failing deck.js test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexch committed Jan 22, 2014
1 parent 7504c5c commit 3723646
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 42 deletions.
84 changes: 48 additions & 36 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ GEM
active_support (3.0.0)
activesupport (= 3.0.0)
activesupport (3.0.0)
bourbon (3.0.1)
bourbon (3.1.8)
sass (>= 3.2.0)
thor
coderay (1.0.8)
coderay (1.1.0)
daemons (1.1.9)
deckrb (0.5.0)
deckrb (0.5.2)
coderay
erector (>= 0.9.0)
json
Expand All @@ -19,62 +19,74 @@ GEM
redcarpet (~> 2)
thin
trollop
diff-lcs (1.1.3)
diff-lcs (1.2.5)
erector (0.9.0)
treetop (>= 1.2.3)
eventmachine (1.0.3)
eventmachine (1.0.3-x86-mingw32)
ffi (1.9.3)
ffi (1.9.3-x86-mingw32)
files (0.3.1)
json (1.7.6)
listen (0.7.2)
nokogiri (1.5.6)
nokogiri (1.5.6-x86-mingw32)
json (1.8.1)
listen (1.0.3)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
rb-kqueue (>= 0.2)
mini_portile (0.5.2)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
nokogiri (1.6.1-x86-mingw32)
mini_portile (~> 0.5.0)
polyglot (0.3.3)
predicated (0.2.6)
rack (1.5.2)
rack-codehighlighter (0.5.0)
nokogiri (>= 1.4.1)
rack (>= 1.0.0)
rack-protection (1.3.2)
rack-protection (1.5.2)
rack
rack-test (0.6.2)
rack (>= 1.0)
rake (10.0.3)
rb-fsevent (0.9.3)
redcarpet (2.2.2)
rerun (0.8.0)
listen
rspec (2.12.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
rspec-mocks (~> 2.12.0)
rspec-core (2.12.2)
rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3)
rspec-mocks (2.12.2)
ruby2ruby (2.0.3)
rake (10.1.1)
rb-fsevent (0.9.4)
rb-inotify (0.9.3)
ffi (>= 0.5.0)
rb-kqueue (0.2.0)
ffi (>= 0.5.0)
redcarpet (2.3.0)
rerun (0.8.2)
listen (~> 1.0.3)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.7)
rspec-expectations (2.14.4)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.4)
ruby2ruby (2.0.7)
ruby_parser (~> 3.1)
sexp_processor (~> 4.0)
ruby_parser (3.1.1)
ruby_parser (3.3.0)
sexp_processor (~> 4.1)
sass (3.2.5)
sexp_processor (4.1.4)
sinatra (1.3.4)
sass (3.2.13)
sexp_processor (4.4.1)
sinatra (1.4.4)
rack (~> 1.4)
rack-protection (~> 1.3)
tilt (~> 1.3, >= 1.3.3)
thin (1.5.0)
rack-protection (~> 1.4)
tilt (~> 1.3, >= 1.3.4)
thin (1.6.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
eventmachine (>= 1.0.0)
rack (>= 1.0.0)
thor (0.17.0)
tilt (1.3.3)
treetop (1.4.12)
thor (0.18.1)
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
trollop (2.0)
wrong (0.7.0)
diff-lcs (~> 1.1.2)
wrong (0.7.1)
diff-lcs (~> 1.2.5)
predicated (~> 0.2.6)
ruby2ruby (>= 2.0.1)
ruby_parser (>= 3.0.1)
Expand Down
15 changes: 11 additions & 4 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def sites_dir= dir
end

def set_downstream_app
# todo: make this an upstream app instead?
@app = ::Deck::RackApp.public_file_server
end

Expand Down Expand Up @@ -121,6 +122,7 @@ def render_page

rescue Errno::ENOENT => e
p e
puts "\t#{caller[0..2].join("\n\t")}"
halt 404
end
end
Expand Down Expand Up @@ -187,11 +189,16 @@ def render_page
end

get "/:site/:name/:section" do
if params[:site] == "es"
params[:site] = "es/#{params[:name]}"
params[:name] = params[:section]

if params[:site] == 'deck.js' # hack: todo: put the deck.js file server *ahead* in the rack chain
forward
else
if params[:site] == "es"
params[:site] = "es/#{params[:name]}"
params[:name] = params[:section]
end
render_page
end
render_page
end

get "/:file.:ext" do
Expand Down
8 changes: 6 additions & 2 deletions spec/app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ def true_app
true_app = app
until true_app.is_a? InstallFest
next_app =
true_app.respond_to?(:app) ?
true_app.app :
if true_app.respond_to?(:app)
true_app.app
elsif true_app.is_a?(Sinatra::Wrapper)
true_app.instance_variable_get(:@instance)
else
true_app.instance_variable_get(:@app)
end
break if next_app.nil?
true_app = next_app
end
Expand Down

0 comments on commit 3723646

Please sign in to comment.