aboutsummaryrefslogtreecommitdiffstats
path: root/lib/capistrano/refinerycms/helpers.rb
blob: 565f45051929e430c4221bb0e83ae55633992f66 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module Capistrano
  module RefineryCMS
    module Helpers

      def refinerycms_template(template_name)
        f = File.join(fetch(:refinerycms_template_path), 'template_name')
        unless File.exists?(f)
          default_template_path = File.join(%W{ .. .. .. generators capistrano refinerycms templates #{ template_name } })
          f = File.expand_path(default_template_path, __FILE__)
        end

        template = File.read(f)
        StringIO.new(ERB.new(template).result(binding))
      end

    end
  end
end