psych-pure 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8599351cebdf6abf0c3438762b7f56a0110fafda0a4c857618305085425805d9
4
+ data.tar.gz: c9975fe7570058d7aae9a64a46601e8720d46679dfa538290ff45fecf3b3842e
5
+ SHA512:
6
+ metadata.gz: c964ce5739215506401fd0c7eca965932a54adb4f3c6e5d56f89a5bafe00d98b71b7fe9f8621adc8e5eb403a23a2b7813cee2bf5d88006929ff4d47c5ed5500d
7
+ data.tar.gz: 55ead208f357b2f52267f505610815fc248ca8e8fbbc248d57ad8a6c7c40d56f7fadea28f7e1a13bbef18d47fe09783076c1d5ed73c87c4f2a36a50c5541bdc3
data/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.0] - 2020-10-08
10
+
11
+ ### Added
12
+
13
+ - 🎉 Initial release. 🎉
14
+
15
+ [unreleased]: https://github.com/kddnewton/psych-pure/compare/v0.1.0...HEAD
16
+ [0.1.0]: https://github.com/kddnewton/psych-pure/compare/24de62...v0.1.0
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at kddnewton@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [https://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: https://contributor-covenant.org
74
+ [version]: https://contributor-covenant.org/version/1/4/
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025-present Kevin Newton
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # Psych::Pure
2
+
3
+ [![Build Status](https://github.com/kddnewton/psych-pure/workflows/Main/badge.svg)](https://github.com/kddnewton/psych-pure/actions)
4
+ [![Gem Version](https://img.shields.io/gem/v/psych-pure.svg)](https://rubygems.org/gems/psych-pure)
5
+
6
+ `Psych::Pure` is a YAML library written in Ruby. It functions as an extension of `Psych`, the main CRuby YAML library. The circumstances under which you may choose this library are:
7
+
8
+ * You have some issue installing `libyaml` and/or you want to avoid a native dependency.
9
+ * You have a need to parse comments from YAML source and/or to write comments out to YAML source.
10
+ * You need to parse exactly according to the YAML 1.2 spec.
11
+
12
+ Note that this library comes with a couple of caveats:
13
+
14
+ * It will only parse YAML 1.2. Other previous versions are unsupported.
15
+ * It will only parse UTF-8 strings. Other unicode encodings are unsupported.
16
+ * The parser is significantly slower and less efficient than `Psych::Parser`.
17
+
18
+ ## Installation
19
+
20
+ Add this line to your application's Gemfile:
21
+
22
+ ```ruby
23
+ gem "psych-pure"
24
+ ```
25
+
26
+ And then execute:
27
+
28
+ $ bundle install
29
+
30
+ Or install it yourself as:
31
+
32
+ $ gem install psych-pure
33
+
34
+ ## Usage
35
+
36
+ `Psych::Pure` largely mirrors the various `Psych` APIs. The main entrypoints are:
37
+
38
+ * `Psych::Pure.parse(source)` - parses a YAML string into a YAML syntax tree
39
+ * `Psych::Pure.load(source)` - loads a YAML string into a Ruby object
40
+ * `Psych::Pure.dump(object)` - dumps a Ruby object to a YAML string
41
+
42
+ All of the various `parse` APIs come with the additional `comments:` keyword option. This option tells the parser to parse out comments and attach them to the resulting tree. Nodes in the tree are then responsible for maintaining their own leading and trailing comments.
43
+
44
+ All of the various `load` APIs also come with the additional `comments:` keyword option. This also gets fed into the parser. Because `load` is responsible for loading Ruby objects, the comments are then attached to the loaded objects via `Psych::Pure::YAMLCommentsDelegator`, which is a `SimpleDelegator` that wraps the objects and stores the leading and trailing comments. Those objects are then taken into account in the various `dump` APIs to dump out the comments as well. For example:
45
+
46
+ ```ruby
47
+ result = Psych::Pure.load("- a # comment1\n- c # comment2\n", comments: true)
48
+ # => ["a", "c"]
49
+
50
+ result.insert(1, "b")
51
+ # => ["a", "b", "c"]
52
+
53
+ puts Psych::Pure.dump(result)
54
+ # ---
55
+ # - a # comment1
56
+ # - b
57
+ # - c # comment2
58
+ ```
59
+
60
+ ## Contributing
61
+
62
+ Bug reports and pull requests are welcome on GitHub at https://github.com/kddnewton/psych-pure.
63
+
64
+ ## License
65
+
66
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Psych
4
+ module Pure
5
+ VERSION = "0.1.0"
6
+ end
7
+ end