rails 3.1 changes

This commit is contained in:
Nicolas Bally 2011-07-05 21:55:58 +02:00
parent bee988dc54
commit 1a8a6f3eda
18 changed files with 155 additions and 129 deletions

19
Gemfile
View File

@ -1,6 +1,6 @@
source 'http://rubygems.org' source 'http://rubygems.org'
gem 'rails', '3.0.6' gem 'rails', '3.1.0.rc4'
# Bundle edge Rails instead: # Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git' # gem 'rails', :git => 'git://github.com/rails/rails.git'
@ -8,8 +8,9 @@ gem 'rails', '3.0.6'
gem 'sqlite3' gem 'sqlite3'
# Asset template engines # Asset template engines
gem 'sass-rails', "~> 3.1.0.rc"
gem 'sass' gem 'coffee-script'
gem 'uglifier'
gem 'jquery-rails' gem 'jquery-rails'
@ -17,10 +18,10 @@ gem 'jquery-rails'
# gem 'unicorn' # gem 'unicorn'
# Deploy with Capistrano # Deploy with Capistrano
gem 'capistrano' # gem 'capistrano'
# To use debugger # To use debugger
# gem 'ruby-debug' # gem 'ruby-debug19', :require => 'ruby-debug'
@ -43,5 +44,11 @@ gem "cancan"
#gem "squeel" #gem "squeel"
gem 'meta_search' gem 'meta_search'
gem "devise" gem "devise"
gem "haml", ">= 3.0.0" gem "haml", ">= 3.0.0"
group :test do
# Pretty printed test output
gem 'turn', :require => false
end

View File

