Sha256: aa47678ed6a1e9b592f82e47f2bc756348f5065e0f5acf009d8f2d8962d034a1

Contents?: true

Size: 567 Bytes

Versions: 8

Compression:

Stored size: 567 Bytes

Contents

require_relative './config/environment'

if ActiveRecord::Migrator.needs_migration?
  raise 'Migrations are pending. Run `rake db:migrate` to resolve the issue.'
end

# auto-add controllers
Dir[File.join(File.dirname(__FILE__), "app/controllers", "*.rb")].collect {|file| File.basename(file).split(".")[0] }.reject {|file| file == "application_controller" }.each do |file|
  string_class_name = file.split('_').collect { |w| w.capitalize }.join
  class_name = Object.const_get(string_class_name)
  use class_name
end
use Rack::MethodOverride
run ApplicationController

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
learn-generate-1.0.16 lib/templates/sinatra-mvc/config.ru
learn-generate-1.0.15 lib/templates/sinatra-mvc/config.ru
learn-generate-1.0.14 lib/templates/sinatra-mvc/config.ru
learn-generate-1.0.13 lib/templates/sinatra-mvc/config.ru
learn-generate-1.0.12 lib/templates/sinatra-mvc/config.ru
learn-generate-1.0.11 lib/templates/sinatra-mvc/config.ru
learn-generate-1.0.1 lib/templates/sinatra-mvc/config.ru
learn-generate-1.0.0 lib/templates/sinatra-mvc/config.ru