From 40b7c1e9b8bd414ad504e5a131c7537b70488929 Mon Sep 17 00:00:00 2001 From: Paul Chobert Date: Thu, 3 May 2012 23:31:59 +0200 Subject: [PATCH] first draft --- Gemfile | 6 ++++++ Gemfile.lock | 35 +++++++++++++++++++++++++++++++++++ Procfile | 1 + app.rb | 10 ++++++++++ config.ru | 3 +++ config/unicorn.rb | 2 ++ 6 files changed, 57 insertions(+) create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 Procfile create mode 100644 app.rb create mode 100644 config.ru create mode 100644 config/unicorn.rb diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..b67497e --- /dev/null +++ b/Gemfile @@ -0,0 +1,6 @@ +source 'https://rubygems.org' + +gem 'shotgun' +gem 'sinatra' +gem 'unicorn' +gem 'pry' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..7f0c9b3 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,35 @@ +GEM + remote: https://rubygems.org/ + specs: + coderay (1.0.5) + kgio (2.7.4) + method_source (0.7.1) + pry (0.9.8.4) + coderay (~> 1.0.5) + method_source (~> 0.7.1) + slop (>= 2.4.4, < 3) + rack (1.4.1) + rack-protection (1.2.0) + rack + raindrops (0.8.0) + shotgun (0.9) + rack (>= 1.0) + sinatra (1.3.2) + rack (~> 1.3, >= 1.3.6) + rack-protection (~> 1.2) + tilt (~> 1.3, >= 1.3.3) + slop (2.4.4) + tilt (1.3.3) + unicorn (4.2.0) + kgio (~> 2.6) + rack + raindrops (~> 0.7) + +PLATFORMS + ruby + +DEPENDENCIES + pry + shotgun + sinatra + unicorn diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..9c82374 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb diff --git a/app.rb b/app.rb new file mode 100644 index 0000000..49f05e8 --- /dev/null +++ b/app.rb @@ -0,0 +1,10 @@ +require 'bundler/setup' + +require 'sinatra' +require 'pry' + +class App < Sinatra::Base + get '*' do + redirect "http://facebook.com#{request.env['PATH_INFO']}", 301 + end +end diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..bcba2d6 --- /dev/null +++ b/config.ru @@ -0,0 +1,3 @@ +require './app.rb' + +run App diff --git a/config/unicorn.rb b/config/unicorn.rb new file mode 100644 index 0000000..131bd62 --- /dev/null +++ b/config/unicorn.rb @@ -0,0 +1,2 @@ +worker_processes 8 +timeout 30