class Stormy::Stores::Base

Public Class Methods

new(app) click to toggle source
# File lib/stormy/stores/base.rb, line 7
def initialize(app)
  @app = app
end

Public Instance Methods

content(category,key) click to toggle source

find the content that matches a category and a key

# File lib/stormy/stores/base.rb, line 19
def content(category,key)
end
content_list(category) click to toggle source

get all the content that matches a category

# File lib/stormy/stores/base.rb, line 23
def content_list(category)
end
extract(key,string, path_meta = {}) click to toggle source
# File lib/stormy/stores/base.rb, line 29
def extract(key,string, path_meta = {})
  return {} unless string.present?

  details = {}
  if(string =~ /^(---\w*$\n.*?)^---\w*$\n(.*)/m)
    begin 
      details = YAML.load($1).symbolize_keys
      details[:body] = $2
    rescue Exception => e
      raise "Error Parsing YAML #{key}: #{e.to_s}"
    end
  else
    details[:body] = string
  end

  details.merge!(path_meta)
  details[:permalink] = Stormy::Template.extract_segment(key)
  details[:key] = key
  details
end
extract_content(body) click to toggle source
# File lib/stormy/stores/base.rb, line 26
def extract_content(body)
end
layout(key) click to toggle source
# File lib/stormy/stores/base.rb, line 15
def layout(key)
end
page(key) click to toggle source

find the page that matches a key

# File lib/stormy/stores/base.rb, line 12
def page(key)
end