From 25ac560c2cbcff0b69f68ae874aac2ea4cbc2e49 Mon Sep 17 00:00:00 2001 From: Brian Jakovich Date: Sat, 14 Apr 2012 20:41:28 -0400 Subject: [PATCH 01/10] removed spork --- Gemfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Gemfile b/Gemfile index bf7cd228..ef17b114 100644 --- a/Gemfile +++ b/Gemfile @@ -14,10 +14,5 @@ end group :test do gem 'rspec-rails', '2.6.1' gem 'webrat', '0.7.1' - gem 'spork', '0.9.0.rc8' gem 'factory_girl_rails', '1.0' - # gem 'autotest', '4.4.6' - # gem 'autotest-rails-pure', '4.1.2' - # gem 'autotest-fsevent', '0.2.4' - # gem 'autotest-growl', '0.2.9' end From 37c55a187ab388f1694316cbfad5747de8e93832 Mon Sep 17 00:00:00 2001 From: Brian Jakovich Date: Sun, 15 Apr 2012 08:59:49 -0400 Subject: [PATCH 02/10] removed spork preforks --- spec/spec_helper.rb | 57 ++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ba697548..08429186 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,39 +1,32 @@ -require 'spork' +# Loading more in this block will cause your tests to run faster. However, +# if you change any configuration or code from libraries loaded here, you'll +# need to restart spork for it take effect. +ENV["RAILS_ENV"] ||= 'test' +require File.expand_path("../../config/environment", __FILE__) +require 'rspec/rails' -Spork.prefork do - # Loading more in this block will cause your tests to run faster. However, - # if you change any configuration or code from libraries loaded here, you'll - # need to restart spork for it take effect. - ENV["RAILS_ENV"] ||= 'test' - require File.expand_path("../../config/environment", __FILE__) - require 'rspec/rails' +# Requires supporting files with custom matchers and macros, etc, +# in ./support/ and its subdirectories. +Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} - # Requires supporting files with custom matchers and macros, etc, - # in ./support/ and its subdirectories. - Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} - - RSpec.configure do |config| - # == Mock Framework - # - # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: - # - # config.mock_with :mocha - # config.mock_with :flexmock - # config.mock_with :rr - config.mock_with :rspec +RSpec.configure do |config| + # == Mock Framework + # + # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: + # + # config.mock_with :mocha + # config.mock_with :flexmock + # config.mock_with :rr + config.mock_with :rspec - config.fixture_path = "#{::Rails.root}/spec/fixtures" + config.fixture_path = "#{::Rails.root}/spec/fixtures" - # If you're not using ActiveRecord, or you'd prefer not to run each of your - # examples within a transaction, comment the following line or assign false - # instead of true. - config.use_transactional_fixtures = true + # If you're not using ActiveRecord, or you'd prefer not to run each of your + # examples within a transaction, comment the following line or assign false + # instead of true. + config.use_transactional_fixtures = true - def test_sign_in(user) - controller.sign_in(user) - end + def test_sign_in(user) + controller.sign_in(user) end end - -Spork.each_run do -end From d1e2cc819d8f073159afd4bbeb1025f8483d185f Mon Sep 17 00:00:00 2001 From: Brian Jakovich Date: Mon, 16 Apr 2012 15:41:43 -0400 Subject: [PATCH 03/10] updated database.yml and added cap deploy --- Capfile | 5 +++++ Gemfile | 2 +- Gemfile.lock | 19 +++++++++++++++---- config/database.yml | 28 +++++++--------------------- config/deploy.rb | 42 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 70 insertions(+), 26 deletions(-) create mode 100644 Capfile create mode 100644 config/deploy.rb diff --git a/Capfile b/Capfile new file mode 100644 index 00000000..98743d10 --- /dev/null +++ b/Capfile @@ -0,0 +1,5 @@ +load 'deploy' +# Uncomment if you are using Rails' asset pipeline + # load 'deploy/assets' +Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } +load 'config/deploy' # remove this line to skip loading any of the default tasks \ No newline at end of file diff --git a/Gemfile b/Gemfile index ef17b114..a6cf46a0 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source 'http://rubygems.org' gem 'rails', '3.0.12' gem 'gravatar_image_tag', '1.0.0.pre2' gem 'will_paginate', '3.0.pre2' -gem 'sqlite3', '1.3.4' +gem 'capistrano' group :development do gem 'rspec-rails', '2.6.1' diff --git a/Gemfile.lock b/Gemfile.lock index f9d65656..c56bea5b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -31,6 +31,12 @@ GEM annotate (2.4.0) arel (2.0.10) builder (2.1.2) + capistrano (2.12.0) + highline + net-scp (>= 1.0.0) + net-sftp (>= 2.0.0) + net-ssh (>= 2.0.14) + net-ssh-gateway (>= 1.1.0) diff-lcs (1.1.2) erubis (2.6.6) abstract (>= 1.0.0) @@ -40,6 +46,7 @@ GEM rails (>= 3.0.0.beta4) faker (0.3.1) gravatar_image_tag (1.0.0.pre2) + highline (1.6.11) i18n (0.5.0) json (1.6.6) mail (2.2.19) @@ -48,6 +55,13 @@ GEM mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.18) + net-scp (1.0.4) + net-ssh (>= 1.99.1) + net-sftp (2.0.5) + net-ssh (>= 2.0.9) + net-ssh (2.3.0) + net-ssh-gateway (1.1.0) + net-ssh (>= 1.99.1) nokogiri (1.4.4) polyglot (0.3.3) rack (1.2.5) @@ -85,8 +99,6 @@ GEM activesupport (~> 3.0) railties (~> 3.0) rspec (~> 2.6.0) - spork (0.9.0.rc8) - sqlite3 (1.3.4) thor (0.14.6) treetop (1.4.10) polyglot @@ -103,12 +115,11 @@ PLATFORMS DEPENDENCIES annotate (= 2.4.0) + capistrano factory_girl_rails (= 1.0) faker (= 0.3.1) gravatar_image_tag (= 1.0.0.pre2) rails (= 3.0.12) rspec-rails (= 2.6.1) - spork (= 0.9.0.rc8) - sqlite3 (= 1.3.4) webrat (= 0.7.1) will_paginate (= 3.0.pre2) diff --git a/config/database.yml b/config/database.yml index 025d62a8..35168362 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,22 +1,8 @@ -# SQLite version 3.x -# gem install sqlite3-ruby (not necessary on OS X Leopard) -development: - adapter: sqlite3 - database: db/development.sqlite3 - pool: 5 - timeout: 5000 - -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. -test: - adapter: sqlite3 - database: db/test.sqlite3 - pool: 5 - timeout: 5000 - production: - adapter: sqlite3 - database: db/production.sqlite3 - pool: 5 - timeout: 5000 + adapter: mysql + encoding: utf8 + database: demo_production + username: demouser + password: demopswd + hostname: 127.0.0.1 + port: 3306 \ No newline at end of file diff --git a/config/deploy.rb b/config/deploy.rb new file mode 100644 index 00000000..0a3226fe --- /dev/null +++ b/config/deploy.rb @@ -0,0 +1,42 @@ +set :application, "rails" +set :domain, "target.devopscloud.com" +set :user, "ec2-user" +set :use_sudo, false +set :deploy_to, "/www/var/#{application}" + +role :app, domain +role :web, domain +role :db, domain, :primary => true + +set :scm, :git +set :repository, 'git@github.com:stelligent/sample_app.git' +set :branch, 'master' +set :deploy_via, :remote_cache + + +after "deploy", "deploy:bundle_install" +after "deploy:bundle_install", "deploy:db_migrate" +after "deploy:db_migrate", "deploy:restart" + +namespace :deploy do + task :bundle_install do + run "cd #{deploy_to} && RAILS_ENV=production bundle install" + end + + task :db_migrate do + run "cd #{deploy_to} && rake db:migrate" + end + + task :start, :roles => :app do + run "touch #{current_release}/tmp/restart.txt" + end + + task :stop, :roles => :app do + # Do nothing. + end + + desc "Restart Application" + task :restart, :roles => :app do + run "touch #{current_release}/tmp/restart.txt" + end +end \ No newline at end of file From d7f317752916a19cf7313e90531db173048a2bd9 Mon Sep 17 00:00:00 2001 From: Brian Jakovich Date: Mon, 16 Apr 2012 15:48:34 -0400 Subject: [PATCH 04/10] added sqlite, added development database --- Gemfile | 1 + config/database.yml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/Gemfile b/Gemfile index a6cf46a0..0268a8be 100644 --- a/Gemfile +++ b/Gemfile @@ -4,6 +4,7 @@ gem 'rails', '3.0.12' gem 'gravatar_image_tag', '1.0.0.pre2' gem 'will_paginate', '3.0.pre2' gem 'capistrano' +gem 'sqlite3', '1.3.4' group :development do gem 'rspec-rails', '2.6.1' diff --git a/config/database.yml b/config/database.yml index 35168362..b3aa3e5c 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,3 +1,9 @@ +development: + adapter: sqlite3 + database: db/development.sqlite3 + pool: 5 + timeout: 5000 + production: adapter: mysql encoding: utf8 From 869645c0c6ee2483523c4f0cf270f108c64288c2 Mon Sep 17 00:00:00 2001 From: Brian Jakovich Date: Mon, 16 Apr 2012 15:50:26 -0400 Subject: [PATCH 05/10] added sqlite, added development database --- config/database.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/config/database.yml b/config/database.yml index b3aa3e5c..85dac9c5 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,14 +1,22 @@ +# SQLite version 3.x +# gem install sqlite3-ruby (not necessary on OS X Leopard) development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000 +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + adapter: sqlite3 + database: db/test.sqlite3 + pool: 5 + timeout: 5000 + production: - adapter: mysql - encoding: utf8 - database: demo_production - username: demouser - password: demopswd - hostname: 127.0.0.1 - port: 3306 \ No newline at end of file + adapter: sqlite3 + database: db/production.sqlite3 + pool: 5 + timeout: 5000 \ No newline at end of file From 21622872e6812c887b8e1ebb91598d52ecac93e8 Mon Sep 17 00:00:00 2001 From: Paul Duvall Date: Sun, 22 Apr 2012 16:10:07 -0400 Subject: [PATCH 06/10] Modified the home page content --- app/views/pages/home.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/pages/home.html.erb b/app/views/pages/home.html.erb index 4ae2fba7..14600955 100644 --- a/app/views/pages/home.html.erb +++ b/app/views/pages/home.html.erb @@ -18,7 +18,7 @@

