Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 42 lines (34 sloc) 0.85 kb
c992d6f @wycats Initial commit
authored
1 require "action_pack"
2 require "redcloth"
60d067e @wagenet Preliminary Markdown support
wagenet authored
3 require "maruku"
c992d6f @wycats Initial commit
authored
4
52cd24c Improve handling of source code helpers so they no longer emit <notex…
tomhuda authored
5 require "guides/textile_transformer"
60d067e @wagenet Preliminary Markdown support
wagenet authored
6 require "guides/markdown_extensions"
666c4aa @wycats Some cleanup
authored
7 require "guides/generator"
c992d6f @wycats Initial commit
authored
8
9 module Guides
a4f3c58 @wycats Some cleanup
authored
10 class Error < StandardError
11 def self.status_code(code = nil)
12 define_method(:status_code) { code }
13 end
14 end
15
16 class FormatError < Error; status_code(2) ; end
17
c992d6f @wycats Initial commit
authored
18 class << self
19 def root
20 # TODO: Search for guides.yml
21 File.expand_path(Dir.pwd)
22 end
23
5a1cbe7 @wycats guides preview + tests
authored
24 def meta(reload = false)
25 @meta = nil if reload
26
c992d6f @wycats Initial commit
authored
27 @meta ||= begin
28 if File.exist?("#{root}/guides.yml")
29 YAML.load_file("#{root}/guides.yml")
30 # TODO: Sanity check the output
31 else
32 raise "#{root}/guides.yml was not found"
33 end
34 end
35 end
6325a83 @wagenet Added Guides.config
wagenet authored
36
37 def config(reload = false)
38 meta(reload)['config'] || {}
39 end
c992d6f @wycats Initial commit
authored
40 end
41 end
Something went wrong with that request. Please try again.