Sha256: b86899182c166d7b1da6a71b4ed7f66c7753c2c6fab8ab807ef1cd4f285b19b2

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

<%- if tiny -%>
APP_ROOT = File.expand_path(File.dirname(__FILE__))
<%- else -%>
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
<%- end -%>

require 'rubygems'
<%- if vendor -%>
$:.unshift File.join(APP_ROOT, 'vendor', 'sinatra', 'lib')
require 'sinatra'
<%- else -%>
require 'sinatra'
<%- end -%>
require '<%= view_framework %>'
<%- middleware.each do |m| -%>
require '<%= m.to_s.underscore %>'
<%- end -%>

<%- if tiny -%>
set :root, APP_ROOT

<%- unless actions.empty? -%>
<%- actions.each do |meth, path| -%>
<%= meth %> '<%= path %>' do
end

<%- end -%>
<%- else -%>
get '/' do
  <%= view_framework -%> :index
end
<%- end -%>

<%- else -%>
class <%= klass_name -%> < Sinatra::Application
  
  set :root, APP_ROOT  
  <%- middleware.each do |m| -%>
  use <%= m.to_s.classify %>
  <%- end -%>

  <%- unless actions.empty? -%>
  <%- actions.each do |meth, path| -%>
  <%= meth %> '<%= path %>' do
    <%= view_framework -%> :<%= path %>
  end

  <%- end -%>
  <%- else -%>
  get '/' do
    <%= view_framework -%> :index
  end
  <%- end -%>

end
<%- end -%>

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
quirkey-sinatra-gen-0.4.0 app_generators/sinatra_app/templates/lib/app.rb.erb
sinatra-gen-0.4.0 app_generators/sinatra_app/templates/lib/app.rb.erb