class RspecApiDocs::Renderer::SlateRenderer

Attributes

resources[R]

Public Class Methods

new(resources) click to toggle source
# File lib/rspec_api_docs/formatter/renderer/slate_renderer.rb, line 6
def initialize(resources)
  @resources = resources
end

Public Instance Methods

render() click to toggle source
# File lib/rspec_api_docs/formatter/renderer/slate_renderer.rb, line 10
def render
  FileUtils.mkdir_p output_file.dirname

  File.open(output_file, 'w') do |f|
    f.write ERB.new(File.read(template), nil, '-').result(binding)
  end
end

Private Instance Methods

output_file() click to toggle source
# File lib/rspec_api_docs/formatter/renderer/slate_renderer.rb, line 20
def output_file
  Pathname.new(RspecApiDocs.configuration.output_dir) + 'index.html.md'
end
template() click to toggle source
# File lib/rspec_api_docs/formatter/renderer/slate_renderer.rb, line 24
def template
  File.expand_path('../slate_renderer/slate_index.html.md.erb', __FILE__)
end