diff --git a/Gemfile b/Gemfile index eafdd9d..5ddff03 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/Gemfile.lock b/Gemfile.lock index ad855f4..2141cbc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) @@ -40,6 +42,11 @@ 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) @@ -47,13 +54,25 @@ GEM 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) @@ -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) @@ -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 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/controllers/application_controller.rb b/app/controllers/application_controller.rb index e8065d9..83b5cec 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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 diff --git a/app/controllers/cybersquatting_controller.rb b/app/controllers/cybersquatting_controller.rb new file mode 100644 index 0000000..025968b --- /dev/null +++ b/app/controllers/cybersquatting_controller.rb @@ -0,0 +1,5 @@ +class CybersquattingController < ApplicationController + def index + render :index + end +end diff --git a/app/views/cybersquatting/index.html.erb b/app/views/cybersquatting/index.html.erb new file mode 100644 index 0000000..3d8ffc7 --- /dev/null +++ b/app/views/cybersquatting/index.html.erb @@ -0,0 +1,43 @@ + + +
+rails generate
to create your models and controllersTo see all available options, run it without parameters.
-Routes are set up in config/routes.rb.
-Run rake db:create
to create your database. If you're not using SQLite (the default), edit config/database.yml with your username and password.