Module: Yard::Yaml
- Defined in:
- lib/yard/yaml.rb,
lib/yard/yaml/cli.rb,
lib/yard/yaml/tags.rb,
lib/yard/yaml/config.rb,
lib/yard/yaml/plugin.rb,
lib/yard/yaml/emitter.rb,
lib/yard/yaml/version.rb,
lib/yard/yaml/converter.rb,
lib/yard/yaml/discovery.rb,
lib/yard/yaml/templates.rb,
lib/yard/yaml/tag_renderer.rb,
lib/yard/yaml/template_helpers.rb
Defined Under Namespace
Modules: Cli, Discovery, Plugin, TagRenderer, Tags, TemplateHelpers, Templates, Version Classes: Config, Converter, Emitter, Error
Constant Summary collapse
Class Attribute Summary collapse
-
.pages ⇒ Array<Hash>?
readonly
Access collected pages (Phase 3).
Class Method Summary collapse
-
.__reset_state__ ⇒ Object
Test-helper: reset memoized config to defaults (not public API).
-
.__set_pages__(list) ⇒ Object
Internal: set collected pages (used by Plugin during activation).
-
.config ⇒ Yard::Yaml::Config
Access the global configuration for yard-yaml.
-
.configure(overrides = nil) {|cfg| ... } ⇒ Yard::Yaml::Config
Configure the plugin programmatically.
-
.error(message) ⇒ Object
Public: emit an error-level log message (does not raise).
-
.warn(message) ⇒ Object
Public: emit a warning message via YARD logger when available, otherwise stderr.
Class Attribute Details
.pages ⇒ Array<Hash>? (readonly)
Access collected pages (Phase 3). Nil until plugin activation performs discovery.
Each page is a Hash with keys: :path, :html, :title, :description, :meta
37 38 39 |
# File 'lib/yard/yaml.rb', line 37 def pages @pages end |
Class Method Details
.__reset_state__ ⇒ Object
Test-helper: reset memoized config to defaults (not public API)
82 83 84 85 86 87 88 89 |
# File 'lib/yard/yaml.rb', line 82 def __reset_state__ @config = nil @pages = nil if defined?(::Yard::Yaml::Plugin) && ::Yard::Yaml::Plugin.respond_to?(:__reset_state__) ::Yard::Yaml::Plugin.__reset_state__ end nil end |
.__set_pages__(list) ⇒ Object
Internal: set collected pages (used by Plugin during activation)
40 41 42 43 44 |
# File 'lib/yard/yaml.rb', line 40 def __set_pages__(list) @pages = Array(list) mirror_pages_to_registry(@pages) @pages end |
.config ⇒ Yard::Yaml::Config
Access the global configuration for yard-yaml.
Returns a memoized instance. It is safe to mutate via accessors in
controlled contexts (e.g., tests or explicit configuration blocks).
30 31 32 |
# File 'lib/yard/yaml.rb', line 30 def config @config ||= Config.new end |
.configure(overrides = nil) {|cfg| ... } ⇒ Yard::Yaml::Config
Configure the plugin programmatically.
51 52 53 54 55 56 57 |
# File 'lib/yard/yaml.rb', line 51 def configure(overrides = nil) cfg = config cfg.apply(overrides) if overrides && !overrides.empty? yield(cfg) if block_given? mirror_to_registry(cfg) cfg end |
.error(message) ⇒ Object
Public: emit an error-level log message (does not raise).
Uses YARD::Logger.error if available, else falls back to stderr with prefix.
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/yard/yaml.rb', line 69 def error() if defined?(::YARD) && ::YARD.const_defined?(:Logger) begin ::YARD::Logger.instance.error("yard-yaml: #{}") return rescue StandardError # fall back end end Kernel.warn("yard-yaml: ERROR: #{}") end |
.warn(message) ⇒ Object
Public: emit a warning message via YARD logger when available, otherwise stderr.
Prefix is standardized to “yard-yaml: “.
62 63 64 |
# File 'lib/yard/yaml.rb', line 62 def warn() __warn() end |