nestedtext 3.1.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8601948a65f9660f63e8f84838452cd440219f3b188c09c0418d0dd557f1bfc
4
- data.tar.gz: 8dd84452b7610602be994fb39d2d4c54e9c1912e901950257bc5db890ca6f92c
3
+ metadata.gz: 1e19886916af03f3d5ef28b374957b529721fc1302aefa86d37483052dfcc96e
4
+ data.tar.gz: 7b0b78e029f5138341ea101567d2668c97a9681bef2f2830282ad00341b80c29
5
5
  SHA512:
6
- metadata.gz: b94b31da3ac93c342a635d3ad7cc719af5c4f24567214aaf492ecc3db8153bbf744dec6525b46f7303f6ea9f6b5bf8639725e447d54854570a5cc59a41c39b9f
7
- data.tar.gz: 2de78ff35eb164a9463160aad408ad44293a325a17b4d51881c6f8e48539b2fef2c304e4ebf58c99dc27ea716ff3e50d242b6f5a61c815f691e679d347fc67b6
6
+ metadata.gz: 83a89a05ec0fba9ad2a397b16454b93de78751dda15d369b2a0704fc0e87bd426741b872a58fa236ff7814953eb6faa1a0681ac755c5eed4244560925863bfa5
7
+ data.tar.gz: 45e701d977422c34fc3ef2923b4a54c2bcb617fe973a867c343b7e16df94607ae0f2b5b22e515824e2245cdb4289b11fc88a11bdf12cc420e7552517c89e681a
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [3.2.0] - 2022-01-27
10
+ ### Changed
11
+ - Switch from rdoc formatting syntax to Markdown with Redcarpet to be able to render README.md properly.
12
+
9
13
  ## [3.1.0] - 2022-01-27
10
14
  ### Changed
11
15
  - Switch from rdoc to YARD to match rubydoc.info that is used automatically for Gems uploaded to rubygems.org.
@@ -7,14 +7,22 @@ require "nestedtext/encode_helpers"
7
7
  # Or both: add encoding/decoding of more native classes, and allow decoding + applying a schema with 3rd party.
8
8
  # Or encourage using Marshal from core?
9
9
 
10
+ # Extended with the `#to_nt` method.
10
11
  class String include NestedText::NTEncodeMixin; end
12
+
13
+ # Extended with the `#to_nt` method.
11
14
  class Array include NestedText::NTEncodeMixin; end
15
+
16
+ # Extended with the `#to_nt` method.
12
17
  class Hash include NestedText::NTEncodeMixin; end
13
18
 
19
+ # Extended with NestedText support.
14
20
  class NilClass
15
21
  include NestedText::NTEncodeMixin
16
22
 
23
+ # Adds support for encoding and decoding nil.
17
24
  def self.nt_create(_data) = nil
18
25
 
26
+ # Adds support for encoding and decoding nil.
19
27
  def encode_nt_with() = ""
20
28
  end
@@ -10,7 +10,7 @@ module NestedText
10
10
  # Decode a NestedText string to Ruby objects.
11
11
  #
12
12
  # @param ntstring [String] The string containing NestedText to be decoded.
13
- # @param top_class [String] Force the top level returned object to be of this type. Supported values are +Object+, +Array+, +Hash+ and +String+.
13
+ # @param top_class [String] Force the top level returned object to be of this type. Supported values are `Object`, `Array`, `Hash` and `String`.
14
14
  # @param strict [Boolean] If strict mode should be used.
15
15
  #
16
16
  # @return [Object, nil] The parsed object.
@@ -25,13 +25,13 @@ module NestedText
25
25
  # Decode a NestedText stored in a given file.
26
26
  #
27
27
  # @param filename [String] The file path to read NestedText to decode from.
28
- # @param top_class [String] Force the top level returned object to be of this type. Supported values are +Object+, +Array+, +Hash+ and +String+.
28
+ # @param top_class [String] Force the top level returned object to be of this type. Supported values are `Object`, `Array`, `Hash` and `String`.
29
29
  # @param strict [Boolean] If strict mode should be used.
30
30
  #
31
31
  # @return [Object, nil] The parsed object.
32
32
  #
33
33
  # @raise [NestedText::Error] if anything went wrong.
34
- # @raise [IOError] on issue opening +filename+ for reading in text mode.
34
+ # @raise [IOError] on issue opening `filename` for reading in text mode.
35
35
  def self.load_file(filename, top_class: Object, strict: false)
36
36
  raise Errors::WrongInputTypeError.new([String], filename) unless !filename.nil? && filename.is_a?(String)
37
37
 
@@ -13,7 +13,7 @@ module NestedText
13
13
  #
14
14
  # @return A String containing NestedText data.
15
15
  # @raise [NestedText::Error] if anything went wrong.
16
- # @raise Whatever the +io+ can raise, if supplied.
16
+ # @raise Whatever the `io` can raise, if supplied.
17
17
  def self.dump(obj, io: nil, indentation: 4, strict: false)
18
18
  raise Errors::DumpBadIOError, io unless io.nil? || io.respond_to?(:write) && io.respond_to?(:fsync)
19
19
 
@@ -28,15 +28,15 @@ module NestedText
28
28
 
29
29
  # Encode a Ruby object to a NestedText file.
30
30
 
31
- # Apart from +filename+, this method behaves exactly like dump.
31
+ # Apart from `filename`, this method behaves exactly like dump.
32
32
  #
33
33
  # @param (see dump)
34
- # @param filename [String] The file path to write the NestedText result to. The conventional file extension is +.nt+.
34
+ # @param filename [String] The file path to write the NestedText result to. The conventional file extension is `.nt`.
35
35
  #
36
36
  #
37
37
  # @return (see dump)
38
38
  # @raise (see dump)
39
- # @raise [IOError] on issues opening the +filename+ for writing in text mode.
39
+ # @raise [IOError] on issues opening the `filename` for writing in text mode.
40
40
  #
41
41
  def self.dump_file(obj, filename, **kwargs)
42
42
  raise Errors::DumpFileBadPathError, filename unless filename.is_a? String
@@ -2,5 +2,5 @@
2
2
 
3
3
  module NestedText
4
4
  # The version of this library.
5
- VERSION = "3.1.0"
5
+ VERSION = "3.2.0"
6
6
  end
data/lib/nestedtext.rb CHANGED
@@ -8,7 +8,7 @@ require_relative "nestedtext/error"
8
8
  require_relative "nestedtext/version"
9
9
 
10
10
  ##
11
- # = NestedText
11
+ # # NestedText
12
12
  # The main module in this library to use.
13
13
  #
14
14
  # See {file:README.md} for documentation on Types, Strict Mode and Custom Classes.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nestedtext
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Westrup