From 64338c5a09402e3113771ca86512f6a2c8472342 Mon Sep 17 00:00:00 2001 From: Khaja Minhajuddin Date: Thu, 30 Jun 2011 22:23:38 +0530 Subject: [PATCH] use a dedicated directory (~/.foreman/templates) to store the templates --- lib/foreman/export/base.rb | 2 +- spec/foreman/export/upstart_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/foreman/export/base.rb b/lib/foreman/export/base.rb index 09fd89f..1c38c1f 100644 --- a/lib/foreman/export/base.rb +++ b/lib/foreman/export/base.rb @@ -26,7 +26,7 @@ private ###################################################################### def export_template(exporter, file, template_root) if template_root && File.exist?(file_path = File.join(template_root, file)) File.read(file_path) - elsif File.exist?(file_path = File.join("~/.foreman/", file)) + elsif File.exist?(file_path = File.join("~/.foreman/templates", file)) File.read(file_path) else File.read(File.expand_path("../../../../data/export/#{exporter}/#{file}", __FILE__)) diff --git a/spec/foreman/export/upstart_spec.rb b/spec/foreman/export/upstart_spec.rb index ef8f653..b06dfda 100644 --- a/spec/foreman/export/upstart_spec.rb +++ b/spec/foreman/export/upstart_spec.rb @@ -38,7 +38,7 @@ describe Foreman::Export::Upstart do end context "with alternate templates from home dir" do - let(:default_template_root) {File.expand_path("~/.foreman")} + let(:default_template_root) {File.expand_path("~/.foreman/templates")} before do FileUtils.mkdir_p default_template_root