Move the deploy-mode Gemfile/config.ru stuff to the master branch.

This commit is contained in:
Nathan Weizenbaum 2013-10-13 15:42:08 -04:00
parent df2e4415ff
commit eec20ea771
4 changed files with 42 additions and 31 deletions

34
Gemfile
View File

@ -1,22 +1,22 @@
source "http://rubygems.org"
source "https://rubygems.org"
gem "builder"
gem "rake"
#gem "kss"
gem "middleman", "~>3.1.5"
gem "middleman-favicon-maker"
gem "middleman-livereload"
gem "middleman-syntax"
#gem "middleman-smusher"
gem "redcarpet"
gem "susy", "2.0.0.alpha.4"
gem "breakpoint"
gem "typogruby"
gem "wdm", "~> 0.1.0", :platforms => [:mswin, :mingw]
gem 'rack-rewrite'
platforms :mri_18 do
group :development do
gem "middleman", "~>3.1.5"
gem "middleman-favicon-maker"
gem "middleman-livereload"
gem "middleman-syntax"
gem "redcarpet"
gem "susy", "2.0.0.alpha.4"
gem "breakpoint"
gem "typogruby"
gem "wdm", "~> 0.1.0", :platforms => [:mswin, :mingw]
platforms :mri_18 do
gem "ruby18_source_location"
end
end
group :deploy do
gem 'rack-rewrite'
end
# gem "rack-codehighlighter"
# gem "pygments.rb"

View File

@ -1,5 +1,5 @@
GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
activesupport (3.2.14)
i18n (~> 0.6, >= 0.6.4)
@ -7,7 +7,6 @@ GEM
breakpoint (2.0.7)
compass (>= 0.12.1)
sass (>= 3.2.0)
builder (3.2.2)
chunky_png (1.2.8)
coffee-script (2.2.0)
coffee-script-source
@ -123,7 +122,6 @@ PLATFORMS
DEPENDENCIES
breakpoint
builder
middleman (~> 3.1.5)
middleman-favicon-maker
middleman-livereload

View File

@ -1,4 +1,3 @@
require "builder"
require 'susy'
require 'breakpoint'
require 'middleman-syntax'

View File

@ -1,12 +1,26 @@
require "rubygems"
require "middleman"
require "typogruby"
require "rack/rewrite"
use Rack::Rewrite do
if ENV["HEROKU"].nil? || ENV["HEROKU"] == 'false'
require "middleman"
run Middleman.server
else
require "rack/rewrite"
use Rack::Rewrite do
r301 %r{/docs/yardoc/(.*)}, '/documentation/$1'
r301 %r{/tutorial\.html}, '/guide'
r301 %r{/download\.html}, '/install'
end
r301 '/tutorial.html', '/guide'
r301 '/download.html', '/install'
r301 '/documentation', '/documentation/'
run Middleman.server
rewrite(%r{^(.*)/([^/.]+)$}, lambda do |match, rack_env|
path = "#{File.dirname(__FILE__)}/build#{match[0]}"
next "#{match[1]}/#{match[2]}/index.html" if Dir.exists?(path)
next match[0] if File.exists?(path)
"#{match[0]}.html"
end)
end
use Rack::Static, :urls => [""], :root => 'build', :index => 'index.html'
run lambda {}
end