nestedtext 1.2.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/CONTRIBUTING.md +1 -1
- data/README.md +210 -30
- data/SECURITY.md +2 -2
- data/lib/nestedtext/core_ext.rb +6 -5
- data/lib/nestedtext/core_ext_internal.rb +1 -1
- data/lib/nestedtext/decode.rb +23 -3
- data/lib/nestedtext/dumper.rb +15 -17
- data/lib/nestedtext/encode.rb +25 -15
- data/lib/nestedtext/encode_helpers.rb +7 -19
- data/lib/nestedtext/error.rb +8 -0
- data/lib/nestedtext/{errors.rb → errors_internal.rb} +28 -33
- data/lib/nestedtext/parser.rb +34 -34
- data/lib/nestedtext/scanners.rb +4 -5
- data/lib/nestedtext/version.rb +2 -1
- data/lib/nestedtext.rb +9 -2
- data/nestedtext.gemspec +4 -4
- metadata +10 -16
- data/.editorconfig +0 -24
- data/.gitignore +0 -21
- data/.rubocop.yml +0 -143
- data/.ruby-version +0 -1
- data/Gemfile +0 -27
- data/OSSMETADATA +0 -1
@@ -4,19 +4,14 @@ require "word_wrap"
|
|
4
4
|
require "word_wrap/core_ext"
|
5
5
|
|
6
6
|
require "nestedtext/constants"
|
7
|
+
require "nestedtext/error"
|
7
8
|
|
8
9
|
module NestedText
|
9
|
-
# Top level error for clients to rescue on.
|
10
|
-
class Error < StandardError
|
11
|
-
private_class_method :new
|
12
|
-
end
|
13
|
-
|
14
10
|
module Errors
|
15
11
|
class InternalError < Error
|
16
|
-
public_class_method :new # Prevent
|
12
|
+
public_class_method :new # Prevent users from instansiating.
|
17
13
|
end
|
18
14
|
|
19
|
-
# TODO: rename all Subclasses to ParseXError, just like for Dump
|
20
15
|
class ParseError < InternalError
|
21
16
|
attr_reader :lineno, :colno, :message_raw
|
22
17
|
|
@@ -54,68 +49,68 @@ module NestedText
|
|
54
49
|
end
|
55
50
|
end
|
56
51
|
|
57
|
-
class
|
52
|
+
class ParseLineTagUnknownError < ParseError
|
58
53
|
def initialize(line, tag)
|
59
54
|
super(line, line.indentation, "The Line tag #{tag} is not among the allowed ones #{Line::ALLOWED_LINE_TAGS}")
|
60
55
|
end
|
61
56
|
end
|
62
57
|
|
63
|
-
class
|
58
|
+
class ParseLineTagNotDetectedError < ParseError
|
64
59
|
def initialize(line)
|
65
60
|
super(line, line.indentation, "unrecognized line.")
|
66
61
|
end
|
67
62
|
end
|
68
63
|
|
69
|
-
class
|
64
|
+
class ParseLineTypeExpectedListItemError < ParseError
|
70
65
|
def initialize(line)
|
71
66
|
super(line, line.indentation, "expected list item.")
|
72
67
|
end
|
73
68
|
end
|
74
69
|
|
75
|
-
class
|
70
|
+
class ParseMultilineKeyNoValueError < ParseError
|
76
71
|
def initialize(line)
|
77
72
|
super(line, line.indentation, "multiline key requires a value.")
|
78
73
|
end
|
79
74
|
end
|
80
75
|
|
81
|
-
class
|
76
|
+
class ParseInlineDictSyntaxError < ParseError
|
82
77
|
def initialize(line, colno, wrong_char)
|
83
78
|
super(line, line.indentation + colno, "expected ‘,’ or ‘}’, found ‘#{wrong_char}’.")
|
84
79
|
end
|
85
80
|
end
|
86
81
|
|
87
|
-
class
|
82
|
+
class ParseInlineDictKeySyntaxError < ParseError
|
88
83
|
def initialize(line, colno, wrong_char)
|
89
84
|
super(line, line.indentation + colno, "expected ‘:’, found ‘#{wrong_char}’.")
|
90
85
|
end
|
91
86
|
end
|
92
87
|
|
93
|
-
class
|
88
|
+
class ParseInlineMissingValueError < ParseError
|
94
89
|
def initialize(line, colno)
|
95
90
|
super(line, line.indentation + colno, "expected value.")
|
96
91
|
end
|
97
92
|
end
|
98
93
|
|
99
|
-
class
|
94
|
+
class ParseInlineListSyntaxError < ParseError
|
100
95
|
def initialize(line, colno, wrong_char)
|
101
96
|
super(line, line.indentation + colno, "expected ‘,’ or ‘]’, found ‘#{wrong_char}’.")
|
102
97
|
end
|
103
98
|
end
|
104
99
|
|
105
|
-
class
|
100
|
+
class ParseInlineNoClosingDelimiterError < ParseError
|
106
101
|
def initialize(line, colno)
|
107
102
|
super(line, line.indentation + colno, "line ended without closing delimiter.")
|
108
103
|
end
|
109
104
|
end
|
110
105
|
|
111
|
-
class
|
106
|
+
class ParseInlineExtraCharactersAfterDelimiterError < ParseError
|
112
107
|
def initialize(line, colno, extra_chars)
|
113
108
|
character_str = extra_chars.length > 1 ? "characters" : "character"
|
114
109
|
super(line, line.indentation + colno, "extra #{character_str} after closing delimiter: ‘#{extra_chars}’.")
|
115
110
|
end
|
116
111
|
end
|
117
112
|
|
118
|
-
class
|
113
|
+
class ParseInvalidIndentationError < ParseError
|
119
114
|
def initialize(line, ind_exp)
|
120
115
|
prev_line = line.prev
|
121
116
|
if prev_line.nil? && ind_exp == 0
|
@@ -137,19 +132,19 @@ module NestedText
|
|
137
132
|
end
|
138
133
|
end
|
139
134
|
|
140
|
-
class
|
135
|
+
class ParseLineTypeNotExpectedError < ParseError
|
141
136
|
def initialize(line, type_exps, type_act)
|
142
137
|
super(line, line.indentation, "The current line was detected to be #{type_act}, but we expected to see any of [#{type_exps.join(", ")}] here.")
|
143
138
|
end
|
144
139
|
end
|
145
140
|
|
146
|
-
class
|
141
|
+
class ParseLineTypeExpectedDictItemError < ParseError
|
147
142
|
def initialize(line)
|
148
143
|
super(line, line.indentation, "expected dictionary item.")
|
149
144
|
end
|
150
145
|
end
|
151
146
|
|
152
|
-
class
|
147
|
+
class ParseInvalidIndentationCharError < ParseError
|
153
148
|
def initialize(line)
|
154
149
|
printable_char = line.content[0].dump.gsub(/"/, "")
|
155
150
|
|
@@ -165,19 +160,19 @@ module NestedText
|
|
165
160
|
end
|
166
161
|
end
|
167
162
|
|
168
|
-
class
|
163
|
+
class ParseDictDuplicateKeyError < ParseError
|
169
164
|
def initialize(line)
|
170
165
|
super(line, line.indentation, "duplicate key: #{line.attribs["key"]}.")
|
171
166
|
end
|
172
167
|
end
|
173
168
|
|
174
|
-
class
|
169
|
+
class ParseCustomClassNotFoundError < ParseError
|
175
170
|
def initialize(line, class_name)
|
176
171
|
super(line, line.indentation, "Detected an encode custom class #{class_name} however we can't find it, so it can't be deserialzied.")
|
177
172
|
end
|
178
173
|
end
|
179
174
|
|
180
|
-
class
|
175
|
+
class ParseCustomClassNoCreateMethodError < ParseError
|
181
176
|
def initialize(line, class_name)
|
182
177
|
super(line, line.indentation, "Detected an encode custom class #{class_name} but it does not have a #nt_create method, so it can't be deserialzied.")
|
183
178
|
end
|
@@ -185,13 +180,13 @@ module NestedText
|
|
185
180
|
|
186
181
|
class AssertionError < InternalError; end
|
187
182
|
|
188
|
-
class
|
183
|
+
class AssertionLineScannerIsEmptyError < AssertionError
|
189
184
|
def initialize
|
190
185
|
super("There is no more input to consume. You should have checked this with #empty? before calling.")
|
191
186
|
end
|
192
187
|
end
|
193
188
|
|
194
|
-
class
|
189
|
+
class AssertionInlineScannerIsEmptyError < AssertionError
|
195
190
|
def initialize
|
196
191
|
super("There is no more input to consume. You should have checked this with #empty? before calling.")
|
197
192
|
end
|
@@ -216,13 +211,13 @@ module NestedText
|
|
216
211
|
end
|
217
212
|
end
|
218
213
|
|
219
|
-
class
|
214
|
+
class DumpCyclicReferencesDetectedError < DumpError
|
220
215
|
def initialize(culprit)
|
221
216
|
super(culprit, "cyclic reference found: cannot be dumped.")
|
222
217
|
end
|
223
218
|
end
|
224
219
|
|
225
|
-
class
|
220
|
+
class DumpHashKeyStrictStringError < DumpError
|
226
221
|
def initialize(obj)
|
227
222
|
super(obj, "keys must be strings.")
|
228
223
|
end
|
@@ -230,9 +225,9 @@ module NestedText
|
|
230
225
|
|
231
226
|
def self.raise_unrecognized_line(line)
|
232
227
|
# [[:space:]] include all Unicode spaces e.g. non-breakable space which \s does not.
|
233
|
-
raise
|
228
|
+
raise ParseInvalidIndentationCharError, line if line.content.chr =~ /[[:space:]]/
|
234
229
|
|
235
|
-
raise
|
230
|
+
raise ParseLineTagNotDetectedError, line
|
236
231
|
end
|
237
232
|
|
238
233
|
class UnsupportedTopLevelTypeError < InternalError
|
@@ -247,19 +242,19 @@ module NestedText
|
|
247
242
|
end
|
248
243
|
end
|
249
244
|
|
250
|
-
class
|
245
|
+
class TopLevelTypeMismatchParsedTypeError < InternalError
|
251
246
|
def initialize(class_exp, class_act)
|
252
247
|
super("The requested top level class #{class_exp.name} is not the same as the actual parsed top level class #{class_act}.")
|
253
248
|
end
|
254
249
|
end
|
255
250
|
|
256
|
-
class
|
251
|
+
class DumpBadIOError < InternalError
|
257
252
|
def initialize(io)
|
258
253
|
super("When giving the io argument, it must be of type IO (respond to #write, #fsync). Given: #{io.class.name}")
|
259
254
|
end
|
260
255
|
end
|
261
256
|
|
262
|
-
class
|
257
|
+
class DumpFileBadPathError < InternalError
|
263
258
|
def initialize(path)
|
264
259
|
super("Must supply a string to a file path that can be written to. Given: #{path}")
|
265
260
|
end
|
data/lib/nestedtext/parser.rb
CHANGED
@@ -2,11 +2,12 @@
|
|
2
2
|
|
3
3
|
require "stringio"
|
4
4
|
|
5
|
-
require "nestedtext/
|
5
|
+
require "nestedtext/errors_internal"
|
6
6
|
require "nestedtext/scanners"
|
7
7
|
require "nestedtext/constants"
|
8
8
|
|
9
9
|
module NestedText
|
10
|
+
# A LL(1) recursive descent parser for NT.
|
10
11
|
class Parser
|
11
12
|
def self.assert_valid_top_level_type(top_class)
|
12
13
|
unless !top_class.nil? && top_class.is_a?(Class) && TOP_LEVEL_TYPES.map(&:object_id).include?(top_class.object_id)
|
@@ -14,8 +15,7 @@ module NestedText
|
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
17
|
-
|
18
|
-
def initialize(io, top_class, strict: true)
|
18
|
+
def initialize(io, top_class, strict: false)
|
19
19
|
assert_valid_input_type io
|
20
20
|
Parser.assert_valid_top_level_type(top_class)
|
21
21
|
@top_class = top_class
|
@@ -32,13 +32,13 @@ module NestedText
|
|
32
32
|
!result.nil? && ![Hash, Array, String].include?(result.class) && @strict
|
33
33
|
when Hash.object_id
|
34
34
|
result = {} if result.nil?
|
35
|
-
raise Errors::
|
35
|
+
raise Errors::TopLevelTypeMismatchParsedTypeError.new(@top_class, result) unless result.instance_of?(Hash)
|
36
36
|
when Array.object_id
|
37
37
|
result = [] if result.nil?
|
38
|
-
raise Errors::
|
38
|
+
raise Errors::TopLevelTypeMismatchParsedTypeError.new(@top_class, result) unless result.instance_of?(Array)
|
39
39
|
when String.object_id
|
40
40
|
result = "" if result.nil?
|
41
|
-
raise Errors::
|
41
|
+
raise Errors::TopLevelTypeMismatchParsedTypeError.new(@top_class, result) unless result.instance_of?(String)
|
42
42
|
else
|
43
43
|
raise Errors::UnsupportedTopLevelTypeError, @top_class
|
44
44
|
end
|
@@ -80,8 +80,8 @@ module NestedText
|
|
80
80
|
line = @line_scanner.read_next
|
81
81
|
|
82
82
|
Errors.raise_unrecognized_line(line) if line.tag == :unrecognized
|
83
|
-
raise Errors::
|
84
|
-
raise Errors::
|
83
|
+
raise Errors::ParseLineTypeExpectedListItemError, line unless line.tag == :list_item
|
84
|
+
raise Errors::ParseInvalidIndentationError.new(line, indentation) if line.indentation != indentation
|
85
85
|
|
86
86
|
value = line.attribs["value"]
|
87
87
|
if value.nil?
|
@@ -104,8 +104,8 @@ module NestedText
|
|
104
104
|
line = @line_scanner.read_next
|
105
105
|
first_line = line if first_line.nil?
|
106
106
|
Errors.raise_unrecognized_line(line) if line.tag == :unrecognized
|
107
|
-
raise Errors::
|
108
|
-
raise Errors::
|
107
|
+
raise Errors::ParseInvalidIndentationError.new(line, indentation) if line.indentation != indentation
|
108
|
+
raise Errors::ParseLineTypeExpectedDictItemError, line unless %i[dict_item key_item].include? line.tag
|
109
109
|
|
110
110
|
value = nil
|
111
111
|
key = nil
|
@@ -129,14 +129,14 @@ module NestedText
|
|
129
129
|
value = ""
|
130
130
|
else
|
131
131
|
unless exp_types.member?(@line_scanner.peek.tag)
|
132
|
-
raise Errors::
|
132
|
+
raise Errors::ParseLineTypeNotExpectedError.new(line, exp_types, line.tag)
|
133
133
|
end
|
134
|
-
raise Errors::
|
134
|
+
raise Errors::ParseMultilineKeyNoValueError, line unless @line_scanner.peek.indentation > indentation
|
135
135
|
|
136
136
|
value = parse_any(@line_scanner.peek.indentation)
|
137
137
|
end
|
138
138
|
end
|
139
|
-
raise Errors::
|
139
|
+
raise Errors::ParseDictDuplicateKeyError, line if result.key? key
|
140
140
|
|
141
141
|
result[key] = value
|
142
142
|
end
|
@@ -147,12 +147,12 @@ module NestedText
|
|
147
147
|
begin
|
148
148
|
clazz = class_name == "nil" ? NilClass : Object.const_get(class_name, false)
|
149
149
|
rescue NameError
|
150
|
-
raise Errors::
|
150
|
+
raise Errors::ParseCustomClassNotFoundError.new(first_line, class_name)
|
151
151
|
end
|
152
152
|
if clazz.respond_to? :nt_create
|
153
153
|
result = clazz.nt_create(result["data"])
|
154
154
|
else
|
155
|
-
raise Errors::
|
155
|
+
raise Errors::ParseCustomClassNoCreateMethodError.new(first_line, class_name)
|
156
156
|
end
|
157
157
|
end
|
158
158
|
|
@@ -163,8 +163,8 @@ module NestedText
|
|
163
163
|
result = []
|
164
164
|
while !@line_scanner.peek.nil? && @line_scanner.peek.indentation >= indentation
|
165
165
|
line = @line_scanner.read_next
|
166
|
-
raise Errors::
|
167
|
-
raise Errors::
|
166
|
+
raise Errors::ParseInvalidIndentationError.new(line, indentation) if line.indentation != indentation
|
167
|
+
raise Errors::ParseLineTypeNotExpectedError.new(line, %i[string_item], line.tag) unless line.tag == :string_item
|
168
168
|
|
169
169
|
value = line.attribs["value"]
|
170
170
|
result << value
|
@@ -178,16 +178,16 @@ module NestedText
|
|
178
178
|
key << @inline_scanner.read_next
|
179
179
|
end
|
180
180
|
if @inline_scanner.empty?
|
181
|
-
raise Errors::
|
182
|
-
|
181
|
+
raise Errors::ParseInlineNoClosingDelimiterError.new(@inline_scanner.line,
|
182
|
+
@inline_scanner.pos)
|
183
183
|
end
|
184
184
|
|
185
185
|
last_char = @inline_scanner.read_next
|
186
186
|
if last_char == "}" && key.empty?
|
187
|
-
raise Errors::
|
187
|
+
raise Errors::ParseInlineMissingValueError.new(@inline_scanner.line, @inline_scanner.pos - 1)
|
188
188
|
end
|
189
189
|
unless last_char == ":"
|
190
|
-
raise Errors::
|
190
|
+
raise Errors::ParseInlineDictKeySyntaxError.new(@inline_scanner.line, @inline_scanner.pos - 1, last_char)
|
191
191
|
end
|
192
192
|
|
193
193
|
key.join.strip
|
@@ -214,13 +214,13 @@ module NestedText
|
|
214
214
|
break unless @inline_scanner.peek == ","
|
215
215
|
end
|
216
216
|
if @inline_scanner.empty?
|
217
|
-
raise Errors::
|
218
|
-
|
217
|
+
raise Errors::ParseInlineNoClosingDelimiterError.new(@inline_scanner.line,
|
218
|
+
@inline_scanner.pos)
|
219
219
|
end
|
220
220
|
last_char = @inline_scanner.read_next
|
221
221
|
unless last_char == "}"
|
222
|
-
raise Errors::
|
223
|
-
|
222
|
+
raise Errors::ParseInlineDictSyntaxError.new(@inline_scanner.line, @inline_scanner.pos - 1,
|
223
|
+
last_char)
|
224
224
|
end
|
225
225
|
|
226
226
|
when "["
|
@@ -235,17 +235,17 @@ module NestedText
|
|
235
235
|
break unless @inline_scanner.peek == ","
|
236
236
|
end
|
237
237
|
if @inline_scanner.empty?
|
238
|
-
raise Errors::
|
239
|
-
|
238
|
+
raise Errors::ParseInlineNoClosingDelimiterError.new(@inline_scanner.line,
|
239
|
+
@inline_scanner.pos)
|
240
240
|
end
|
241
241
|
last_char = @inline_scanner.read_next
|
242
242
|
|
243
243
|
if last_char != "]"
|
244
244
|
if result[-1] == ""
|
245
|
-
raise Errors::
|
245
|
+
raise Errors::ParseInlineMissingValueError.new(@inline_scanner.line, @inline_scanner.pos - 1)
|
246
246
|
else
|
247
|
-
raise Errors::
|
248
|
-
|
247
|
+
raise Errors::ParseInlineListSyntaxError.new(@inline_scanner.line, @inline_scanner.pos - 1,
|
248
|
+
last_char)
|
249
249
|
end
|
250
250
|
end
|
251
251
|
else # Inline string
|
@@ -264,8 +264,8 @@ module NestedText
|
|
264
264
|
@inline_scanner = InlineScanner.new(@line_scanner.read_next)
|
265
265
|
result = parse_inline
|
266
266
|
unless @inline_scanner.empty?
|
267
|
-
raise Errors::
|
268
|
-
|
267
|
+
raise Errors::ParseInlineExtraCharactersAfterDelimiterError.new(@inline_scanner.line, @inline_scanner.pos,
|
268
|
+
@inline_scanner.remaining)
|
269
269
|
end
|
270
270
|
unless result.is_a? Hash
|
271
271
|
raise Errors::AssertionError,
|
@@ -279,8 +279,8 @@ module NestedText
|
|
279
279
|
@inline_scanner = InlineScanner.new(@line_scanner.read_next)
|
280
280
|
result = parse_inline
|
281
281
|
unless @inline_scanner.empty?
|
282
|
-
raise Errors::
|
283
|
-
|
282
|
+
raise Errors::ParseInlineExtraCharactersAfterDelimiterError.new(@inline_scanner.line, @inline_scanner.pos,
|
283
|
+
@inline_scanner.remaining)
|
284
284
|
end
|
285
285
|
unless result.is_a? Array
|
286
286
|
raise Errors::AssertionError,
|
data/lib/nestedtext/scanners.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "nestedtext/
|
3
|
+
require "nestedtext/errors_internal"
|
4
4
|
|
5
5
|
module NestedText
|
6
6
|
class LineScanner
|
@@ -15,7 +15,7 @@ module NestedText
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def read_next
|
18
|
-
raise Errors::
|
18
|
+
raise Errors::AssertionLineScannerIsEmptyError if empty?
|
19
19
|
|
20
20
|
line = @next_line
|
21
21
|
prepare_next_line
|
@@ -59,7 +59,7 @@ module NestedText
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def read_next
|
62
|
-
raise Errors::
|
62
|
+
raise Errors::AssertionInlineScannerIsEmptyError if empty?
|
63
63
|
|
64
64
|
@pos += 1
|
65
65
|
@line.content[@pos - 1]
|
@@ -108,7 +108,7 @@ module NestedText
|
|
108
108
|
|
109
109
|
def tag=(tag)
|
110
110
|
@tag = tag
|
111
|
-
raise Errors::
|
111
|
+
raise Errors::ParseLineTagUnknownError.new(self, tag) unless ALLOWED_LINE_TAGS.include?(@tag)
|
112
112
|
end
|
113
113
|
|
114
114
|
def to_s
|
@@ -147,7 +147,6 @@ module NestedText
|
|
147
147
|
elsif @content[0] == "{"
|
148
148
|
self.tag = :inline_dict
|
149
149
|
elsif @content[0] == "["
|
150
|
-
# TODO: merge path of inline dict and list and just set :inline?
|
151
150
|
self.tag = :inline_list
|
152
151
|
elsif @content =~ PATTERN_DICT_ITEM
|
153
152
|
self.tag = :dict_item
|
data/lib/nestedtext/version.rb
CHANGED
data/lib/nestedtext.rb
CHANGED
@@ -1,9 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "nestedtext/encode"
|
4
|
-
require_relative "nestedtext/decode"
|
5
3
|
require_relative "nestedtext/core_ext"
|
4
|
+
require_relative "nestedtext/decode"
|
5
|
+
require_relative "nestedtext/encode"
|
6
|
+
require_relative "nestedtext/encode_helpers"
|
7
|
+
require_relative "nestedtext/error"
|
6
8
|
require_relative "nestedtext/version"
|
7
9
|
|
10
|
+
##
|
11
|
+
# = NestedText
|
12
|
+
# The main module in this library to use.
|
13
|
+
#
|
14
|
+
# See README.md for documentation on Types, Strict Mode and Custom Classes.
|
8
15
|
module NestedText
|
9
16
|
end
|
data/nestedtext.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["Erik Westrup"]
|
9
9
|
spec.email = ["erik.westrup@gmail.com"]
|
10
10
|
|
11
|
-
spec.summary = "A ruby library
|
12
|
-
spec.description = "A ruby library
|
11
|
+
spec.summary = "A ruby library for the human friendly data format NestedText (https://nestedtext.org/)"
|
12
|
+
spec.description = "A ruby library for the human friendly data format NestedText (https://nestedtext.org/). There is support for decoding a NestedText file or string to Ruby data structures, as well as encoding Ruby objects to a NestedText file or string. Furthermore there is support for serialization and deserialization of custom classes. Support for v3.2.1 of the data format will all official tests passing."
|
13
13
|
spec.homepage = "https://github.com/erikw/nestedtext-ruby/"
|
14
14
|
spec.license = "MIT"
|
15
15
|
spec.required_ruby_version = [">= 3.0", "< 4"]
|
@@ -25,8 +25,8 @@ Gem::Specification.new do |spec|
|
|
25
25
|
}
|
26
26
|
|
27
27
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
28
|
-
`git ls-files -z`.split("\x0").
|
29
|
-
f.match(%r{\A(?:
|
28
|
+
`git ls-files -z`.split("\x0").select do |f|
|
29
|
+
f.match(%r{\A(?:lib/|CHANGELOG.md|CONTRIBUTING.md|LICENSE.txt|README.md|SECURITY.md|nestedtext.gemspec)})
|
30
30
|
end
|
31
31
|
end
|
32
32
|
spec.require_paths = ["lib"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nestedtext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Westrup
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: warning
|
@@ -38,26 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.0'
|
41
|
-
description: A ruby library
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
description: A ruby library for the human friendly data format NestedText (https://nestedtext.org/).
|
42
|
+
There is support for decoding a NestedText file or string to Ruby data structures,
|
43
|
+
as well as encoding Ruby objects to a NestedText file or string. Furthermore there
|
44
|
+
is support for serialization and deserialization of custom classes. Support for
|
45
|
+
v3.2.1 of the data format will all official tests passing.
|
46
46
|
email:
|
47
47
|
- erik.westrup@gmail.com
|
48
48
|
executables: []
|
49
49
|
extensions: []
|
50
50
|
extra_rdoc_files: []
|
51
51
|
files:
|
52
|
-
- ".editorconfig"
|
53
|
-
- ".gitignore"
|
54
|
-
- ".rubocop.yml"
|
55
|
-
- ".ruby-version"
|
56
52
|
- CHANGELOG.md
|
57
53
|
- CONTRIBUTING.md
|
58
|
-
- Gemfile
|
59
54
|
- LICENSE.txt
|
60
|
-
- OSSMETADATA
|
61
55
|
- README.md
|
62
56
|
- SECURITY.md
|
63
57
|
- lib/nestedtext.rb
|
@@ -68,7 +62,8 @@ files:
|
|
68
62
|
- lib/nestedtext/dumper.rb
|
69
63
|
- lib/nestedtext/encode.rb
|
70
64
|
- lib/nestedtext/encode_helpers.rb
|
71
|
-
- lib/nestedtext/
|
65
|
+
- lib/nestedtext/error.rb
|
66
|
+
- lib/nestedtext/errors_internal.rb
|
72
67
|
- lib/nestedtext/parser.rb
|
73
68
|
- lib/nestedtext/scanners.rb
|
74
69
|
- lib/nestedtext/version.rb
|
@@ -99,6 +94,5 @@ requirements: []
|
|
99
94
|
rubygems_version: 3.3.3
|
100
95
|
signing_key:
|
101
96
|
specification_version: 4
|
102
|
-
summary: A ruby library
|
103
|
-
(https://nestedtext.org/)
|
97
|
+
summary: A ruby library for the human friendly data format NestedText (https://nestedtext.org/)
|
104
98
|
test_files: []
|
data/.editorconfig
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
# Modified version of https://github.com/ruby/ruby/blob/master/.editorconfig
|
2
|
-
|
3
|
-
root = true
|
4
|
-
|
5
|
-
[*]
|
6
|
-
end_of_line = lf
|
7
|
-
indent_size = 4
|
8
|
-
indent_style = space
|
9
|
-
insert_final_newline = true
|
10
|
-
tab_width = 4
|
11
|
-
trim_trailing_whitespace = true
|
12
|
-
|
13
|
-
[*.rb]
|
14
|
-
indent_size = 2
|
15
|
-
|
16
|
-
[*.gemspec]
|
17
|
-
indent_size = 2
|
18
|
-
|
19
|
-
[*.yml]
|
20
|
-
indent_size = 2
|
21
|
-
|
22
|
-
[test/nestedtext/encode_test.rb]
|
23
|
-
# So we can test trailing whitespace strings.
|
24
|
-
trim_trailing_whitespace = unset
|
data/.gitignore
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# Contrary to ruby apps, ruby gems should not check in Gemfile.lock.
|
2
|
-
# Reference: https://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/
|
3
|
-
/Gemfile.lock
|
4
|
-
|
5
|
-
# Bundle local config
|
6
|
-
/.bundle/
|
7
|
-
|
8
|
-
# Package gem from $(rake install)
|
9
|
-
/pkg/
|
10
|
-
# When built from $(gem build *.gemspec)
|
11
|
-
/*.gem
|
12
|
-
|
13
|
-
# minitest
|
14
|
-
/test/html_reports/
|
15
|
-
/test/reports/
|
16
|
-
|
17
|
-
# simplecov
|
18
|
-
/coverage/
|
19
|
-
|
20
|
-
# byebug
|
21
|
-
/.byebug_history
|