Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Rack it up
  • Loading branch information
qrush committed Nov 10, 2009
1 parent e12523b commit 5c469bb
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 21 deletions.
20 changes: 20 additions & 0 deletions config.ru
@@ -0,0 +1,20 @@
if ENV['MAINTENANCE_MODE']
require 'sinatra'
require 'app/metal/hostess'
require 'rack/maintenance'
require 'aws/s3'
require 'lib/vault_object'

get '/' do
send_file("public/maintenance/index.html")
end

use Rack::Static, :urls => ["/index.html", "/favicon.ico", "/images", "/stylesheets"], :root => "public/maintenance"
use Hostess
run Sinatra::Application
else
require 'thin'
require 'rack/adapter/rails'
run Rack::Adapter::Rails.new(:environment => ENV['RAILS_ENV'])
end

9 changes: 1 addition & 8 deletions config/environments/production.rb
Expand Up @@ -31,14 +31,7 @@

config.after_initialize do
require 'aws/s3'
AWS::S3::Base.establish_connection!(
:access_key_id => ENV['S3_KEY'],
:secret_access_key => ENV['S3_SECRET']
)

class ::VaultObject < AWS::S3::S3Object
set_current_bucket_to "gemcutter_production"
end
require 'lib/vault_object'
end

if ENV['MEMCACHE_SERVERS']
Expand Down
9 changes: 1 addition & 8 deletions config/environments/staging.rb
Expand Up @@ -31,12 +31,5 @@

config.after_initialize do
require 'aws/s3'
AWS::S3::Base.establish_connection!(
:access_key_id => ENV['S3_KEY'],
:secret_access_key => ENV['S3_SECRET']
)

class ::VaultObject < AWS::S3::S3Object
set_current_bucket_to "gemcutter_staging"
end
require 'lib/vault_object'
end
5 changes: 0 additions & 5 deletions db/schema.rb
Expand Up @@ -78,11 +78,6 @@
add_index "requirements", ["dependency_id"], :name => "index_requirements_on_dependency_id"
add_index "requirements", ["version_id"], :name => "index_requirements_on_version_id"

create_table "rubyforgers", :force => true do |t|
t.string "email"
t.string "encrypted_password", :limit => 40
end

create_table "rubygems", :force => true do |t|
t.string "name"
t.datetime "created_at"
Expand Down
8 changes: 8 additions & 0 deletions lib/vault_object.rb
@@ -0,0 +1,8 @@
AWS::S3::Base.establish_connection!(
:access_key_id => ENV['S3_KEY'],
:secret_access_key => ENV['S3_SECRET']
)

class ::VaultObject < AWS::S3::S3Object
set_current_bucket_to "gemcutter_#{(ENV['RACK_ENV'] || RAILS_ENV).downcase}"
end

0 comments on commit 5c469bb

Please sign in to comment.