Module: Guides

Defined in:
lib/guides.rb,
lib/guides/cli.rb,
lib/guides/new.rb,
lib/guides/helpers.rb,
lib/guides/indexer.rb,
lib/guides/preview.rb,
lib/guides/version.rb,
lib/guides/generator.rb,
lib/guides/levenshtein.rb,
lib/guides/w3c_validator.rb,
lib/guides/textile_transformer.rb

Defined Under Namespace

Modules: HTMLFormatter, Helpers, Levenshtein Classes: App, CLI, Error, FormatError, Generator, Indexer, New, Preview, TextileTransformer, Validator

Constant Summary collapse

VERSION =
"0.7.2"

Class Method Summary collapse

Class Method Details

.config(reload = false) ⇒ Object



37
38
39
# File 'lib/guides.rb', line 37

def config(reload = false)
  meta(reload)['config'] || {}
end

.meta(reload = false) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/guides.rb', line 24

def meta(reload = false)
  @meta = nil if reload

  @meta ||= begin
    if File.exist?("#{root}/guides.yml")
      YAML.load_file("#{root}/guides.yml")
      # TODO: Sanity check the output
    else
      raise "#{root}/guides.yml was not found"
    end
  end
end

.rootObject



19
20
21
22
# File 'lib/guides.rb', line 19

def root
  # TODO: Search for guides.yml
  File.expand_path(Dir.pwd)
end