Permalink
Browse files

wip: upgrade to rails3 beta3

  • Loading branch information...
1 parent e32f539 commit 87eaeb69d726593de6a47a5f38ff6126fd3920fa Visnu Pitiyanuvath committed Apr 24, 2010
View
@@ -1,6 +1,6 @@
source "http://rubygems.org"
gem "haml"
-gem "rails", "2.3.5"
+gem "rails", "3.0.0.beta3"
gem "thin"
group :development do
View
@@ -7,7 +7,7 @@ dependencies:
rails:
group:
- :default
- version: = 2.3.5
+ version: = 3.0.0.beta3
haml:
group:
- :default
@@ -23,18 +23,52 @@ dependencies:
specs:
- rake:
version: 0.8.7
+- abstract:
+ version: 1.0.0
+- builder:
+ version: 2.1.2
+- i18n:
+ version: 0.3.7
+- memcache-client:
+ version: 1.8.2
+- tzinfo:
+ version: 0.3.20
- activesupport:
- version: 2.3.5
+ version: 3.0.0.beta3
+- activemodel:
+ version: 3.0.0.beta3
+- erubis:
+ version: 2.6.5
- rack:
- version: 1.0.1
+ version: 1.1.0
+- rack-mount:
+ version: 0.6.3
+- rack-test:
+ version: 0.5.3
- actionpack:
- version: 2.3.5
+ version: 3.0.0.beta3
+- mime-types:
+ version: "1.16"
+- polyglot:
+ version: 0.3.1
+- treetop:
+ version: 1.4.5
+- mail:
+ version: 2.2.0
+- text-hyphen:
+ version: 1.0.0
+- text-format:
+ version: 1.0.0
- actionmailer:
- version: 2.3.5
+ version: 3.0.0.beta3
+- arel:
+ version: 0.3.3
- activerecord:
- version: 2.3.5
+ version: 3.0.0.beta3
- activeresource:
- version: 2.3.5
+ version: 3.0.0.beta3
+- bundler:
+ version: 0.9.23
- daemons:
version: 1.0.10
- eventmachine:
@@ -43,13 +77,17 @@ specs:
version: 2.2.23
- pg:
version: 0.9.0
+- thor:
+ version: 0.13.4
+- railties:
+ version: 3.0.0.beta3
- rails:
- version: 2.3.5
+ version: 3.0.0.beta3
- sqlite3-ruby:
version: 1.2.5
- thin:
version: 1.2.7
-hash: 45d9ff4ee105ddc94e0d2017407a87dbe61aa274
+hash: 58fd61d200bde1facf4da80742cdbd639bafa72d
sources:
- Rubygems:
uri: http://rubygems.org
View
@@ -1,4 +1,4 @@
class Person < ActiveRecord::Base
has_many :tasks
- named_scope :active, :conditions => { :active => true }
+ scope :active, :conditions => { :active => true }
end
View
@@ -2,15 +2,15 @@ class Task < ActiveRecord::Base
belongs_to :person
default_scope :order => 'position ASC'
- named_scope :kind, lambda { |kind| { :conditions => { :kind => kind } } }
- named_scope :done, :conditions => { :done => true }
- named_scope :before, lambda { |date|
+ scope :kind, lambda { |kind| { :conditions => { :kind => kind } } }
+ scope :done, :conditions => { :done => true }
+ scope :before, lambda { |date|
{ :conditions => [ 'day < ?', date ] }
}
- named_scope :after, lambda { |date|
+ scope :after, lambda { |date|
{ :conditions => [ 'day > ?', date ] }
}
- named_scope :on, lambda { |date|
+ scope :on, lambda { |date|
{ :conditions => [ 'day = ?', date ],
:order => 'position ASC' }
}
View
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run Scrummer::Application
View
@@ -0,0 +1,47 @@
+require File.expand_path('../boot', __FILE__)
+
+require 'rails/all'
+
+# If you have a Gemfile, require the gems listed there, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(:default, Rails.env) if defined?(Bundler)
+
+module Scrummer
+ class Application < Rails::Application
+ # 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.
+
+ # Add additional load paths for your own custom dirs
+ # config.load_paths += %W( #{config.root}/extras )
+
+ # 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 ]
+
+ # Activate observers that should always be running
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
+
+ # 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. Default is UTC.
+ # config.time_zone = 'Central Time (US & Canada)'
+ config.time_zone = 'Pacific Time (US & Canada)'
+
+ # 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}').to_s]
+ # config.i18n.default_locale = :de
+
+ # Configure generators values. Many other options are available, be sure to check the documentation.
+ config.generators do |g|
+ g.orm :active_record
+ g.template_engine :haml
+ g.test_framework :test_unit, :fixture => true
+ end
+
+ # Configure the default encoding used in templates for Ruby 1.9.
+ config.encoding = "utf-8"
+
+ # Configure sensitive parameters which will be filtered from the log file.
+ config.filter_parameters += [:password]
+ end
+end
View
@@ -1,124 +1,6 @@
-# Don't change this file!
-# Configure your app in config/environment.rb and config/environments/*.rb
-
-RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
-
-module Rails
- class << self
- def boot!
- unless booted?
- preinitialize
- pick_boot.run
- end
- end
-
- def booted?
- defined? Rails::Initializer
- end
-
- def pick_boot
- (vendor_rails? ? VendorBoot : GemBoot).new
- end
-
- def vendor_rails?
- File.exist?("#{RAILS_ROOT}/vendor/rails")
- end
-
- def preinitialize
- load(preinitializer_path) if File.exist?(preinitializer_path)
- end
-
- def preinitializer_path
- "#{RAILS_ROOT}/config/preinitializer.rb"
- end
- end
-
- class Boot
- def run
- load_initializer
- Rails::Initializer.run(:set_load_path)
- end
- end
-
- 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
-
- class GemBoot < Boot
- def load_initializer
- self.class.load_rubygems
- load_rails_gem
- require 'initializer'
- end
-
- def load_rails_gem
- if version = self.class.gem_version
- gem 'rails', version
- else
- gem 'rails'
- end
- rescue Gem::LoadError => load_error
- $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
- exit 1
- end
-
- class << self
- def rubygems_version
- Gem::RubyGemsVersion rescue nil
- end
-
- def gem_version
- if defined? RAILS_GEM_VERSION
- RAILS_GEM_VERSION
- elsif ENV.include?('RAILS_GEM_VERSION')
- ENV['RAILS_GEM_VERSION']
- else
- parse_gem_version(read_environment_rb)
- end
- end
-
- def load_rubygems
- min_version = '1.3.2'
- require 'rubygems'
- unless rubygems_version >= min_version
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
- exit 1
- end
-
- rescue LoadError
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
- exit 1
- end
-
- def parse_gem_version(text)
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
- end
-
- private
- def read_environment_rb
- File.read("#{RAILS_ROOT}/config/environment.rb")
- end
- end
- end
+require 'rubygems'
+# Set up gems listed in the Gemfile.
+if File.exist?(File.expand_path('../../Gemfile', __FILE__))
+ require 'bundler'
+ Bundler.setup
end
-
-class Rails::Boot
- def run
- load_initializer
-
- Rails::Initializer.class_eval do
- def load_gems
- @bundler_loaded ||= Bundler.require :default, Rails.env
- end
- end
-
- Rails::Initializer.run(:set_load_path)
- end
-end
-
-# All that for this:
-Rails.boot!
View
@@ -1,41 +1,5 @@
-# Be sure to restart your server when you modify this file
+# Load the rails application
+require File.expand_path('../application', __FILE__)
-# Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
-
-# Bootstrap the Rails environment, frameworks, and default configuration
-require File.join(File.dirname(__FILE__), 'boot')
-
-Rails::Initializer.run do |config|
- # 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.
-
- # Add additional load paths for your own custom dirs
- # config.load_paths += %W( #{RAILS_ROOT}/extras )
-
- # Specify gems that this application depends on and have them installed with rake gems:install
- # config.gem "bj"
- # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
- # config.gem "sqlite3-ruby", :lib => "sqlite3"
- # config.gem "aws-s3", :lib => "aws/s3"
-
- # 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 ]
-
- # 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, :forum_observer
-
- # 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 = 'Pacific Time (US & Canada)'
-
- # 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
+# Initialize the rails application
+Scrummer::Application.initialize!
@@ -1,17 +1,19 @@
-# Settings specified here will take precedence over those in config/environment.rb
+Scrummer::Application.configure do
+ # Settings specified here will take precedence over those in config/environment.rb
-# In the development environment your application's code is reloaded on
-# every request. This slows down response time but is perfect for development
-# since you don't have to restart the webserver when you make code changes.
-config.cache_classes = false
+ # In the development environment your application's code is reloaded on
+ # every request. This slows down response time but is perfect for development
+ # since you don't have to restart the webserver when you make code changes.
+ config.cache_classes = false
-# Log error messages when you accidentally call methods on nil.
-config.whiny_nils = true
+ # Log error messages when you accidentally call methods on nil.
+ config.whiny_nils = true
-# Show full error reports and disable caching
-config.action_controller.consider_all_requests_local = true
-config.action_view.debug_rjs = true
-config.action_controller.perform_caching = false
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_view.debug_rjs = true
+ config.action_controller.perform_caching = false
-# Don't care if the mailer can't send
-config.action_mailer.raise_delivery_errors = false
+ # Don't care if the mailer can't send
+ config.action_mailer.raise_delivery_errors = false
+end
Oops, something went wrong.

0 comments on commit 87eaeb6

Please sign in to comment.