-
Notifications
You must be signed in to change notification settings - Fork 0
/
environment.rb
executable file
·41 lines (35 loc) · 1.12 KB
/
environment.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require 'rubygems'
require 'dm-core'
require 'dm-timestamps'
require 'dm-validations'
require 'dm-aggregates'
require 'digest/sha1'
require 'dm-migrations'
require 'haml'
require 'ostruct'
require 'sinbook'
require 'sinatra' unless defined?(Sinatra)
require 'sinatra-authentication'
configure do
SiteConfig = OpenStruct.new(
:title => 'hackday 2010',
:author => 'Paul Iutzi, Ari Turetzky',
:url_base => 'http://localhost:4567/'
)
# load models
$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/lib")
Dir.glob("#{File.dirname(__FILE__)}/lib/*.rb") { |lib| require File.basename(lib, '.*') }
DataMapper.setup(:default, (ENV["DATABASE_URL"] || "sqlite3://#{File.expand_path(File.dirname(__FILE__))}/#{Sinatra::Base.environment}.db"))
if File.exist?("facebooker.yml")
env=:production
@@yaml = YAML.load_file("facebooker.yml")[env.to_s]
facebook do
api_key @@yaml['api_key']
secret @@yaml['secret_key']
app_id @@yaml['app_id']
url @@yaml['canvas_page_name']
callback @@yaml['callback_url']
symbolize_keys true
end
end
end