Changeset 9167
- Timestamp:
- 03/31/08 06:53:44 (5 months ago)
- Files:
-
- trunk/railties/CHANGELOG (modified) (1 diff)
- trunk/railties/lib/initializer.rb (modified) (1 diff)
- trunk/railties/lib/rails/plugin/loader.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/railties/CHANGELOG
r9148 r9167 1 1 *SVN* 2 3 * Allow files in plugins to be reloaded like the rest of the application. [rick] 4 5 Enables or disables plugin reloading. 6 7 config.reload_plugins = true 8 9 You can get around this setting per plugin. 10 If #reload_plugins? == false (DEFAULT), add this to your plugin's init.rb to make it reloadable: 11 12 Dependencies.load_once_paths.delete lib_path 13 14 If #reload_plugins? == true, add this to your plugin's init.rb to only load it once: 15 16 Dependencies.load_once_paths << lib_path 2 17 3 18 * Small tweak to allow plugins to specify gem dependencies. [rick] trunk/railties/lib/initializer.rb
r9148 r9167 517 517 # the implementation of Rails::Plugin::Loader for more details. 518 518 attr_accessor :plugin_loader 519 520 # Enables or disables plugin reloading. You can get around this setting per plugin. 521 # If #reload_plugins? == false, add this to your plugin's init.rb to make it reloadable: 522 # 523 # Dependencies.load_once_paths.delete lib_path 524 # 525 # If #reload_plugins? == true, add this to your plugin's init.rb to only load it once: 526 # 527 # Dependencies.load_once_paths << lib_path 528 # 529 attr_accessor :reload_plugins 530 531 # Returns true if plugin reloading is enabled. 532 def reload_plugins? 533 !!@reload_plugins 534 end 519 535 520 536 # An array of gems that this rails application depends on. Rails will automatically load trunk/railties/lib/rails/plugin/loader.rb
r8301 r9167 47 47 $LOAD_PATH.insert(application_lib_index + 1, path) 48 48 Dependencies.load_paths << path 49 Dependencies.load_once_paths << path 49 unless Rails.configuration.reload_plugins? 50 Dependencies.load_once_paths << path 51 end 50 52 end 51 53 end