Module: Junebug

Includes:
Camping::Session
Defined in:
lib/junebug.rb,
lib/junebug/config.rb,
lib/junebug/generator.rb

Defined Under Namespace

Modules: Config, Controllers, Generator, Models, Views

Class Method Summary collapse

Class Method Details

.configObject



32
33
34
# File 'lib/junebug.rb', line 32

def self.config
  @config ||= YAML.load(File.read('config.yml'))
end

.connectObject



26
27
28
29
30
# File 'lib/junebug.rb', line 26

def self.connect
  Junebug::Models::Base.establish_connection :adapter => 'sqlite3', :database => 'junebug.db'
  Junebug::Models::Base.logger = Logger.new('junebug.log')
  Junebug::Models::Base.threaded_connections=false
end

.createObject



21
22
23
24
# File 'lib/junebug.rb', line 21

def self.create
  Junebug::Models.create_schema :assume => (Junebug::Models::Page.table_exists? ? 1.0 : 0.0)
  Camping::Models::Session.create_schema
end

.startpageObject



36
37
38
# File 'lib/junebug.rb', line 36

def self.startpage
  "#{Junebug.config['url']}/#{Junebug.config['startpage']}"
end