Method: Landlord::VirtualHost#config_template_path

Defined in:
lib/landlord/virtual_host.rb

#config_template_path(type = nil) ⇒ Object



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/landlord/virtual_host.rb', line 72

def config_template_path(type = nil)
  conf_file = [
    'virtual_host',
    type || Landlord.config.server_type,
    'conf'
  ].join('.')

  Landlord.config.virtual_host_template or
    [
      File.expand_path(
        conf_file,
        Landlord.config.template_dir
      ),
      File.expand_path(
        File.join(
          '..',
          '..',
          'templates',
          conf_file
        ),
        File.dirname(__FILE__)
      )
    ].find do |path|
      File.exist?(path)
    end
end