Module: Psych::Merge::ProviderExtension
- Defined in:
- lib/psych/merge/provider_extension.rb
Overview
Portable native Psych AST facts retained across workflow host boundaries.
Constant Summary collapse
- SCHEMA =
'structuredmerge.extension/ruby-psych/v1'- CAPABILITIES =
%w[aliases anchors documents scalar-styles tags].freeze
Class Method Summary collapse
Class Method Details
.call(analysis: nil, tree: nil) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/psych/merge/provider_extension.rb', line 12 def call(analysis: nil, tree: nil, **) native_tree = analysis&.ast || tree&.inner_tree raise ArgumentError, 'Psych provider extension requires an analysis or TreeHaver tree' unless native_tree { schema: SCHEMA, namespace: 'ruby-psych', capabilities: CAPABILITIES, payload: { ast: NativeProjection.attribute_tree(native_tree), semantic: NativeProjection.semantic(native_tree), native_tree_visibility: 'provider_internal' } } end |