Changeset 434

Show
Ignore:
Timestamp:
02/26/08 01:53:09 (11 months ago)
Author:
mbailey
Message:

you can over ride default deprec templates by putting your own in config/templates

The path must be the same as in the deprec tree.

e.g. config/templates/nginx/nginx.conf.erb

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/deprec/capistrano_extensions.rb

    r428 r434  
    3333    end 
    3434   
    35     template = ERB.new(IO.read(File.join(DEPREC_TEMPLATES_BASE, app.to_s, template)), nil, '-') 
     35    # Local copies of deprec templates exist they will be used  
     36    # e.g. config/templates/nginx/nginx.conf.erb 
     37    local_template = File.join('config','templates',app.to_s, template) 
     38    if File.exists?(local_template) 
     39      puts 
     40      puts "Using local template (#{local_template})" 
     41      template = ERB.new(IO.read(local_template), nil, '-') 
     42    else 
     43      template = ERB.new(IO.read(File.join(DEPREC_TEMPLATES_BASE, app.to_s, template)), nil, '-') 
     44    end 
    3645    rendered_template = template.result(binding) 
    3746