Sha256: 35e8c4925f465c671bb493d21f04da604c166f84b74e800b8d2ac5913929c328

Contents?: true

Size: 1.02 KB

Versions: 7

Compression:

Stored size: 1.02 KB

Contents

#--
#            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
#                    Version 2, December 2004
#
#            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
#   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
#
#  0. You just DO WHAT THE FUCK YOU WANT TO.
#++

require 'sinatra/base'
require 'bcrypt'
require 'data_mapper'
require 'dm-sqlite-adapter'
require 'rack/csrf'

class ${ClassName} < Sinatra::Base
  db_path = File.join Dir.pwd, 'db'
  Dir.mkdir db_path unless Dir.exists? db_path
  DataMapper.setup :default, "sqlite3://#{db_path}/app.db"

  configure {
    use Rack::Session::Cookie,
      :path   => '/',
      :secret => '${GenerateString}'

    use Rack::Csrf,
      :raise => true,
      :field => '_csrf'
  }

  Dir.glob("#{Dir.pwd}/app/helpers/*.rb")     { |h| require h.chomp }
  Dir.glob("#{Dir.pwd}/app/models/*.rb")      { |m| require m.chomp }
  Dir.glob("#{Dir.pwd}/app/controllers/*.rb") { |c| require c.chomp }

  DataMapper.finalize
  User.auto_migrate!
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gennaro-0.3.1.1 templates/authentication/_class_name_.rb
gennaro-0.3.1 templates/authentication/_class_name_.rb
gennaro-0.3 templates/authentication/_class_name_.rb
gennaro-0.2.1 templates/authentication/_class_name_.rb
gennaro-0.2 templates/authentication/_class_name_.rb
gennaro-0.1.1 templates/authentication/_class_name_.rb
gennaro-0.1 templates/authentication/_class_name_.rb