Class: Docs::Project

Inherits:
Thor
  • Object
show all
Includes:
ExampleHelper, Thor::Actions
Defined in:
lib/docs/project.rb

Instance Method Summary collapse

Methods included from ExampleHelper

#example, #examples

Instance Method Details

#buildObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/docs/project.rb', line 20

def build
  @examples = {:source => {}, :output => {}}
  @erb_environment = ERBEnvironment.new
  @erb = ERBRenderer.new(@erb_environment)
  @markdown = markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true)

  @erb_environment.config = @config = Config.new 
  ['temp', 'output'].each do |dir|
    dir = @config.directories[dir]
    remove_file dir if File.exists? dir
    empty_directory dir
  end

  load_examples 
  build_docs
  copy_assets
end

#setupObject



15
16
17
# File 'lib/docs/project.rb', line 15

def setup
  directory('template', '.')
end

#specObject



39
40
41
42
# File 'lib/docs/project.rb', line 39

def spec
  require 'rspec/core'
  RSpec::Core::Runner.autorun
end