Module: Schnitzelpress

Defined in:
lib/schnitzelpress.rb,
lib/schnitzelpress/app.rb,
lib/schnitzelpress/cli.rb,
lib/schnitzelpress/env.rb,
lib/schnitzelpress/post.rb,
lib/schnitzelpress/config.rb,
lib/schnitzelpress/static.rb,
lib/schnitzelpress/helpers.rb,
lib/schnitzelpress/version.rb,
lib/schnitzelpress/actions/auth.rb,
lib/schnitzelpress/actions/blog.rb,
lib/schnitzelpress/actions/admin.rb,
lib/schnitzelpress/cache_control.rb,
lib/schnitzelpress/actions/assets.rb,
lib/schnitzelpress/markdown_renderer.rb

Defined Under Namespace

Modules: Actions, CacheControl, Helpers Classes: App, Cli, Config, JavascriptPacker, MarkdownRenderer, Post, Static

Constant Summary collapse

VERSION =
"0.2.1"

Class Method Summary collapse

Class Method Details

.envObject



2
3
4
# File 'lib/schnitzelpress/env.rb', line 2

def self.env
  (ENV['RACK_ENV'] || 'development').inquiry
end

.init!Object



45
46
47
48
49
50
51
52
53
# File 'lib/schnitzelpress.rb', line 45

def init!
  # Mongoid.load!("./config/mongo.yml")
  if mongo_uri = ENV['MONGOLAB_URI'] || ENV['MONGOHQ_URL'] || ENV['MONGO_URL']
    self.mongo_uri = mongo_uri
  else
    raise "Please set MONGO_URL, MONGOHQ_URL or MONGOLAB_URI to your MongoDB connection string."
  end
  Schnitzelpress::Post.create_indexes
end

.mongo_uri=(uri) ⇒ Object



39
40
41
42
43
# File 'lib/schnitzelpress.rb', line 39

def mongo_uri=(uri)
  Mongoid::Config.from_hash("uri" => uri)
  Schnitzelpress::Post.create_indexes
  @@mongo_uri = uri
end

.omnomnom!Object



55
56
57
58
# File 'lib/schnitzelpress.rb', line 55

def omnomnom!
  init!
  App.with_local_files
end