Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
equivalent rails app
Browse files Browse the repository at this point in the history
  • Loading branch information
barodeur committed May 4, 2012
1 parent b47c6fb commit 42f65e7
Show file tree
Hide file tree
Showing 10 changed files with 363 additions and 313 deletions.
24 changes: 8 additions & 16 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,20 @@ gem 'rails', '3.2.3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do

gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platform => :ruby

gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'
group :production do
gem 'unicorn'
gem 'newrelic_rpm'
end

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
gem 'jquery-rails'
gem 'pry-rails'
gem 'heroku'
32 changes: 32 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ GEM
activesupport (3.2.3)
i18n (~> 0.6)
multi_json (~> 1.0)
addressable (2.2.7)
arel (3.0.2)
builder (3.0.0)
coderay (1.0.5)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
Expand All @@ -40,20 +42,37 @@ GEM
erubis (2.7.0)
execjs (1.3.1)
multi_json (~> 1.0)
heroku (2.22.0)
launchy (>= 0.3.2)
netrc (~> 0.7.1)
rest-client (~> 1.6.1)
rubyzip
hike (1.2.1)
i18n (0.6.0)
journey (1.0.3)
jquery-rails (2.0.2)
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
json (1.7.0)
kgio (2.7.4)
launchy (2.1.0)
addressable (~> 2.2.6)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
method_source (0.7.1)
mime-types (1.18)
multi_json (1.3.4)
netrc (0.7.1)
newrelic_rpm (3.3.2)
polyglot (0.3.3)
pry (0.9.8.4)
coderay (~> 1.0.5)
method_source (~> 0.7.1)
slop (>= 2.4.4, < 3)
pry-rails (0.1.6)
pry
rack (1.4.1)
rack-cache (1.2)
rack (>= 0.4)
Expand All @@ -76,14 +95,19 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
raindrops (0.8.0)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
rest-client (1.6.7)
mime-types (>= 1.16)
rubyzip (0.9.8)
sass (3.1.16)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
slop (2.4.4)
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
Expand All @@ -97,13 +121,21 @@ GEM
uglifier (1.2.4)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
unicorn (4.2.0)
kgio (~> 2.6)
rack
raindrops (~> 0.7)

PLATFORMS
ruby

DEPENDENCIES
coffee-rails (~> 3.2.1)
heroku
jquery-rails
newrelic_rpm
pry-rails
rails (= 3.2.3)
sass-rails (~> 3.2.3)
uglifier (>= 1.0.3)
unicorn
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
15 changes: 15 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
class ApplicationController < ActionController::Base
protect_from_forgery

before_filter :protect_environments!

protected
def protect_environments!
# redirect production version
return redirect_to "http://facebook.com#{request.env['PATH_INFO']}", status: 302 if Rails.env.production?

# protect staging env
if Rails.env.staging?
authenticate_or_request_with_http_basic do |username, password|
username == 'facessook' && password == ENV['PASSWORD']
end
end
end
end
5 changes: 5 additions & 0 deletions app/controllers/cybersquatting_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class CybersquattingController < ApplicationController
def index
render :index
end
end
43 changes: 43 additions & 0 deletions app/views/cybersquatting/index.html.erb

Large diffs are not rendered by default.

Loading

0 comments on commit 42f65e7

Please sign in to comment.