Sha256: 0a7af43ea2a402f53c4c4b8a2bce2672d2ffdd213d0bc0f7a81c78adcde4ea21

Contents?: true

Size: 336 Bytes

Versions: 53

Compression:

Stored size: 336 Bytes

Contents

module Generators
  module HoboSupport
    EvalTemplate = classy_module do

    private
      def eval_template(template_name)
        source  = File.expand_path(find_in_source_paths(template_name))
        context = instance_eval('binding')
        ERB.new(::File.binread(source), nil, '-').result(context)
      end

    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
hobo_support-2.2.6 lib/generators/hobo_support/eval_template.rb
hobo_support-2.2.5 lib/generators/hobo_support/eval_template.rb
hobo_support-2.2.4 lib/generators/hobo_support/eval_template.rb
hobo_support-2.2.3 lib/generators/hobo_support/eval_template.rb
hobo_support-2.2.2 lib/generators/hobo_support/eval_template.rb
hobo_support-2.2.1 lib/generators/hobo_support/eval_template.rb
hobo_support-2.2.0 lib/generators/hobo_support/eval_template.rb
hobo_support-2.1.2 lib/generators/hobo_support/eval_template.rb
hobo_support-2.1.1 lib/generators/hobo_support/eval_template.rb
hobo_support-2.1.0 lib/generators/hobo_support/eval_template.rb
hobo_support-2.1.0.pre4 lib/generators/hobo_support/eval_template.rb
hobo_support-2.1.0.pre3 lib/generators/hobo_support/eval_template.rb
hobo_support-2.1.0.pre2 lib/generators/hobo_support/eval_template.rb
hobo_support-2.1.0.pre1 lib/generators/hobo_support/eval_template.rb
hobo_support-2.0.1 lib/generators/hobo_support/eval_template.rb
hobo_support-2.0.0 lib/generators/hobo_support/eval_template.rb
hobo_support-2.0.0.pre10 lib/generators/hobo_support/eval_template.rb
hobo_support-2.0.0.pre9 lib/generators/hobo_support/eval_template.rb
hobo_support-2.0.0.pre8 lib/generators/hobo_support/eval_template.rb
hobo_support-1.3.3 lib/generators/hobo_support/eval_template.rb