Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10570: application_to_application_controller_forgiving_version.diff

File application_to_application_controller_forgiving_version.diff, 6.5 kB (added by jaycfields, 6 months ago)

update for rebase

  • activesupport/test/dependencies_test.rb

    old new  
    446446 
    447447  def test_application_should_special_case_application_controller 
    448448    with_loading 'autoloading_fixtures' do 
    449       require_dependency 'application
     449      require_dependency 'application_controller
    450450      assert_equal 10, ApplicationController 
    451451      assert Dependencies.autoloaded?(:ApplicationController) 
    452452    end 
  • activesupport/test/autoloading_fixtures/application.rb

    old new  
  • activesupport/test/autoloading_fixtures/application_controller.rb

    old new  
  • railties/test/initializer_test.rb

    old new  
    136136  end 
    137137end 
    138138 
     139uses_mocha "Checking application.rb tests" do 
     140  class Initializer_check_application_file_name_Test < Test::Unit::TestCase 
     141    def test_abort_if_application_file_exists 
     142      Rails::Initializer.any_instance.expects(:puts) 
     143      File.expects(:exist?).returns true 
     144      Rails::Initializer.run(:check_application_file_name) 
     145    end 
     146 
     147    def test_no_abort_if_application_file_does_not_exist 
     148      Rails::Initializer.any_instance.expects(:puts).never 
     149      File.expects(:exist?).returns false 
     150      Rails::Initializer.run(:check_application_file_name) 
     151    end 
     152  end 
     153end 
     154 
    139155uses_mocha "Initializer plugin loading tests" do 
    140156  require File.dirname(__FILE__) + '/plugin_test_helper' 
    141157 
  • railties/helpers/application.rb

    old new  
    1 # Filters added to this controller apply to all controllers in the application. 
    2 # Likewise, all the methods added will be available for all controllers. 
    3  
    4 class ApplicationController < ActionController::Base 
    5   helper :all # include all helpers, all the time 
    6  
    7   # See ActionController::RequestForgeryProtection for details 
    8   # Uncomment the :secret if you're not using the cookie session store 
    9   protect_from_forgery # :secret => '<%= app_secret %>' 
    10 end 
  • railties/helpers/application_controller.rb

    old new  
     1# Filters added to this controller apply to all controllers in the application. 
     2# Likewise, all the methods added will be available for all controllers. 
     3 
     4class ApplicationController < ActionController::Base 
     5  helper :all # include all helpers, all the time 
     6 
     7  # See ActionController::RequestForgeryProtection for details 
     8  # Uncomment the :secret if you're not using the cookie session store 
     9  protect_from_forgery # :secret => '<%= app_secret %>' 
     10end 
  • railties/lib/rails_generator/generators/applications/app/app_generator.rb

    old new  
    4848      m.file "README",         "README" 
    4949 
    5050      # Application 
    51       m.template "helpers/application.rb",        "app/controllers/application.rb", :assigns => { :app_name => @app_name, :app_secret => md5.hexdigest } 
     51      m.template "helpers/application_controller.rb", "app/controllers/application_controller.rb", :assigns => { :app_name => @app_name, :app_secret => md5.hexdigest } 
    5252      m.template "helpers/application_helper.rb", "app/helpers/application_helper.rb" 
    5353      m.template "helpers/test_helper.rb",        "test/test_helper.rb" 
    5454 
  • railties/lib/console_with_helpers.rb

    old new  
    1616  end 
    1717end 
    1818 
    19 require 'application' 
     19require 'application' rescue nil 
    2020 
    2121class << helper  
    2222  include_all_modules_from ActionView 
  • railties/lib/initializer.rb

    old new  
    6161    # in order (view execution order in source). 
    6262    def process 
    6363      check_ruby_version 
     64      check_application_file_name 
    6465      set_load_path 
    6566       
    6667      require_frameworks 
     
    106107      require 'ruby_version_check' 
    107108    end 
    108109 
     110    # Check for application.rb and suggest rename if it exists 
     111    def check_application_file_name 
     112      puts 'Please rename app/controllers/application.rb to app/controllers/application_controller.rb' if File.exist?("#{RAILS_ROOT}/app/controllers/application.rb") 
     113    end 
     114 
    109115    # Set the <tt>$LOAD_PATH</tt> based on the value of 
    110116    # Configuration#load_paths. Duplicates are removed. 
    111117    def set_load_path 
  • railties/lib/test_help.rb

    old new  
    1 require_dependency 'application' 
     1require_dependency 'application' rescue nil 
    22 
    33# Make double-sure the RAILS_ENV is set to test, 
    44# so fixtures are loaded to the right database 
  • railties/lib/commands/performance/request.rb

    old new  
    11#!/usr/bin/env ruby 
    22require 'config/environment' 
    3 require 'application' 
     3require 'application' rescue nil 
    44require 'action_controller/request_profiler' 
    55 
    66ActionController::RequestProfiler.run(ARGV)