Module: RSpecDocumentation
- Defined in:
- lib/rspec_documentation.rb,
lib/rspec_documentation/spec.rb,
lib/rspec_documentation/util.rb,
lib/rspec_documentation/rspec.rb,
lib/rspec_documentation/summary.rb,
lib/rspec_documentation/document.rb,
lib/rspec_documentation/page_tree.rb,
lib/rspec_documentation/formatters.rb,
lib/rspec_documentation/html_element.rb,
lib/rspec_documentation/configuration.rb,
lib/rspec_documentation/documentation.rb,
lib/rspec_documentation/rspec/failure.rb,
lib/rspec_documentation/formatters/xml.rb,
lib/rspec_documentation/formatters/ansi.rb,
lib/rspec_documentation/formatters/html.rb,
lib/rspec_documentation/formatters/json.rb,
lib/rspec_documentation/formatters/ruby.rb,
lib/rspec_documentation/formatters/yaml.rb,
lib/rspec_documentation/page_collection.rb,
lib/rspec_documentation/parsed_document.rb,
lib/rspec_documentation/javascript_bundle.rb,
lib/rspec_documentation/markdown_renderer.rb,
lib/rspec_documentation/page_tree_element.rb,
lib/rspec_documentation/stylesheet_bundle.rb,
lib/rspec_documentation/project_initialization.rb
Overview
Internal module used by RSpec::Documentation to run examples and write output into an HTML document.
Defined Under Namespace
Modules: Formatters, RSpec
Classes: Configuration, Document, Documentation, Error, HtmlElement, JavascriptBundle, MarkdownRenderer, MissingFileError, PageCollection, PageTree, PageTreeElement, ParsedDocument, ProjectInitialization, Spec, StylesheetBundle, Summary, Util
Class Method Summary
collapse
Class Method Details
.configuration ⇒ Object
77
78
79
|
# File 'lib/rspec_documentation.rb', line 77
def self.configuration
@configuration ||= RSpecDocumentation::Configuration.new
end
|
73
74
75
|
# File 'lib/rspec_documentation.rb', line 73
def self.configure
yield configuration
end
|
.context {|configuration.context| ... } ⇒ Object
68
69
70
71
|
# File 'lib/rspec_documentation.rb', line 68
def self.context
yield configuration.context if block_given?
configuration.context
end
|
.hook(name) ⇒ Object
64
65
66
|
# File 'lib/rspec_documentation.rb', line 64
def self.hook(name)
configuration.hooks.fetch(name, nil)&.call
end
|
.root ⇒ Object
49
50
51
|
# File 'lib/rspec_documentation.rb', line 49
def self.root
Pathname.new(File.dirname(__dir__))
end
|
.template(name, format = :html) ⇒ Object
53
54
55
56
57
58
|
# File 'lib/rspec_documentation.rb', line 53
def self.template(name, format = :html)
ERB.new(
root.join('lib/templates', "#{name}.#{format}.erb").read,
eoutvar: "@eout#{SecureRandom.hex(16)}"
)
end
|
.theme(name) ⇒ Object
60
61
62
|
# File 'lib/rspec_documentation.rb', line 60
def self.theme(name)
ERB.new(root.join('lib/templates/themes', "#{name}.css").read).result(binding)
end
|