Sha256: a28d4b905db769a51e9c20a1f69f9b6ffd649070aa1da398a8b480d3927479de

Contents?: true

Size: 363 Bytes

Versions: 7

Compression:

Stored size: 363 Bytes

Contents

require 'erb'
class Rack::App::File::Parser::ERB < Rack::App::File::Parser

  require 'erb'

  def parse(file_path)
    [::ERB.new(File.read(file_path)).result(@app.instance_eval { binding })]
  end

  def file_type(file_path)
    super(file_path.sub(/\.erb$/, ''))
  end

  def self.format_request_path(request_path)
    request_path.sub(/\.erb$/, '')
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rack-app-0.10.1 lib/rack/app/file/parser/erb.rb
rack-app-0.9.2 lib/rack/app/file/parser/erb.rb
rack-app-0.9.1 lib/rack/app/file/parser/erb.rb
rack-app-0.9.0 lib/rack/app/file/parser/erb.rb
rack-app-0.8.2 lib/rack/app/file/parser/erb.rb
rack-app-0.8.1 lib/rack/app/file/parser/erb.rb
rack-app-0.7.0 lib/rack/app/file/parser/erb.rb