Changeset 809

Show
Ignore:
Timestamp:
04/18/08 15:47:12 (5 months ago)
Author:
seancribbs
Message:

Move extra initialization into after_initialize block.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/radiant/CHANGELOG

    r808 r809  
    22 
    33=== SVN 
     4* Move extra initialization into after_initialize block. [Sean Cribbs] 
    45* Notice area now fades away after 3 seconds. [Andrew O'Brien] 
    56* <r:find /> now accepts paths relative to the current page. [Andrew O'Brien] 
  • trunk/radiant/config/environment.rb

    r780 r809  
    6868    %{<div class="error-with-field">#{html} <small class="error">&bull; #{[instance.error_message].flatten.first}</small></div>} 
    6969  end 
     70   
     71  config.after_initialize do 
     72    # Add new inflection rules using the following format: 
     73    Inflector.inflections do |inflect| 
     74      inflect.uncountable 'config' 
     75      inflect.uncountable 'meta' 
     76    end 
     77 
     78    # Auto-require text filters 
     79    Dir["#{RADIANT_ROOT}/app/models/*_filter.rb"].each do |filter| 
     80      require_dependency File.basename(filter).sub(/\.rb$/, '') 
     81    end 
     82 
     83    # Response Caching Defaults 
     84    ResponseCache.defaults[:directory] = ActionController::Base.page_cache_directory 
     85    ResponseCache.defaults[:logger]    = ActionController::Base.logger 
     86  end 
    7087end 
    71  
    72 # Add new inflection rules using the following format: 
    73 Inflector.inflections do |inflect| 
    74   inflect.uncountable 'config' 
    75   inflect.uncountable 'meta' 
    76 end 
    77  
    78 # Auto-require text filters 
    79 Dir["#{RADIANT_ROOT}/app/models/*_filter.rb"].each do |filter| 
    80   require_dependency File.basename(filter).sub(/\.rb$/, '') 
    81 end 
    82  
    83 # Response Caching Defaults 
    84 ResponseCache.defaults[:directory] = ActionController::Base.page_cache_directory 
    85 ResponseCache.defaults[:logger]    = ActionController::Base.logger 
  • trunk/radiant/lib/generators/instance/templates/instance_environment.rb

    r780 r809  
    6868    %{<div class="error-with-field">#{html} <small class="error">&bull; #{[instance.error_message].flatten.first}</small></div>} 
    6969  end 
     70   
     71  config.after_initialize do 
     72    # Add new inflection rules using the following format: 
     73    Inflector.inflections do |inflect| 
     74      inflect.uncountable 'config' 
     75      inflect.uncountable 'meta' 
     76    end 
     77 
     78    # Auto-require text filters 
     79    Dir["#{RADIANT_ROOT}/app/models/*_filter.rb"].each do |filter| 
     80      require_dependency File.basename(filter).sub(/\.rb$/, '') 
     81    end 
     82 
     83    # Response Caching Defaults 
     84    ResponseCache.defaults[:directory] = ActionController::Base.page_cache_directory 
     85    ResponseCache.defaults[:logger]    = ActionController::Base.logger 
     86  end 
    7087end 
    71  
    72 # Add new inflection rules using the following format: 
    73 Inflector.inflections do |inflect| 
    74   inflect.uncountable 'config' 
    75   inflect.uncountable 'meta' 
    76 end 
    77  
    78 # Auto-require text filters 
    79 Dir["#{RADIANT_ROOT}/app/models/*_filter.rb"].each do |filter| 
    80   require_dependency File.basename(filter).sub(/\.rb$/, '') 
    81 end 
    82  
    83 # Response Caching Defaults 
    84 ResponseCache.defaults[:directory] = ActionController::Base.page_cache_directory 
    85 ResponseCache.defaults[:logger]    = ActionController::Base.logger 
  • trunk/radiant/lib/radiant/initializer.rb

    r780 r809  
    107107 
    108108    def after_initialize 
     109      super 
    109110      extension_loader.activate_extensions 
    110       super 
    111111    end 
    112112