Files
news.gitea.happylizard.me/bin/gems/facets-3.1.0/lib/standard/facets/yaml/kernel.rb
T
pizza2d1 4cee170d66
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s
Add bin and edit workflow
2026-09-16 13:11:16 -06:00

30 lines
439 B
Ruby

require 'yaml'
module Kernel
# The Kernel method #yaml is a shortcut to YAML::load.
#
# data = yaml %{
# a: 1
# b: 2
# }
# data #=> {"a"=>1, "b"=>2}
#
def yaml(*args,&blk)
YAML.load(*args,&blk)
end
# As with #to_yaml but removes the header line (i.e. '---') to create
# a "YAML fragment".
#
# @author Trans
#
def to_yamlfrag
y = to_yaml
y.sub!(/---\ */, '')
y
end
end