Automatically update outdated init.rb files for Rails installations.
git-svn-id: svn://hamptoncatlin.com/haml/trunk@710 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
parent
7a1ebe0c17
commit
edde33847b
|
@ -29,3 +29,16 @@ if defined?(ActionView::TemplateHandler)
|
|||
else
|
||||
require 'haml/template/patch'
|
||||
end
|
||||
|
||||
# Update init.rb to the current version
|
||||
# if it's out of date.
|
||||
#
|
||||
# We can probably remove this as of v1.9,
|
||||
# because the new init file is sufficiently flexible
|
||||
# to not need updating.
|
||||
rails_init_file = File.join(RAILS_ROOT, 'vendor', 'plugins', 'haml', 'init.rb')
|
||||
haml_init_file = File.join(File.dirname(__FILE__), '..', '..', 'init.rb')
|
||||
if File.exists?(rails_init_file)
|
||||
require 'fileutils'
|
||||
FileUtils.cp(haml_init_file, rails_init_file) unless FileUtils.cmp(rails_init_file, haml_init_file)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue