Socket
Book a DemoInstallSign in
Socket

yaml_extensions

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yaml_extensions

0.1.0
bundlerRubygems
Version published
Maintainers
1
Created
Source
  • YamlExtensions :PROPERTIES: :CUSTOM_ID: yamlextensions :END:

Extensions to make YAML even more useful.

** Installation :PROPERTIES: :CUSTOM_ID: installation :END:

Add this line to your application's Gemfile:

#+BEGIN_SRC ruby gem 'yaml_extensions' #+END_SRC

And then execute:

#+BEGIN_EXAMPLE $ bundle install #+END_EXAMPLE

Or install it yourself as:

#+BEGIN_EXAMPLE $ gem install yaml_extensions #+END_EXAMPLE

** Usage :PROPERTIES: :CUSTOM_ID: usage :END:

Just require =yaml_extensions=. For now this will [[https://twitter.com/dhh/status/813075241236762624][freedom patch]] the YAML module to extend its functionality.

#+begin_src ruby require 'yaml_extensions' #+end_src

Deep Merge any key-value-list by replacing YAML's regular Merge Key =<<= with =<<<=. Example:

#+begin_src yaml defaults: &DEFAULTS hello: world this: is: even: deeper

main: <<<: *DEFAULTS this: is: somewhat: deep #+end_src

will be interpreted as

#+begin_src yaml defaults: hello: world this: is: even: deeper

main: this: is: somewhat: deep even: deeper hello: world #+end_src

This does not acutally patch the parser, but runs a transformation on the already parse data structure. Multiple deep merges can be achieved by appending digits to =<<<=. Exmaple:

#+begin_src yaml defaults: &DEFAULTS hello: world this: is: even: deeper

overrides: &OVERRIDES this: is: even: deeper, i tell you

main: <<<1: *DEFAULTS <<<2: *OVERRIDES this: is: somewhat: deep #+end_src

will be interpreted as

#+begin_src yaml defaults: hello: world this: is: even: deeper

overrides: this: is: even: deeper, i tell you

main: this: is: somewhat: deep even: deeper, i tell you hello: world #+end_src

** Development :PROPERTIES: :CUSTOM_ID: development :END:

After checking out the repo, run =bin/setup= to install dependencies. Then, run =rake test= to run the tests. You can also run =bin/console= for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run =bundle exec rake install=. To release a new version, update the version number in =version.rb=, and then run =bundle exec rake release=, which will create a git tag for the version, push git commits and tags, and push the =.gem= file to [[https://rubygems.org][rubygems.org]].

** Contributing :PROPERTIES: :CUSTOM_ID: contributing :END:

Bug reports and pull requests are welcome on GitHub at https://github.com/200ok-ch/yaml_extensions. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [[https://github.com/branch14/yaml_extensions/blob/master/CODE_OF_CONDUCT.md][code of conduct]].

** License :PROPERTIES: :CUSTOM_ID: license :END:

The gem is available as open source under the terms of the [[https://opensource.org/licenses/MIT][MIT License]].

** Code of Conduct :PROPERTIES: :CUSTOM_ID: code-of-conduct :END:

Everyone interacting in the YamlExtensions project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [[https://github.com/200ok-ch/yaml_extensions/blob/master/CODE_OF_CONDUCT.md][code of conduct]].

FAQs

Package last updated on 23 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.