Sample App

- This is the home page for the Ruby on Rails Tutorial sample application. + This is the home page for the Ruby on Rails Tutorial sample application. Paul Duvall

<%= link_to "Sign up now!", signup_path, :class => "signup_button round" %> From 013b6487efe498c0ebcfd21bcc72ec3dc4225a65 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Mon, 1 Apr 2013 11:35:41 +0000 Subject: [PATCH 07/10] First commit --- app/views/pages/home.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/pages/home.html.erb b/app/views/pages/home.html.erb index 14600955..9ded7323 100644 --- a/app/views/pages/home.html.erb +++ b/app/views/pages/home.html.erb @@ -3,7 +3,7 @@ @@ -23,4 +23,4 @@ <%= link_to "Sign up now!", signup_path, :class => "signup_button round" %> -<% end %> \ No newline at end of file +<% end %> From af974b3d4ab0e45aad19c42c5447792fb5b60dc0 Mon Sep 17 00:00:00 2001 From: Wee Keat Date: Mon, 1 Apr 2013 11:44:41 +0000 Subject: [PATCH 08/10] update test spec file --- spec/controllers/users_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 907420ee..9f377ea5 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -12,7 +12,7 @@ end end - describe "for signed-in-users" do + describe "for all signed-in-users" do before(:each) do @user = test_sign_in(Factory(:user)) From 1ad7681d04b5c79c1c4a7878fcd2f39650d9ac08 Mon Sep 17 00:00:00 2001 From: Wee Keat Date: Mon, 1 Apr 2013 11:50:59 +0000 Subject: [PATCH 09/10] Script update --- db/migrate/20100821203213_create_users.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/db/migrate/20100821203213_create_users.rb b/db/migrate/20100821203213_create_users.rb index 805ba7b3..af5f964b 100644 --- a/db/migrate/20100821203213_create_users.rb +++ b/db/migrate/20100821203213_create_users.rb @@ -3,6 +3,7 @@ def self.up create_table :users do |t| t.string :name t.string :email + t.string :mobile t.timestamps end From bc9397e78d6caffb3bb1e31ddb8b7edaa76f66cf Mon Sep 17 00:00:00 2001 From: Wee Keat Date: Mon, 1 Apr 2013 11:58:59 +0000 Subject: [PATCH 10/10] rake change --- lib/tasks/sample_data.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/sample_data.rake b/lib/tasks/sample_data.rake index 5d4aed0f..8f5f0147 100644 --- a/lib/tasks/sample_data.rake +++ b/lib/tasks/sample_data.rake @@ -1,5 +1,5 @@ namespace :db do - desc "Fill database with sample data" + desc "Fill the database with sample data" task :populate => :environment do Rake::Task['db:reset'].invoke make_users @@ -40,4 +40,4 @@ def make_relationships followers = users[3..40] following.each { |followed| user.follow!(followed) } followers.each { |follower| follower.follow!(user) } -end \ No newline at end of file +end
-

What's up?

+

What's up, doc?

<%= render 'shared/micropost_form' %> <%= render 'shared/feed' %>