Sha256: 0395aa54878a11c4979d83ecf39f9ba75a09567ecb0e36a5e520f72b1e60426b

Contents?: true

Size: 573 Bytes

Versions: 2

Compression:

Stored size: 573 Bytes

Contents

require 'erb'

module Capistrano
  module NginxUnicorn
    module Helpers

      def template(template_name, target)
        config_file = "#{fetch(:templates_path)}/#{template_name}"
        # if no customized file, proceed with default
        unless File.exists?(config_file)
          config_file = File.join(File.dirname(__FILE__), "../../generators/capistrano/nginx_unicorn/templates/#{template_name}")
        end
        config_stream = StringIO.new(ERB.new(File.read(config_file)).result(binding))
        upload! config_stream, target
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capistrano-nginx-unicorn-0.1.0 lib/capistrano/nginx_unicorn/helpers.rb
capistrano-nginx-unicorn-0.1.0.pre lib/capistrano/nginx_unicorn/helpers.rb