Sha256: ac46599ad12dde47e2f8fca191955e924bb4009f03f53782ca2659fc1358aba5

Contents?: true

Size: 597 Bytes

Versions: 2

Compression:

Stored size: 597 Bytes

Contents

Capistrano::Configuration.instance.load do
  def set_default(name, *args, &block)
    set(name, *args, &block) unless exists?(name)
  end

  set_default(:templates_path, "config/deploy/templates")

  def kapify_template(generator, template_name, target)
    config_file = "#{templates_path}/#{template_name}"
    # if no customized file, proceed with default
    unless File.exists?(config_file)
      config_file = File.join(File.dirname(__FILE__), "../generators/kapify/#{generator}/templates/#{template_name}")
    end
    put ERB.new(File.read(config_file)).result(binding), target
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kapify-0.0.2 lib/kapify/base.rb
kapify-0.0.1 lib/kapify/base.rb