@ -1,114 +1,132 @@
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
abstract (1.0.0) actionmailer (3.1.0.rc4)
actionmailer (3.0.6) actionpack (= 3.1.0.rc4)
actionpack (= 3.0.6) mail (~> 2.3.0)
mail (~> 2.2.15) actionpack (3.1.0.rc4)
actionpack (3.0.6) activemodel (= 3.1.0.rc4)
activemodel (= 3.0.6) activesupport (= 3.1.0.rc4)
activesupport (= 3.0.6) builder (~> 3.0.0)
builder (~> 2.1.2) erubis (~> 2.7.0)
erubis (~> 2.6.6) i18n (~> 0.6)
i18n (~> 0.5.0) rack (~> 1.3.0)
rack (~> 1.2.1) rack-cache (~> 1.0.1)
rack-mount (~> 0.6.14) rack-mount (~> 0.8.1)
rack-test (~> 0.5.7) rack-test (~> 0.6.0)
tzinfo (~> 0.3.23) sprockets (~> 2.0.0.beta.10)
activemodel (3.0.6) tzinfo (~> 0.3.27)
activesupport (= 3.0.6) activemodel (3.1.0.rc4)
builder (~> 2.1.2) activesupport (= 3.1.0.rc4)
i18n (~> 0.5.0) bcrypt-ruby (~> 2.1.4)
activerecord (3.0.6) builder (~> 3.0.0)
activemodel (= 3.0.6) i18n (~> 0.6)
activesupport (= 3.0.6) activerecord (3.1.0.rc4)
arel (~> 2.0.2) activemodel (= 3.1.0.rc4)
tzinfo (~> 0.3.23) activesupport (= 3.1.0.rc4)
activeresource (3.0.6) arel (~> 2.1.1)
activemodel (= 3.0.6) tzinfo (~> 0.3.27)
activesupport (= 3.0.6) activeresource (3.1.0.rc4)
activesupport (3.0.6) activemodel (= 3.1.0.rc4)
acts_as_list (0.1.2) activesupport (= 3.1.0.rc4)
activesupport (3.1.0.rc4)
multi_json (~> 1.0)
acts_as_list (0.1.3)
acts_as_tree (0.1.1) acts_as_tree (0.1.1)
arel (2.0.9) ansi (1.3.0)
arel (2.1.3)
bcrypt-ruby (2.1.4) bcrypt-ruby (2.1.4)
builder (2.1.2) builder (3.0.0)
cancan (1.6.4) cancan (1.6.5)
capistrano (2.6.0) carrierwave (0.5.4)
highline
net-scp (>= 1.0.0)
net-sftp (>= 2.0.0)
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
carrierwave (0.5.3)
activesupport (~> 3.0) activesupport (~> 3.0)
devise (1.3.4) coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.1.1)
devise (1.4.2)
bcrypt-ruby (~> 2.1.2) bcrypt-ruby (~> 2.1.2)
orm_adapter (~> 0.0.3) orm_adapter (~> 0.0.3)
warden (~> 1.0.3) warden (~> 1.0.3)
erubis (2.6.6) erubis (2.7.0)
abstract (>= 1.0.0) execjs (1.2.0)
formtastic (1.2.3) multi_json (~> 1.0)
formtastic (1.2.4)
actionpack (>= 2.3.7) actionpack (>= 2.3.7)
activesupport (>= 2.3.7) activesupport (>= 2.3.7)
i18n (~> 0.4) i18n (~> 0.4)
haml (3.1.1) haml (3.1.2)
highline (1.6.1) hike (1.1.0)
i18n (0.5.0) i18n (0.6.0)
jquery-rails (1.0.2) jquery-rails (1.0.12)
railties (~> 3.0) railties (~> 3.0)
thor (~> 0.14) thor (~> 0.14)
kaminari (0.12.4) kaminari (0.12.4)
rails (>= 3.0.0) rails (>= 3.0.0)
mail (2.2.19) mail (2.3.0)
activesupport (>= 2.3.6)
i18n (>= 0.4.0) i18n (>= 0.4.0)
mime-types (~> 1.16) mime-types (~> 1.16)
treetop (~> 1.4.8) treetop (~> 1.4.8)
meta_search (1.0.5) meta_search (0.5.4)
actionpack (~> 3.0.2) actionpack (>= 3.0.0.beta4)
activerecord (~> 3.0.2) activerecord (>= 3.0.0.beta4)
activesupport (~> 3.0.2) activesupport (>= 3.0.0.beta4)
arel (~> 2.0.2) arel (>= 0.4.0)
mime-types (1.16) mime-types (1.16)
mimetype-fu (0.1.2) mimetype-fu (0.1.2)
net-scp (1.0.4) multi_json (1.0.3)
net-ssh (>= 1.99.1)
net-sftp (2.0.5)
net-ssh (>= 2.0.9)
net-ssh (2.1.4)
net-ssh-gateway (1.1.0)
net-ssh (>= 1.99.1)
orm_adapter (0.0.5) orm_adapter (0.0.5)
polyglot (0.3.1) polyglot (0.3.1)
rack (1.2.2) rack (1.3.0)
rack-mount (0.6.14) rack-cache (1.0.2)
rack (>= 0.4)
rack-mount (0.8.1)
rack (>= 1.0.0) rack (>= 1.0.0)
rack-test (0.5.7) rack-ssl (1.3.2)
rack
rack-test (0.6.0)
rack (>= 1.0) rack (>= 1.0)
rails (3.0.6) rails (3.1.0.rc4)
actionmailer (= 3.0.6) actionmailer (= 3.1.0.rc4)
actionpack (= 3.0.6) actionpack (= 3.1.0.rc4)
activerecord (= 3.0.6) activerecord (= 3.1.0.rc4)
activeresource (= 3.0.6) activeresource (= 3.1.0.rc4)
activesupport (= 3.0.6) activesupport (= 3.1.0.rc4)
bundler (~> 1.0) bundler (~> 1.0)
railties (= 3.0.6) railties (= 3.1.0.rc4)
railties (3.0.6) railties (3.1.0.rc4)
actionpack (= 3.0.6) actionpack (= 3.1.0.rc4)
activesupport (= 3.0.6) activesupport (= 3.1.0.rc4)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7) rake (>= 0.8.7)
thor (~> 0.14.4) rdoc (~> 3.4)
rake (0.8.7) thor (~> 0.14.6)
rake (0.9.2)
rdoc (3.8)
rmagick (2.13.1) rmagick (2.13.1)
sass (3.1.1) sass (3.1.4)
simple-navigation (3.2.0) sass-rails (3.1.0.rc.4)
actionpack (~> 3.1.0.rc1)
railties (~> 3.1.0.rc1)
sass (>= 3.1.4)
sprockets (>= 2.0.0.beta.9)
simple-navigation (3.3.3)
activesupport (>= 2.3.2) activesupport (>= 2.3.2)
sprockets (2.0.0.beta.10)
hike (~> 1.0)
rack (~> 1.0)
tilt (!= 1.3.0, ~> 1.1)
sqlite3 (1.3.3) sqlite3 (1.3.3)
thor (0.14.6) thor (0.14.6)
tilt (1.3.2)
treetop (1.4.9) treetop (1.4.9)
polyglot (>= 0.3.1) polyglot (>= 0.3.1)
tzinfo (0.3.27) turn (0.8.2)
ansi (>= 1.2.2)
tzinfo (0.3.29)
uglifier (1.0.0)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
warden (1.0.4) warden (1.0.4)
rack (>= 1.0) rack (>= 1.0)
@ -119,8 +137,8 @@ DEPENDENCIES
acts_as_list acts_as_list
acts_as_tree acts_as_tree
cancan cancan
capistrano
carrierwave carrierwave
coffee-script
devise devise
formtastic formtastic
haml (>= 3.0.0) haml (>= 3.0.0)
@ -128,8 +146,10 @@ DEPENDENCIES
kaminari kaminari
meta_search meta_search
mimetype-fu mimetype-fu
rails (= 3.0.6) rails (= 3.1.0.rc4)
rmagick rmagick
sass sass-rails (~> 3.1.0.rc)
simple-navigation simple-navigation
sqlite3 sqlite3
turn
uglifier

