Skip to content
Browse files

Update boot, routes, and config to rails 3

  • Loading branch information...
1 parent 152610b commit 9abfb352cf0c592fec2d7dc54eb05eac721555c3 @jamesu jamesu committed Sep 7, 2010
View
19 Gemfile
@@ -0,0 +1,19 @@
+source :rubygems
+
+group :rails do
+ gem 'rails', '~> 3.0.0', :require => nil
+ gem 'sqlite3-ruby', :require => 'sqlite3'
+end
+
+gem 'gravtastic'
+gem 'mojombo-chronic'
+gem 'RedCloth'
+gem 'ferret'
+gem 'haml'
+gem 'ruby-openid'
+
+group :development do
+end
+
+group :testing do
+end
View
7 Rakefile
@@ -1,10 +1,7 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
-require(File.join(File.dirname(__FILE__), 'config', 'boot'))
-
+require File.expand_path('../config/application', __FILE__)
require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-require 'tasks/rails'
+Rucksack::Application.load_tasks
View
4 config.ru
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run Rucksack::Application
View
50 config/application.rb
@@ -0,0 +1,50 @@
+#==
+# Copyright (C) 2010 James S Urquhart
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following
+# conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+#++
+
+require File.expand_path('../boot', __FILE__)
+
+require 'rails/all'
+
+Bundler.require(:default, Rails.env) if defined?(Bundler)
+
+require 'ostruct'
+::AppConfig = OpenStruct.new()
+
+# SSL SMTP
+begin
+require 'smtp-tls'
+rescue Exception
+end
+
+module Rucksack
+ class Application < Rails::Application
+ config.time_zone = 'UTC'
+ config.i18n.default_locale = :en
+ config.encoding = "utf-8"
+ end
+end
+
+require 'rucksack_extras'
+require 'authenticated_system'
View
122 config/boot.rb
@@ -1,109 +1,13 @@
-# 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)
- 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 if defined? Gem::RubyGemsVersion
- 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
- require 'rubygems'
-
- unless rubygems_version >= '0.9.4'
- $stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
- exit 1
- end
-
- rescue LoadError
- $stderr.puts %(Rails requires RubyGems >= 0.9.4. 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
-end
-
-# All that for this:
-Rails.boot!
+require 'rubygems'
+
+# Set up gems listed in the Gemfile.
+gemfile = File.expand_path('../../Gemfile', __FILE__)
+begin
+ ENV['BUNDLE_GEMFILE'] = gemfile
+ require 'bundler'
+ Bundler.setup
+rescue Bundler::GemNotFound => e
+ STDERR.puts e.message
+ STDERR.puts "Try running `bundle install`."
+ exit!
+end if File.exist?(gemfile)
View
83 config/environment.rb
@@ -1,78 +1,9 @@
-# Be sure to restart your server when you modify this file
+# Load the rails application
+require File.expand_path('../application', __FILE__)
-#==
-# Copyright (C) 2008-2010 James S Urquhart
-#
-# Portions Copyright (C) 2008 2008 Matt Polito
-#
-# Permission is hereby granted, free of charge, to any person
-# obtaining a copy of this software and associated documentation
-# files (the "Software"), to deal in the Software without
-# restriction, including without limitation the rights to use,
-# copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following
-# conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-# OTHER DEALINGS IN THE SOFTWARE.
-#++
+# load app_config.yml
+require 'yaml'
+APP_CONFIG = YAML.load_file(RAILS_ROOT + "/config/app_config.yml")
-
-# 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.3.5' unless defined? RAILS_GEM_VERSION
-
-# Bootstrap the Rails environment, frameworks, and default configuration
-require File.join(File.dirname(__FILE__), 'boot')
-
-require 'ostruct'
-::AppConfig = OpenStruct.new()
-
-# SSL SMTP
-begin
-require 'smtp-tls'
-rescue Exception
-end
-
-Rails::Initializer.run do |config|
-
- # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
-
- config.gem 'gravtastic'
- config.gem 'mojombo-chronic', :lib => 'chronic', :source => 'http://gems.github.com'
- config.gem "RedCloth", :lib => "redcloth", :source => "http://code.whytheluckystiff.net"
- config.gem 'ferret'
-
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
-
- # config.load_paths += %W( #{RAILS_ROOT}/extras )
-
- # config.log_level = :debug
-
- config.time_zone = 'UTC'
- config.i18n.default_locale = :en
-
- config.action_controller.session = {
- :session_key => APP_CONFIG['session'],
- :secret => APP_CONFIG['secret']
- }
-
- # Activate observers that should always be running
- # config.active_record.observers = :cacher, :garbage_collector
- #config.active_record.observers = :user_observer
-end
-
-require_dependency 'rucksack_extras'
+# Initialize the rails application
+Rucksack::Application.initialize!
View
35 config/environments/development.rb
@@ -1,17 +1,26 @@
-# Settings specified here will take precedence over those in config/environment.rb
+Rucksack::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
+
+ # Print deprecation notices to the Rails logger
+ config.active_support.deprecation = :log
+
+ # Only use best-standards-support built into browsers
+ config.action_dispatch.best_standards_support = :builtin
+end
-# Don't care if the mailer can't send
-config.action_mailer.raise_delivery_errors = false
View
58 config/environments/production.rb
@@ -1,21 +1,49 @@
-# Settings specified here will take precedence over those in config/environment.rb
+Rucksack::Application.configure do
+ # Settings specified here will take precedence over those in config/environment.rb
-# The production environment is meant for finished, "live" apps.
-# Code is not reloaded between requests
-config.cache_classes = true
+ # The production environment is meant for finished, "live" apps.
+ # Code is not reloaded between requests
+ config.cache_classes = true
-# Use a different logger for distributed setups
-# config.logger = SyslogLogger.new
+ # Full error reports are disabled and caching is turned on
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
-# Full error reports are disabled and caching is turned on
-config.action_controller.consider_all_requests_local = false
-config.action_controller.perform_caching = true
+ # Specifies the header that your server uses for sending files
+ config.action_dispatch.x_sendfile_header = "X-Sendfile"
-# Use a different cache store in production
-# config.cache_store = :mem_cache_store
+ # For nginx:
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
-# Enable serving of images, stylesheets, and javascripts from an asset server
-# config.action_controller.asset_host = "http://assets.example.com"
+ # If you have no front-end server that supports something like X-Sendfile,
+ # just comment this out and Rails will serve the files
-# Disable delivery errors, bad email addresses will be ignored
-# config.action_mailer.raise_delivery_errors = false
+ # See everything in the log (default is :info)
+ # config.log_level = :debug
+
+ # Use a different logger for distributed setups
+ # config.logger = SyslogLogger.new
+
+ # Use a different cache store in production
+ # config.cache_store = :mem_cache_store
+
+ # Disable Rails's static asset server
+ # In production, Apache or nginx will already do this
+ config.serve_static_assets = false
+
+ # Enable serving of images, stylesheets, and javascripts from an asset server
+ # config.action_controller.asset_host = "http://assets.example.com"
+
+ # Disable delivery errors, bad email addresses will be ignored
+ # config.action_mailer.raise_delivery_errors = false
+
+ # Enable threaded mode
+ # config.threadsafe!
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation can not be found)
+ config.i18n.fallbacks = true
+
+ # Send deprecation notices to registered listeners
+ config.active_support.deprecation = :notify
+end
View
47 config/environments/test.rb
@@ -1,22 +1,35 @@
-# Settings specified here will take precedence over those in config/environment.rb
+Rucksack::Application.configure do
+ # Settings specified here will take precedence over those in config/environment.rb
-# The test environment is used exclusively to run your application's
-# test suite. You never need to work with it otherwise. Remember that
-# your test database is "scratch space" for the test suite and is wiped
-# and recreated between test runs. Don't rely on the data there!
-config.cache_classes = true
+ # The test environment is used exclusively to run your application's
+ # test suite. You never need to work with it otherwise. Remember that
+ # your test database is "scratch space" for the test suite and is wiped
+ # and recreated between test runs. Don't rely on the data there!
+ config.cache_classes = true
-# 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_controller.perform_caching = false
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
-# Disable request forgery protection in test environment
-config.action_controller.allow_forgery_protection = false
+ # Raise exceptions instead of rendering exception templates
+ config.action_dispatch.show_exceptions = false
-# Tell Action Mailer not to deliver emails to the real world.
-# The :test delivery method accumulates sent emails in the
-# ActionMailer::Base.deliveries array.
-config.action_mailer.delivery_method = :test
+ # Disable request forgery protection in test environment
+ config.action_controller.allow_forgery_protection = false
+
+ # Tell Action Mailer not to deliver emails to the real world.
+ # The :test delivery method accumulates sent emails in the
+ # ActionMailer::Base.deliveries array.
+ config.action_mailer.delivery_method = :test
+
+ # 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
+
+ # Print deprecation notices to the stderr
+ config.active_support.deprecation = :stderr
+end
View
15 config/initializers/new_rails_defaults.rb
@@ -1,15 +0,0 @@
-# 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.
-
-# Include Active Record class name as root for JSON serialized output.
-ActiveRecord::Base.include_root_in_json = true
-
-# Store the full class name (including module namespace) in STI type column.
-ActiveRecord::Base.store_full_sti_class = true
-
-# Use ISO 8601 format for JSON serialized times and dates.
-ActiveSupport.use_standard_json_time_format = true
-
-# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
-# if you're including raw json in an HTML page.
-ActiveSupport.escape_html_entities_in_json = false
View
4 config/initializers/sass.rb
@@ -1,2 +1,4 @@
Sass::Plugin.options[:template_location] = File.join(RAILS_ROOT, 'app/styles')
-Sass::Plugin.options[:css_location] = File.join(RAILS_ROOT, 'public/stylesheets')
+Sass::Plugin.options[:css_location] = File.join(RAILS_ROOT, 'public/stylesheets')
+
+Haml::Template.options[:escape_html] = false
View
3 config/preinitializer.rb
@@ -1,3 +0,0 @@
-# load app_config.yml
-require 'yaml'
-APP_CONFIG = YAML.load_file(RAILS_ROOT + "/config/app_config.yml")
View
155 config/routes.rb
@@ -1,5 +1,5 @@
#==
-# Copyright (C) 2008 James S Urquhart
+# Copyright (C) 2010 James S Urquhart
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
@@ -23,93 +23,104 @@
# OTHER DEALINGS IN THE SOFTWARE.
#++
-ActionController::Routing::Routes.draw do |map|
- map.resource :account, :as => 'settings'
+Rucksack::Application.routes.draw do
+ resource :settings, :controller => 'accounts', :as => :account
- map.resource :dashboard
- map.resources :reminders, :member => {:snooze => :put}
-
- map.resource :status
- map.resources :journals
-
- # The priority is based upon order of creation: first created -> highest priority.
-
- # Sample of regular route:
- # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
- # Keep in mind you can assign values other than :controller and :action
-
- # Sample of named route:
- # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
- # This route can be invoked with purchase_url(:id => product.id)
-
- # Sample resource route (maps HTTP verbs to controller actions automatically):
- # map.resources :products
-
- # Sample resource route with options:
- # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
-
- # Sample resource route with sub-resources:
- # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
+ resource :dashboard
+ resources :reminders do
+ member do
+ put :snooze
+ end
+ end
- # Sample resource route with more complex sub-resources
- # map.resources :products do |products|
- # products.resources :comments
- # products.resources :sales, :collection => { :recent => :get }
- # end
-
- # Sample resource route within a namespace:
- # map.namespace :admin do |admin|
- # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
- # admin.resources :products
- # end
+ resource :status
+ resources :journals
- map.resources :users,
- :collection => {:forgot_password => :any,
- :reset_password => :any,
- :current => :get} do |users|
- users.resources :journals
- users.resources :reminders
- users.resources :pages
- users.resource :dashboard
- users.resource :status
+ resources :users do
+
+ collection do
+ get :forgot_password
+ put :forgot_password
+ post :forgot_password
+ get :reset_password
+ put :reset_password
+ post :reset_password
+ get :current
+ end
+
+ resources :journals
+ resources :reminders
+ resources :pages
+ resource :dashboard
+ resource :status
end
- map.resources :pages, :member => {:reorder => :post,
- :reorder_sidebar => :post,
- :transfer => :put,
- :favourite => :put,
- :duplicate => :post,
- :share => :any,
- :public => :get,
- :resize => :put,
- :reset_address => :put,
- :tags => :any}, :collection => {:current => :get} do |page|
- page.resources :lists, :member => {:reorder => :post, :transfer => :put} do |list|
- list.resources :list_items, :as => 'items', :member => {:status => :put}
+ resources :pages do
+ member do
+ post :reorder
+ post :reorder_sidebar
+ put :transfer
+ put :favourite
+ post :duplicate
+ get :share
+ put :share
+ post :share
+ get :public
+ put :resize
+ put :reset_address
+ get :tags
+ put :tags
+ post :tags
+ end
+
+ collection do
+ get :current
+ end
+
+ resources :lists do
+ member do
+ post :reorder
+ put :transfer
+ end
+ resources :items, :controller => 'list_items', :as => 'list_items' do
+ member do
+ put :status
+ end
+ end
+ end
+
+ resources :notes
+ resources :separators
+ resources :emails do
+ member do
+ get :public
+ end
end
- page.resources :notes
- page.resources :separators
- page.resources :emails, :member => {:public => :get}
- page.resources :uploaded_files
- page.resources :albums, :member => {:reorder => :post, :transfer => :put} do |album|
- album.resources :album_pictures, :as => 'pictures'
+
+ resources :uploaded_files
+ resources :albums do
+ member do
+ post :reorder
+ put :transfer
+ end
+ resources :pictures, :controller => 'album_pictures', :as => :album_pictures
end
end
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
- map.root :controller => "pages", :action => "current"
+ match '/', :controller => "pages", :action => "current", :as => :root
# Restful authentication
- map.resource :session
- map.login '/login', :controller => 'sessions', :action => 'new'
- map.logout '/logout', :controller => 'sessions', :action => 'destroy'
+ resource :session
+ match '/login', :controller => 'sessions', :action => 'new', :as => :login
+ match '/logout', :controller => 'sessions', :action => 'destroy', :as => :logout
# See how all your routes lay out with "rake routes"
# 404 icons
- map.connect '/images/file_icons/:id.png', :controller => 'uploaded_files', :action => 'icon'
+ match '/images/file_icons/:id.png', :controller => 'uploaded_files', :action => 'icon'
# Install the default routes as the lowest priority.
- map.connect ':controller/:action/:id'
- map.connect ':controller/:action/:id.:format'
+ match ':controller/:action/:id'
+ match ':controller/:action/:id.:format'
end
View
3 script/about
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/about'
View
3 script/console
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/console'
View
3 script/dbconsole
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/dbconsole'
View
3 script/destroy
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/destroy'
View
10 script/ferret_server
@@ -1,10 +0,0 @@
-#!/usr/bin/env ruby
-
-begin
- require File.join(File.dirname(__FILE__), '../vendor/plugins/acts_as_ferret/lib/server_manager')
-rescue LoadError
- # try the gem
- require 'rubygems'
- gem 'acts_as_ferret'
- require 'server_manager'
-end
View
3 script/generate
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/generate'
View
3 script/inbox
@@ -1,5 +1,6 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/environment'
+APP_PATH = File.expand_path('../../config/application', __FILE__)
+require File.expand_path('../../config/boot', __FILE__)
# Pop with SSL?
begin
View
3 script/performance/benchmarker
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
-require 'commands/performance/benchmarker'
View
3 script/performance/profiler
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
-require 'commands/performance/profiler'
View
3 script/performance/request
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
-require 'commands/performance/request'
View
3 script/plugin
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/plugin'
View
3 script/process/inspector
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
-require 'commands/process/inspector'
View
3 script/process/reaper
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
-require 'commands/process/reaper'
View
3 script/process/spawner
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
-require 'commands/process/spawner'
View
6 script/rails
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
+
+APP_PATH = File.expand_path('../../config/application', __FILE__)
+require File.expand_path('../../config/boot', __FILE__)
+require 'rails/commands'
View
3 script/runner
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/runner'
View
3 script/server
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/server'
View
7 script/setup
@@ -6,10 +6,13 @@ def randomize_secret
end
session_store_file = <<-SESSION_STORE
-ActionController::Base.session = {
+Rucksack::Application.configure do
+config.action_controller.session = {
:session_key => '_rucksack_session',
:secret => '#{randomize_secret}'
}
+config.secret_token = '#{randomize_secret}'
+end
SESSION_STORE
def write_initializer(filename, data = nil)
@@ -32,5 +35,5 @@ Dir["config/example/*"].each do |file|
end
-system "rake gems:install"
+system "bundle install"
system "rake db:rucksack:install --trace"

0 comments on commit 9abfb35

Please sign in to comment.
Something went wrong with that request. Please try again.