Permalink
Browse files

[UPGRADING TO RAILS 2.3.2]

- Removed all vendored gems and added proper config.gem entries in the environment file
- Refactored configurations to proper locations such as config/session_store.rb
- Upgraded Rspec, Rspec Rails and Cucumber and fixed tests to make them pass
- CommentsController is missing index.atom.builder - removed until properly implemented
- Upgraded open_id_authentication plugin
- Run rake gems:unpack if you want to vendorize the gems again
  • Loading branch information...
1 parent 53b217c commit 8d24fa1882728e903b2b63f6c2fb64114b5a8b18 @akitaonrails akitaonrails committed Mar 17, 2009
Showing 3,002 changed files with 233 additions and 387,934 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
View
@@ -1 +1,6 @@
+log/**/*
+log
+tmp/**/*
tmp
+config/database.yml
+db/schema.rb
@@ -1,16 +1,17 @@
class CommentsController < ApplicationController
include UrlHelper
+ OPEN_ID_ERRORS = {
+ :missing => "Sorry, the OpenID server couldn't be found",
+ :canceled => "OpenID verification was canceled",
+ :failed => "Sorry, the OpenID verification failed" }
before_filter :find_post, :except => [:new]
def index
if request.post? || using_open_id?
create
else
- respond_to do |format|
- format.html { redirect_to(post_path(@post)) }
- format.atom { @comments = @post.approved_comments }
- end
+ redirect_to(post_path(@post))
end
end
@@ -30,36 +31,27 @@ def create
session[:pending_comment] = nil
- if @comment.requires_openid_authentication?
+ unless @comment.requires_openid_authentication?
+ @comment.blank_openid_fields
+ else
session[:pending_comment] = params[:comment]
- return if authenticate_with_open_id(@comment.author,
- :optional => [:nickname, :fullname, :email]
- ) do |result, identity_url, registration|
-
- case result.status
- when :missing
- @comment.openid_error = "Sorry, the OpenID server couldn't be found"
- when :canceled
- @comment.openid_error = "OpenID verification was canceled"
- when :failed
- @comment.openid_error = "Sorry, the OpenID verification failed"
- when :successful
+ return if authenticate_with_open_id(@comment.author, :optional => [:nickname, :fullname, :email]) do |result, identity_url, registration|
+ if result.status == :successful
@comment.post = @post
- @comment.author_url = @comment.author
- @comment.author = (registration["fullname"] || registration["nickname"] || @comment.author_url).to_s
- @comment.author_email = registration["email"].to_s
+ @comment.author_url = @comment.author
+ @comment.author = (registration["fullname"] || registration["nickname"] || @comment.author_url).to_s
+ @comment.author_email = (registration["email"] || @comment.author_url).to_s
@comment.openid_error = ""
+ session[:pending_comment] = nil
+ else
+ @comment.openid_error = OPEN_ID_ERRORS[ result.status ]
end
-
- session[:pending_comment] = nil
end
- else
- @comment.blank_openid_fields
end
- if @comment.save
+ if session[:pending_comment].nil? && @comment.save
redirect_to post_path(@post)
else
render :template => 'posts/show'
@@ -15,7 +15,7 @@ def formatted_posts_path(options = {})
options[:tag] = options[:tag].downcase
formatted_posts_with_tag_path(options)
else
- super
+ posts_path(options)
end
end
View
@@ -44,6 +44,7 @@ class VendorBoot < Boot
def load_initializer
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
Rails::Initializer.run(:install_gem_spec_stubs)
+ Rails::GemDependency.add_frozen_gem_path
end
end
View
@@ -6,8 +6,8 @@ author:
name: Don Alias # For copyright notice and ATOM feeds
email: don@enkiblog.com # Exception emails will go here, and it is used in ATOM feeds
open_id: # These are used to login to the admin area
- - http://enkiblog.com
- - http://secondaryopenid.com
+ - http://enkiblog.com
+ - http://secondaryopenid.com
# Delete the following section if your site will not be acting as an OpenID delegate (http://wiki.openid.net/Delegation)
# If you're deploying with mongrel, make sure you read http://rhnh.net/2008/04/13/nginx-openid-delegation-and-yadis
View
@@ -1,11 +1,7 @@
# Be sure to restart your server when you modify this file
-# Uncomment below to force Rails into production mode when
-# you don't control web/app server and can't set it the proper way
-# ENV['RAILS_ENV'] ||= 'production'
-
# Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION
+RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
@@ -14,63 +10,34 @@
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
- # See Rails::Configuration for more options.
-
- # Skip frameworks you're not going to use (only works if using vendor/rails).
- # To use Rails without a database, you must remove the Active Record framework
- # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
-
- # Only load the plugins named here, in the order given. By default, all plugins
- # in vendor/plugins are loaded in alphabetical order.
- # :all can be used as a placeholder for all plugins not explicitly named
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Add additional load paths for your own custom dirs
# config.load_paths += %W( #{RAILS_ROOT}/extras )
- # Force all environments to use the same logger level
- # (by default production uses :info, the others :debug)
- # config.log_level = :debug
-
- # Your secret key for verifying cookie session data integrity.
- # If you change this key, all old sessions will become invalid!
- # Make sure the secret is at least 30 characters and all random,
- # no regular words or you'll be exposed to dictionary attacks.
- config.action_controller.session_store = :memory_store
- config.action_controller.session = {
- :session_key => '_enki_session',
- :secret => 'd9b13a4ed2cfce88d62a6765b99530fd5a984ac827aa9068bf893aff51233f486c5f57f83d537945fb89caf2cd8bd3f42a5c3bfc5adce818afe28fca0452b52b'
- }
+ # Specify gems that this application depends on and have them installed with rake gems:install
+ config.gem "RedCloth", :lib => "redcloth", :version => "~> 4.1.0"
+ config.gem "ruby-openid", :lib => "openid", :version => "~> 2.1.0"
+ config.gem "chronic", :version => "~> 0.2.0"
+ config.gem "coderay", :version => "~> 0.8.0"
+ config.gem "lesstile", :version => "~> 0.3"
+ config.gem "mislav-will_paginate", :lib => "will_paginate", :version => "~> 2.3"
- # Use the database for sessions instead of the cookie-based default,
- # which shouldn't be used to store highly confidential information
- # (create the session table with 'rake db:sessions:create')
- config.action_controller.session_store = :active_record_store
+ # Only load the plugins named here, in the order given (default is alphabetical).
+ # :all can be used as a placeholder for all plugins not explicitly named
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
- # Use SQL instead of Active Record's schema dumper when creating the test database.
- # This is necessary if your schema can't be completely dumped by the schema dumper,
- # like if you have constraints or database-specific column types
- # config.active_record.schema_format = :sql
+ # Skip frameworks you're not going to use. To use Rails without a database,
+ # you must remove the Active Record framework.
+ # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
# Activate observers that should always be running
- # config.active_record.observers = :cacher, :garbage_collector
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
- # Make Active Record use UTC-base instead of local time
- # config.active_record.default_timezone = :utc
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names.
+ config.time_zone = 'UTC'
- Dir.glob(File.join(RAILS_ROOT,'vendor','*','lib')).each do |dir|
- config.load_paths += [dir]
- end
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
+ # config.i18n.default_locale = :de
end
-
-require 'lesstile'
-require 'coderay'
-
-require 'core_extensions/string'
-require 'core_extensions/object'
-
-require 'openid'
-require 'openid/store/filesystem'
-require 'openid/extensions/sreg'
-
-require 'chronic'
@@ -20,3 +20,10 @@
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
+
+# defining test gems
+config.gem "cucumber"
+config.gem "aslakhellesoy-webrat", :lib => "webrat", :version => "~> 0.3", :source => "http://gems.github.com"
+config.gem "thoughtbot-factory_girl", :lib => "factory_girl", :version => "~> 1.2.0", :source => "http://gems.github.com"
+config.gem "rspec", :lib => false, :version => ">= 1.2.0"
+config.gem "rspec-rails", :lib => false, :version => ">= 1.2.0"
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
+# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+
+# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,2 @@
+require 'core_extensions/string'
+require 'core_extensions/object'
@@ -1,3 +1,5 @@
+# Be sure to restart your server when you modify this file.
+
# These settings change the behavior of Rails 2 apps and will be defaults
# for Rails 3. You can remove this initializer when Rails 3 is released.
@@ -0,0 +1,15 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key for verifying cookie session data integrity.
+# If you change this key, all old sessions will become invalid!
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+ActionController::Base.session = {
+ :key => '_enki_session',
+ :secret => 'd9b13a4ed2cfce88d62a6765b99530fd5a984ac827aa9068bf893aff51233f486c5f57f83d537945fb89caf2cd8bd3f42a5c3bfc5adce818afe28fca0452b52b'
+}
+
+# Use the database for sessions instead of the cookie-based default,
+# which shouldn't be used to store highly confidential information
+# (create the session table with "rake db:sessions:create")
+ActionController::Base.session_store = :active_record_store
View
@@ -1,105 +0,0 @@
-# This file is auto-generated from the current state of the database. Instead of editing this file,
-# please use the migrations feature of Active Record to incrementally modify your database, and
-# then regenerate this schema definition.
-#
-# Note that this schema.rb definition is the authoritative source for your database schema. If you need
-# to create the application database on another system, you should be using db:schema:load, not running
-# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
-# you'll amass, the slower it'll run and the greater likelihood for issues).
-#
-# It's strongly recommended to check this file into your version control system.
-
-ActiveRecord::Schema.define(:version => 9) do
-
- create_table "comments", :force => true do |t|
- t.integer "post_id", :null => false
- t.string "author", :null => false
- t.string "author_url", :null => false
- t.string "author_email", :null => false
- t.text "body", :null => false
- t.text "body_html", :null => false
- t.datetime "created_at"
- t.datetime "updated_at"
- end
-
- add_index "comments", ["created_at"], :name => "index_comments_on_created_at"
- add_index "comments", ["post_id"], :name => "index_comments_on_post_id"
-
- create_table "open_id_authentication_associations", :force => true do |t|
- t.integer "issued"
- t.integer "lifetime"
- t.string "handle"
- t.string "assoc_type"
- t.binary "server_url"
- t.binary "secret"
- end
-
- create_table "open_id_authentication_nonces", :force => true do |t|
- t.integer "timestamp", :null => false
- t.string "server_url"
- t.string "salt", :null => false
- end
-
- create_table "pages", :force => true do |t|
- t.string "title", :null => false
- t.string "slug", :null => false
- t.text "body", :null => false
- t.text "body_html", :null => false
- t.datetime "created_at"
- t.datetime "updated_at"
- end
-
- add_index "pages", ["created_at"], :name => "index_pages_on_created_at"
- add_index "pages", ["title"], :name => "index_pages_on_title"
-
- create_table "posts", :force => true do |t|
- t.string "title", :null => false
- t.string "slug", :null => false
- t.text "body", :null => false
- t.text "body_html", :null => false
- t.boolean "active", :default => true, :null => false
- t.integer "approved_comments_count", :default => 0, :null => false
- t.string "cached_tag_list"
- t.datetime "published_at"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.datetime "edited_at", :null => false
- end
-
- add_index "posts", ["published_at"], :name => "index_posts_on_published_at"
-
- create_table "sessions", :force => true do |t|
- t.string "session_id", :null => false
- t.text "data"
- t.datetime "created_at"
- t.datetime "updated_at"
- end
-
- add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
- add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
-
- create_table "taggings", :force => true do |t|
- t.integer "tag_id"
- t.integer "taggable_id"
- t.datetime "created_at"
- end
-
- add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
- add_index "taggings", ["taggable_id"], :name => "index_taggings_on_taggable_id_and_taggable_type"
-
- create_table "tags", :force => true do |t|
- t.string "name"
- t.integer "taggings_count", :default => 0, :null => false
- end
-
- add_index "tags", ["name"], :name => "index_tags_on_name"
-
- create_table "undo_items", :force => true do |t|
- t.string "type", :null => false
- t.datetime "created_at", :null => false
- t.text "data"
- end
-
- add_index "undo_items", ["created_at"], :name => "index_undo_items_on_created_at"
-
-end
Oops, something went wrong.

0 comments on commit 8d24fa1

Please sign in to comment.