15
README
View File

@ -156,6 +156,10 @@ PostgreSQL and SQLite 3.
The default directory structure of a generated Ruby on Rails application: The default directory structure of a generated Ruby on Rails application:
|-- app |-- app
| |-- assets
| |-- images
| |-- javascripts
| `-- stylesheets
| |-- controllers | |-- controllers
| |-- helpers | |-- helpers
| |-- mailers | |-- mailers
@ -172,9 +176,6 @@ The default directory structure of a generated Ruby on Rails application:
| `-- tasks | `-- tasks
|-- log |-- log
|-- public |-- public
| |-- images
| |-- javascripts
| `-- stylesheets
|-- script |-- script
|-- test |-- test
| |-- fixtures | |-- fixtures
@ -188,11 +189,16 @@ The default directory structure of a generated Ruby on Rails application:
| |-- sessions | |-- sessions
| `-- sockets | `-- sockets
`-- vendor `-- vendor
|-- assets
`-- stylesheets
`-- plugins `-- plugins
app app
Holds all the code that's specific to this particular application. Holds all the code that's specific to this particular application.
app/assets
Contains subdirectories for images, stylesheets, and JavaScript files.
app/controllers app/controllers
Holds controllers that should be named like weblogs_controller.rb for Holds controllers that should be named like weblogs_controller.rb for
automated URL mapping. All controllers should descend from automated URL mapping. All controllers should descend from
@ -237,8 +243,7 @@ lib
the load path. the load path.
public public
The directory available for the web server. Contains subdirectories for The directory available for the web server. Also contains the dispatchers and the
images, stylesheets, and javascripts. Also contains the dispatchers and the
default HTML files. This should be set as the DOCUMENT_ROOT of your web default HTML files. This should be set as the DOCUMENT_ROOT of your web
server. server.

View File

@ -4,4 +4,4 @@
require File.expand_path('../config/application', __FILE__) require File.expand_path('../config/application', __FILE__)
PharmacieboissierCom::Application.load_tasks Pharma::Application.load_tasks

View File

@ -1,4 +1,4 @@
# This file is used by Rack-based servers to start the application. # This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__) require ::File.expand_path('../config/environment', __FILE__)
run PharmacieboissierCom::Application run Pharma::Application

View File

@ -7,7 +7,7 @@ require 'rails/all'
# you've limited to :test, :development, or :production. # you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env) if defined?(Bundler) Bundler.require(:default, Rails.env) if defined?(Bundler)
module PharmacieboissierCom module Pharma
class Application < Rails::Application class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here. # Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers # Application configuration should go into files in config/initializers
@ -31,13 +31,6 @@ module PharmacieboissierCom
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de # config.i18n.default_locale = :de
# Please note that JavaScript expansions are *ignored altogether* if the asset
# pipeline is enabled (see config.assets.enabled below). Put your defaults in
# app/assets/javascripts/application.js in that case.
#
# JavaScript files you want as :defaults (application.js is always included).
# config.action_view.javascript_expansions[:defaults] = %w(prototype prototype_ujs)
config.time_zone = 'Paris' config.time_zone = 'Paris'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
@ -67,8 +60,11 @@ module PharmacieboissierCom
config.autoload_paths << full_path if File.directory?(full_path) config.autoload_paths << full_path if File.directory?(full_path)
end end
end # Enable the asset pipeline
config.assets.enabled = true
end
end end

View File

@ -1,4 +1,3 @@
# -*- encoding : utf-8 -*-
require 'rubygems' require 'rubygems'
# Set up gems listed in the Gemfile. # Set up gems listed in the Gemfile.

View File

@ -1,8 +1,5 @@
# Load the rails application # Load the rails application
require File.expand_path('../application', __FILE__) require File.expand_path('../application', __FILE__)
# Initialize the rails application # Initialize the rails application
PharmacieboissierCom::Application.initialize! Pharma::Application.initialize!

View File

@ -1,5 +1,4 @@
# -*- encoding : utf-8 -*- Pharma::Application.configure do
PharmacieboissierCom::Application.configure do
# Settings specified here will take precedence over those in config/application.rb # Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on # In the development environment your application's code is reloaded on
@ -12,7 +11,6 @@ PharmacieboissierCom::Application.configure do
# Show full error reports and disable caching # Show full error reports and disable caching
config.consider_all_requests_local = true config.consider_all_requests_local = true
config.action_view.debug_rjs = true
config.action_controller.perform_caching = false config.action_controller.perform_caching = false
# Don't care if the mailer can't send # Don't care if the mailer can't send
@ -22,7 +20,10 @@ PharmacieboissierCom::Application.configure do
config.active_support.deprecation = :log config.active_support.deprecation = :log
# Only use best-standards-support built into browsers # Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin config.action_dispatch.best_standards_support = :builtin
# Do not compress assets
config.assets.compress = false
config.action_mailer.default_url_options = { :host => 'localhost:3000' } config.action_mailer.default_url_options = { :host => 'localhost:3000' }
@ -40,4 +41,3 @@ PharmacieboissierCom::Application.configure do
end end
HOSTNAME = "localhost:3000" HOSTNAME = "localhost:3000"

View File

@ -1,5 +1,5 @@
# -*- encoding : utf-8 -*- # -*- encoding : utf-8 -*-
PharmacieboissierCom::Application.configure do Pharma::Application.configure do
# Settings specified here will take precedence over those in config/application.rb # Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests # Code is not reloaded between requests
@ -12,6 +12,11 @@ PharmacieboissierCom::Application.configure do
# Disable Rails's static asset server (Apache or nginx will already do this) # Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.compress = true
# Specify the default JavaScript compressor
config.assets.js_compressor = :uglifier
# Specifies the header that your server uses for sending files # Specifies the header that your server uses for sending files
# (comment out if your front-end server doesn't support this) # (comment out if your front-end server doesn't support this)
@ -29,7 +34,7 @@ PharmacieboissierCom::Application.configure do
# Use a different cache store in production # Use a different cache store in production
# config.cache_store = :mem_cache_store # config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and javascripts from an asset server # Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com" # config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
@ -47,9 +52,11 @@ PharmacieboissierCom::Application.configure do
# Send deprecation notices to registered listeners # Send deprecation notices to registered listeners
config.active_support.deprecation = :notify config.active_support.deprecation = :notify
config.action_mailer.default_url_options = { :host => "test.pharmacie-boissier.com" } config.action_mailer.default_url_options = { :host => "test.pharmacie-boissier.com" }
config.action_mailer.delivery_method = :sendmail config.action_mailer.delivery_method = :sendmail
end end
HOSTNAME = "test.pharmacieboissier.com" HOSTNAME = "test.pharmacieboissier.com"

View File

@ -1,5 +1,4 @@
# -*- encoding : utf-8 -*- Pharma::Application.configure do
PharmacieboissierCom::Application.configure do
# Settings specified here will take precedence over those in config/application.rb # Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's # The test environment is used exclusively to run your application's

View File

@ -1,4 +1,3 @@
# -*- encoding : utf-8 -*-
# Be sure to restart your server when you modify this file. # 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. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.

View File

@ -1,4 +1,3 @@
# -*- encoding : utf-8 -*-
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format # Add new inflection rules using the following format

View File

@ -1,4 +1,3 @@
# -*- encoding : utf-8 -*-
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks: # Add new mime types for use in respond_to blocks:

View File

@ -1,8 +1,7 @@
# -*- encoding : utf-8 -*-
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies. # Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid! # If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random, # Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks. # no regular words or you'll be exposed to dictionary attacks.
PharmacieboissierCom::Application.config.secret_token = 'fa914363864abe6b6892e6e8043000d9bbe7c1f750bc5875d09010776616b5b7ba14cf7e5870fb804531792830ce9eae1fbcd671260894ba1c94a2d448bd4322' Pharma::Application.config.secret_token = 'a38a51e88d249df9056a06409a1a69fe10870379ee6571369c96d4e2976e32c5453d179ba7f21e5c1dd326de80cc76b1f7554f59a4bcf060eadc2166d535434f'

View File

@ -1,9 +1,8 @@
# -*- encoding : utf-8 -*-
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
PharmacieboissierCom::Application.config.session_store :cookie_store, :key => '_pharmacieboissier.com_session' Pharma::Application.config.session_store :cookie_store, key: '_pharma_session'
# Use the database for sessions instead of the cookie-based default, # Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information # which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration") # (create the session table with "rails generate session_migration")
# PharmacieboissierCom::Application.config.session_store :active_record_store # Pharma::Application.config.session_store :active_record_store

View File

@ -1,9 +1,11 @@
# -*- encoding : utf-8 -*-
require 'test_helper' require 'test_helper'
require 'rails/performance_test_help' require 'rails/performance_test_help'
# Profiling results for each test method are written to tmp/performance.
class BrowsingTest < ActionDispatch::PerformanceTest class BrowsingTest < ActionDispatch::PerformanceTest
# Refer to the documentation for all available options
# self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
# :output => 'tmp/performance', :formats => [:flat] }
def test_homepage def test_homepage
get '/' get '/'
end end

View File

@ -1,4 +1,3 @@
# -*- encoding : utf-8 -*-
ENV["RAILS_ENV"] = "test" ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__) require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help' require 'rails/test_help'