Top Level Namespace

Includes:
Process

Defined Under Namespace

Modules: Winter

Constant Summary collapse

WINTERFELL_DIR =
ENV['WINTERFELL_DIR'] || '.'
SERVICES_DIR =

RUN_DIR = File.join(WINTERFELL_DIR,“run”) || ‘run’

"services"
RUN_DIR =
"run"
BUNDLES_DIR =
"bundles"
LIBS_DIR =
"libs"
DEFAULT_CONF_DIR =
"defaults"
TEMPLATES_DIR =
"templates"
DAEMONTOOLS_DIR =
"/service"
OPT_BUNDLE_DIR =
"bundle.dir"
F_CONFIG_PROPERTIES =
"config.properties"
F_SYSTEM_PROPERTIES =
"system.properties"
F_LOGGER_PROPERTIES =
"logger_bundle.properties"
F_LOG4J_PROPERTIES =
"log4j.properties"
F_LOGBACK_XML =
"logback.xml"

Instance Method Summary collapse

Instance Method Details

#process_templates(source_templates, destination_dir) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/winter/templates.rb', line 18

def process_templates(source_templates, destination_dir)
  #$LOG.debug "'#{source_templates}' -> #{destination_dir}"
  Dir.glob(File.join(source_templates, "**", "*.erb")) do |tmpl|
    result = ERB.new(File.open(tmpl).read).result(binding)
    dest = destination_dir + tmpl.sub(%r{#{source_templates}},"").sub(/\.erb$/, "")
    #$LOG.debug "Processing: #{dest}"
    FileUtils.mkpath File.dirname(dest)
    File.open(dest,'w') do |f| 
      f.write(result)
      f.close()
    end
  end
end