ruby-lsp-rspec 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ruby_lsp_rspec/version.rb +1 -1
  3. metadata +1 -45
  4. data/misc/example.gif +0 -0
  5. data/sorbet/config +0 -4
  6. data/sorbet/rbi/annotations/rainbow.rbi +0 -269
  7. data/sorbet/rbi/gems/ast@2.4.2.rbi +0 -584
  8. data/sorbet/rbi/gems/base64@0.1.1.rbi +0 -172
  9. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +0 -1083
  10. data/sorbet/rbi/gems/erubi@1.12.0.rbi +0 -145
  11. data/sorbet/rbi/gems/io-console@0.6.0.rbi +0 -8
  12. data/sorbet/rbi/gems/json@2.6.3.rbi +0 -1533
  13. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +0 -14237
  14. data/sorbet/rbi/gems/netrc@0.11.0.rbi +0 -158
  15. data/sorbet/rbi/gems/parallel@1.23.0.rbi +0 -273
  16. data/sorbet/rbi/gems/parser@3.2.2.3.rbi +0 -7253
  17. data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +0 -951
  18. data/sorbet/rbi/gems/psych@5.1.0.rbi +0 -1760
  19. data/sorbet/rbi/gems/racc@1.7.1.rbi +0 -161
  20. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +0 -402
  21. data/sorbet/rbi/gems/rake@13.0.6.rbi +0 -3024
  22. data/sorbet/rbi/gems/rbi@0.0.17.rbi +0 -2972
  23. data/sorbet/rbi/gems/regexp_parser@2.8.1.rbi +0 -3749
  24. data/sorbet/rbi/gems/reline@0.3.8.rbi +0 -2260
  25. data/sorbet/rbi/gems/rexml@3.2.6.rbi +0 -4781
  26. data/sorbet/rbi/gems/rspec-core@3.12.2.rbi +0 -10805
  27. data/sorbet/rbi/gems/rspec-expectations@3.12.3.rbi +0 -8100
  28. data/sorbet/rbi/gems/rspec-mocks@3.12.5.rbi +0 -5305
  29. data/sorbet/rbi/gems/rspec-support@3.12.0.rbi +0 -1611
  30. data/sorbet/rbi/gems/rspec@3.12.0.rbi +0 -82
  31. data/sorbet/rbi/gems/rubocop-ast@1.29.0.rbi +0 -6985
  32. data/sorbet/rbi/gems/rubocop@1.56.2.rbi +0 -56538
  33. data/sorbet/rbi/gems/ruby-lsp@0.10.1.rbi +0 -2903
  34. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +0 -1317
  35. data/sorbet/rbi/gems/spoom@1.2.3.rbi +0 -3203
  36. data/sorbet/rbi/gems/stringio@3.0.8.rbi +0 -8
  37. data/sorbet/rbi/gems/syntax_tree@6.1.1.rbi +0 -22855
  38. data/sorbet/rbi/gems/tapioca@0.11.8.rbi +0 -3349
  39. data/sorbet/rbi/gems/thor@1.2.2.rbi +0 -3965
  40. data/sorbet/rbi/gems/unicode-display_width@2.4.2.rbi +0 -65
  41. data/sorbet/rbi/gems/unparser@0.6.8.rbi +0 -4525
  42. data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +0 -428
  43. data/sorbet/rbi/gems/yard@0.9.34.rbi +0 -18219
  44. data/sorbet/rbi/gems/yarp@0.11.0.rbi +0 -15141
  45. data/sorbet/rbi/shims/uri.rbi +0 -14
  46. data/sorbet/tapioca/config.yml +0 -13
  47. data/sorbet/tapioca/require.rb +0 -8
@@ -1,1760 +0,0 @@
1
- # typed: true
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This is an autogenerated file for types exported from the `psych` gem.
5
- # Please instead update this file by running `bin/tapioca gem psych`.
6
-
7
- # source://psych//lib/psych/core_ext.rb#2
8
- class Object < ::BasicObject
9
- include ::Kernel
10
- include ::PP::ObjectMixin
11
-
12
- # call-seq: to_yaml(options = {})
13
- #
14
- # Convert an object to YAML. See Psych.dump for more information on the
15
- # available +options+.
16
- #
17
- # source://psych//lib/psych/core_ext.rb#12
18
- def to_yaml(options = T.unsafe(nil)); end
19
-
20
- class << self
21
- # source://psych//lib/psych/core_ext.rb#3
22
- def yaml_tag(url); end
23
- end
24
- end
25
-
26
- # = Overview
27
- #
28
- # Psych is a YAML parser and emitter.
29
- # Psych leverages libyaml [Home page: https://pyyaml.org/wiki/LibYAML]
30
- # or [git repo: https://github.com/yaml/libyaml] for its YAML parsing
31
- # and emitting capabilities. In addition to wrapping libyaml, Psych also
32
- # knows how to serialize and de-serialize most Ruby objects to and from
33
- # the YAML format.
34
- #
35
- # = I NEED TO PARSE OR EMIT YAML RIGHT NOW!
36
- #
37
- # # Parse some YAML
38
- # Psych.load("--- foo") # => "foo"
39
- #
40
- # # Emit some YAML
41
- # Psych.dump("foo") # => "--- foo\n...\n"
42
- # { :a => 'b'}.to_yaml # => "---\n:a: b\n"
43
- #
44
- # Got more time on your hands? Keep on reading!
45
- #
46
- # == YAML Parsing
47
- #
48
- # Psych provides a range of interfaces for parsing a YAML document ranging from
49
- # low level to high level, depending on your parsing needs. At the lowest
50
- # level, is an event based parser. Mid level is access to the raw YAML AST,
51
- # and at the highest level is the ability to unmarshal YAML to Ruby objects.
52
- #
53
- # == YAML Emitting
54
- #
55
- # Psych provides a range of interfaces ranging from low to high level for
56
- # producing YAML documents. Very similar to the YAML parsing interfaces, Psych
57
- # provides at the lowest level, an event based system, mid-level is building
58
- # a YAML AST, and the highest level is converting a Ruby object straight to
59
- # a YAML document.
60
- #
61
- # == High-level API
62
- #
63
- # === Parsing
64
- #
65
- # The high level YAML parser provided by Psych simply takes YAML as input and
66
- # returns a Ruby data structure. For information on using the high level parser
67
- # see Psych.load
68
- #
69
- # ==== Reading from a string
70
- #
71
- # Psych.safe_load("--- a") # => 'a'
72
- # Psych.safe_load("---\n - a\n - b") # => ['a', 'b']
73
- # # From a trusted string:
74
- # Psych.load("--- !ruby/range\nbegin: 0\nend: 42\nexcl: false\n") # => 0..42
75
- #
76
- # ==== Reading from a file
77
- #
78
- # Psych.safe_load_file("data.yml", permitted_classes: [Date])
79
- # Psych.load_file("trusted_database.yml")
80
- #
81
- # ==== Exception handling
82
- #
83
- # begin
84
- # # The second argument changes only the exception contents
85
- # Psych.parse("--- `", "file.txt")
86
- # rescue Psych::SyntaxError => ex
87
- # ex.file # => 'file.txt'
88
- # ex.message # => "(file.txt): found character that cannot start any token"
89
- # end
90
- #
91
- # === Emitting
92
- #
93
- # The high level emitter has the easiest interface. Psych simply takes a Ruby
94
- # data structure and converts it to a YAML document. See Psych.dump for more
95
- # information on dumping a Ruby data structure.
96
- #
97
- # ==== Writing to a string
98
- #
99
- # # Dump an array, get back a YAML string
100
- # Psych.dump(['a', 'b']) # => "---\n- a\n- b\n"
101
- #
102
- # # Dump an array to an IO object
103
- # Psych.dump(['a', 'b'], StringIO.new) # => #<StringIO:0x000001009d0890>
104
- #
105
- # # Dump an array with indentation set
106
- # Psych.dump(['a', ['b']], :indentation => 3) # => "---\n- a\n- - b\n"
107
- #
108
- # # Dump an array to an IO with indentation set
109
- # Psych.dump(['a', ['b']], StringIO.new, :indentation => 3)
110
- #
111
- # ==== Writing to a file
112
- #
113
- # Currently there is no direct API for dumping Ruby structure to file:
114
- #
115
- # File.open('database.yml', 'w') do |file|
116
- # file.write(Psych.dump(['a', 'b']))
117
- # end
118
- #
119
- # == Mid-level API
120
- #
121
- # === Parsing
122
- #
123
- # Psych provides access to an AST produced from parsing a YAML document. This
124
- # tree is built using the Psych::Parser and Psych::TreeBuilder. The AST can
125
- # be examined and manipulated freely. Please see Psych::parse_stream,
126
- # Psych::Nodes, and Psych::Nodes::Node for more information on dealing with
127
- # YAML syntax trees.
128
- #
129
- # ==== Reading from a string
130
- #
131
- # # Returns Psych::Nodes::Stream
132
- # Psych.parse_stream("---\n - a\n - b")
133
- #
134
- # # Returns Psych::Nodes::Document
135
- # Psych.parse("---\n - a\n - b")
136
- #
137
- # ==== Reading from a file
138
- #
139
- # # Returns Psych::Nodes::Stream
140
- # Psych.parse_stream(File.read('database.yml'))
141
- #
142
- # # Returns Psych::Nodes::Document
143
- # Psych.parse_file('database.yml')
144
- #
145
- # ==== Exception handling
146
- #
147
- # begin
148
- # # The second argument changes only the exception contents
149
- # Psych.parse("--- `", "file.txt")
150
- # rescue Psych::SyntaxError => ex
151
- # ex.file # => 'file.txt'
152
- # ex.message # => "(file.txt): found character that cannot start any token"
153
- # end
154
- #
155
- # === Emitting
156
- #
157
- # At the mid level is building an AST. This AST is exactly the same as the AST
158
- # used when parsing a YAML document. Users can build an AST by hand and the
159
- # AST knows how to emit itself as a YAML document. See Psych::Nodes,
160
- # Psych::Nodes::Node, and Psych::TreeBuilder for more information on building
161
- # a YAML AST.
162
- #
163
- # ==== Writing to a string
164
- #
165
- # # We need Psych::Nodes::Stream (not Psych::Nodes::Document)
166
- # stream = Psych.parse_stream("---\n - a\n - b")
167
- #
168
- # stream.to_yaml # => "---\n- a\n- b\n"
169
- #
170
- # ==== Writing to a file
171
- #
172
- # # We need Psych::Nodes::Stream (not Psych::Nodes::Document)
173
- # stream = Psych.parse_stream(File.read('database.yml'))
174
- #
175
- # File.open('database.yml', 'w') do |file|
176
- # file.write(stream.to_yaml)
177
- # end
178
- #
179
- # == Low-level API
180
- #
181
- # === Parsing
182
- #
183
- # The lowest level parser should be used when the YAML input is already known,
184
- # and the developer does not want to pay the price of building an AST or
185
- # automatic detection and conversion to Ruby objects. See Psych::Parser for
186
- # more information on using the event based parser.
187
- #
188
- # ==== Reading to Psych::Nodes::Stream structure
189
- #
190
- # parser = Psych::Parser.new(TreeBuilder.new) # => #<Psych::Parser>
191
- # parser = Psych.parser # it's an alias for the above
192
- #
193
- # parser.parse("---\n - a\n - b") # => #<Psych::Parser>
194
- # parser.handler # => #<Psych::TreeBuilder>
195
- # parser.handler.root # => #<Psych::Nodes::Stream>
196
- #
197
- # ==== Receiving an events stream
198
- #
199
- # recorder = Psych::Handlers::Recorder.new
200
- # parser = Psych::Parser.new(recorder)
201
- #
202
- # parser.parse("---\n - a\n - b")
203
- # recorder.events # => [list of [event, args] lists]
204
- # # event is one of: Psych::Handler::EVENTS
205
- # # args are the arguments passed to the event
206
- #
207
- # === Emitting
208
- #
209
- # The lowest level emitter is an event based system. Events are sent to a
210
- # Psych::Emitter object. That object knows how to convert the events to a YAML
211
- # document. This interface should be used when document format is known in
212
- # advance or speed is a concern. See Psych::Emitter for more information.
213
- #
214
- # ==== Writing to a Ruby structure
215
- #
216
- # Psych.parser.parse("--- a") # => #<Psych::Parser>
217
- #
218
- # parser.handler.first # => #<Psych::Nodes::Stream>
219
- # parser.handler.first.to_ruby # => ["a"]
220
- #
221
- # parser.handler.root.first # => #<Psych::Nodes::Document>
222
- # parser.handler.root.first.to_ruby # => "a"
223
- #
224
- # # You can instantiate an Emitter manually
225
- # Psych::Visitors::ToRuby.new.accept(parser.handler.root.first)
226
- # # => "a"
227
- #
228
- # source://psych//lib/psych/versions.rb#3
229
- module Psych
230
- class << self
231
- # source://psych//lib/psych.rb#682
232
- def add_builtin_type(type_tag, &block); end
233
-
234
- # :stopdoc:
235
- #
236
- # source://psych//lib/psych.rb#676
237
- def add_domain_type(domain, type_tag, &block); end
238
-
239
- # source://psych//lib/psych.rb#692
240
- def add_tag(tag, klass); end
241
-
242
- # source://psych//lib/psych.rb#726
243
- def config; end
244
-
245
- # call-seq:
246
- # Psych.dump(o) -> string of yaml
247
- # Psych.dump(o, options) -> string of yaml
248
- # Psych.dump(o, io) -> io object passed in
249
- # Psych.dump(o, io, options) -> io object passed in
250
- #
251
- # Dump Ruby object +o+ to a YAML string. Optional +options+ may be passed in
252
- # to control the output format. If an IO object is passed in, the YAML will
253
- # be dumped to that IO object.
254
- #
255
- # Currently supported options are:
256
- #
257
- # [<tt>:indentation</tt>] Number of space characters used to indent.
258
- # Acceptable value should be in <tt>0..9</tt> range,
259
- # otherwise option is ignored.
260
- #
261
- # Default: <tt>2</tt>.
262
- # [<tt>:line_width</tt>] Max character to wrap line at.
263
- #
264
- # Default: <tt>0</tt> (meaning "wrap at 81").
265
- # [<tt>:canonical</tt>] Write "canonical" YAML form (very verbose, yet
266
- # strictly formal).
267
- #
268
- # Default: <tt>false</tt>.
269
- # [<tt>:header</tt>] Write <tt>%YAML [version]</tt> at the beginning of document.
270
- #
271
- # Default: <tt>false</tt>.
272
- #
273
- # Example:
274
- #
275
- # # Dump an array, get back a YAML string
276
- # Psych.dump(['a', 'b']) # => "---\n- a\n- b\n"
277
- #
278
- # # Dump an array to an IO object
279
- # Psych.dump(['a', 'b'], StringIO.new) # => #<StringIO:0x000001009d0890>
280
- #
281
- # # Dump an array with indentation set
282
- # Psych.dump(['a', ['b']], indentation: 3) # => "---\n- a\n- - b\n"
283
- #
284
- # # Dump an array to an IO with indentation set
285
- # Psych.dump(['a', ['b']], StringIO.new, indentation: 3)
286
- #
287
- # source://psych//lib/psych.rb#505
288
- def dump(o, io = T.unsafe(nil), options = T.unsafe(nil)); end
289
-
290
- # Dump a list of objects as separate documents to a document stream.
291
- #
292
- # Example:
293
- #
294
- # Psych.dump_stream("foo\n ", {}) # => "--- ! \"foo\\n \"\n--- {}\n"
295
- #
296
- # source://psych//lib/psych.rb#595
297
- def dump_stream(*objects); end
298
-
299
- # Load +yaml+ in to a Ruby data structure. If multiple documents are
300
- # provided, the object contained in the first document will be returned.
301
- # +filename+ will be used in the exception message if any exception
302
- # is raised while parsing. If +yaml+ is empty, it returns
303
- # the specified +fallback+ return value, which defaults to +false+.
304
- #
305
- # Raises a Psych::SyntaxError when a YAML syntax error is detected.
306
- #
307
- # Example:
308
- #
309
- # Psych.load("--- a") # => 'a'
310
- # Psych.load("---\n - a\n - b") # => ['a', 'b']
311
- #
312
- # begin
313
- # Psych.load("--- `", filename: "file.txt")
314
- # rescue Psych::SyntaxError => ex
315
- # ex.file # => 'file.txt'
316
- # ex.message # => "(file.txt): found character that cannot start any token"
317
- # end
318
- #
319
- # When the optional +symbolize_names+ keyword argument is set to a
320
- # true value, returns symbols for keys in Hash objects (default: strings).
321
- #
322
- # Psych.load("---\n foo: bar") # => {"foo"=>"bar"}
323
- # Psych.load("---\n foo: bar", symbolize_names: true) # => {:foo=>"bar"}
324
- #
325
- # Raises a TypeError when `yaml` parameter is NilClass. This method is
326
- # similar to `safe_load` except that `Symbol` objects are allowed by default.
327
- #
328
- # source://psych//lib/psych.rb#368
329
- def load(yaml, permitted_classes: T.unsafe(nil), permitted_symbols: T.unsafe(nil), aliases: T.unsafe(nil), filename: T.unsafe(nil), fallback: T.unsafe(nil), symbolize_names: T.unsafe(nil), freeze: T.unsafe(nil), strict_integer: T.unsafe(nil)); end
330
-
331
- # Loads the document contained in +filename+. Returns the yaml contained in
332
- # +filename+ as a Ruby object, or if the file is empty, it returns
333
- # the specified +fallback+ return value, which defaults to +false+.
334
- # See load for options.
335
- #
336
- # source://psych//lib/psych.rb#669
337
- def load_file(filename, **kwargs); end
338
-
339
- # Load multiple documents given in +yaml+. Returns the parsed documents
340
- # as a list. If a block is given, each document will be converted to Ruby
341
- # and passed to the block during parsing
342
- #
343
- # Example:
344
- #
345
- # Psych.load_stream("--- foo\n...\n--- bar\n...") # => ['foo', 'bar']
346
- #
347
- # list = []
348
- # Psych.load_stream("--- foo\n...\n--- bar\n...") do |ruby|
349
- # list << ruby
350
- # end
351
- # list # => ['foo', 'bar']
352
- #
353
- # source://psych//lib/psych.rb#626
354
- def load_stream(yaml, filename: T.unsafe(nil), fallback: T.unsafe(nil), **kwargs); end
355
-
356
- # Parse a YAML string in +yaml+. Returns the Psych::Nodes::Document.
357
- # +filename+ is used in the exception message if a Psych::SyntaxError is
358
- # raised.
359
- #
360
- # Raises a Psych::SyntaxError when a YAML syntax error is detected.
361
- #
362
- # Example:
363
- #
364
- # Psych.parse("---\n - a\n - b") # => #<Psych::Nodes::Document:0x00>
365
- #
366
- # begin
367
- # Psych.parse("--- `", filename: "file.txt")
368
- # rescue Psych::SyntaxError => ex
369
- # ex.file # => 'file.txt'
370
- # ex.message # => "(file.txt): found character that cannot start any token"
371
- # end
372
- #
373
- # See Psych::Nodes for more information about YAML AST.
374
- #
375
- # source://psych//lib/psych.rb#398
376
- def parse(yaml, filename: T.unsafe(nil)); end
377
-
378
- # Parse a file at +filename+. Returns the Psych::Nodes::Document.
379
- #
380
- # Raises a Psych::SyntaxError when a YAML syntax error is detected.
381
- #
382
- # source://psych//lib/psych.rb#410
383
- def parse_file(filename, fallback: T.unsafe(nil)); end
384
-
385
- # Parse a YAML string in +yaml+. Returns the Psych::Nodes::Stream.
386
- # This method can handle multiple YAML documents contained in +yaml+.
387
- # +filename+ is used in the exception message if a Psych::SyntaxError is
388
- # raised.
389
- #
390
- # If a block is given, a Psych::Nodes::Document node will be yielded to the
391
- # block as it's being parsed.
392
- #
393
- # Raises a Psych::SyntaxError when a YAML syntax error is detected.
394
- #
395
- # Example:
396
- #
397
- # Psych.parse_stream("---\n - a\n - b") # => #<Psych::Nodes::Stream:0x00>
398
- #
399
- # Psych.parse_stream("--- a\n--- b") do |node|
400
- # node # => #<Psych::Nodes::Document:0x00>
401
- # end
402
- #
403
- # begin
404
- # Psych.parse_stream("--- `", filename: "file.txt")
405
- # rescue Psych::SyntaxError => ex
406
- # ex.file # => 'file.txt'
407
- # ex.message # => "(file.txt): found character that cannot start any token"
408
- # end
409
- #
410
- # Raises a TypeError when NilClass is passed.
411
- #
412
- # See Psych::Nodes for more information about YAML AST.
413
- #
414
- # source://psych//lib/psych.rb#452
415
- def parse_stream(yaml, filename: T.unsafe(nil), &block); end
416
-
417
- # Returns a default parser
418
- #
419
- # source://psych//lib/psych.rb#419
420
- def parser; end
421
-
422
- # source://psych//lib/psych.rb#688
423
- def remove_type(type_tag); end
424
-
425
- # call-seq:
426
- # Psych.safe_dump(o) -> string of yaml
427
- # Psych.safe_dump(o, options) -> string of yaml
428
- # Psych.safe_dump(o, io) -> io object passed in
429
- # Psych.safe_dump(o, io, options) -> io object passed in
430
- #
431
- # Safely dump Ruby object +o+ to a YAML string. Optional +options+ may be passed in
432
- # to control the output format. If an IO object is passed in, the YAML will
433
- # be dumped to that IO object. By default, only the following
434
- # classes are allowed to be serialized:
435
- #
436
- # * TrueClass
437
- # * FalseClass
438
- # * NilClass
439
- # * Integer
440
- # * Float
441
- # * String
442
- # * Array
443
- # * Hash
444
- #
445
- # Arbitrary classes can be allowed by adding those classes to the +permitted_classes+
446
- # keyword argument. They are additive. For example, to allow Date serialization:
447
- #
448
- # Psych.safe_dump(yaml, permitted_classes: [Date])
449
- #
450
- # Now the Date class can be dumped in addition to the classes listed above.
451
- #
452
- # A Psych::DisallowedClass exception will be raised if the object contains a
453
- # class that isn't in the +permitted_classes+ list.
454
- #
455
- # Currently supported options are:
456
- #
457
- # [<tt>:indentation</tt>] Number of space characters used to indent.
458
- # Acceptable value should be in <tt>0..9</tt> range,
459
- # otherwise option is ignored.
460
- #
461
- # Default: <tt>2</tt>.
462
- # [<tt>:line_width</tt>] Max character to wrap line at.
463
- #
464
- # Default: <tt>0</tt> (meaning "wrap at 81").
465
- # [<tt>:canonical</tt>] Write "canonical" YAML form (very verbose, yet
466
- # strictly formal).
467
- #
468
- # Default: <tt>false</tt>.
469
- # [<tt>:header</tt>] Write <tt>%YAML [version]</tt> at the beginning of document.
470
- #
471
- # Default: <tt>false</tt>.
472
- #
473
- # Example:
474
- #
475
- # # Dump an array, get back a YAML string
476
- # Psych.safe_dump(['a', 'b']) # => "---\n- a\n- b\n"
477
- #
478
- # # Dump an array to an IO object
479
- # Psych.safe_dump(['a', 'b'], StringIO.new) # => #<StringIO:0x000001009d0890>
480
- #
481
- # # Dump an array with indentation set
482
- # Psych.safe_dump(['a', ['b']], indentation: 3) # => "---\n- a\n- - b\n"
483
- #
484
- # # Dump an array to an IO with indentation set
485
- # Psych.safe_dump(['a', ['b']], StringIO.new, indentation: 3)
486
- #
487
- # source://psych//lib/psych.rb#578
488
- def safe_dump(o, io = T.unsafe(nil), options = T.unsafe(nil)); end
489
-
490
- # Safely load the yaml string in +yaml+. By default, only the following
491
- # classes are allowed to be deserialized:
492
- #
493
- # * TrueClass
494
- # * FalseClass
495
- # * NilClass
496
- # * Integer
497
- # * Float
498
- # * String
499
- # * Array
500
- # * Hash
501
- #
502
- # Recursive data structures are not allowed by default. Arbitrary classes
503
- # can be allowed by adding those classes to the +permitted_classes+ keyword argument. They are
504
- # additive. For example, to allow Date deserialization:
505
- #
506
- # Psych.safe_load(yaml, permitted_classes: [Date])
507
- #
508
- # Now the Date class can be loaded in addition to the classes listed above.
509
- #
510
- # Aliases can be explicitly allowed by changing the +aliases+ keyword argument.
511
- # For example:
512
- #
513
- # x = []
514
- # x << x
515
- # yaml = Psych.dump x
516
- # Psych.safe_load yaml # => raises an exception
517
- # Psych.safe_load yaml, aliases: true # => loads the aliases
518
- #
519
- # A Psych::DisallowedClass exception will be raised if the yaml contains a
520
- # class that isn't in the +permitted_classes+ list.
521
- #
522
- # A Psych::AliasesNotEnabled exception will be raised if the yaml contains aliases
523
- # but the +aliases+ keyword argument is set to false.
524
- #
525
- # +filename+ will be used in the exception message if any exception is raised
526
- # while parsing.
527
- #
528
- # When the optional +symbolize_names+ keyword argument is set to a
529
- # true value, returns symbols for keys in Hash objects (default: strings).
530
- #
531
- # Psych.safe_load("---\n foo: bar") # => {"foo"=>"bar"}
532
- # Psych.safe_load("---\n foo: bar", symbolize_names: true) # => {:foo=>"bar"}
533
- #
534
- # source://psych//lib/psych.rb#322
535
- def safe_load(yaml, permitted_classes: T.unsafe(nil), permitted_symbols: T.unsafe(nil), aliases: T.unsafe(nil), filename: T.unsafe(nil), fallback: T.unsafe(nil), symbolize_names: T.unsafe(nil), freeze: T.unsafe(nil), strict_integer: T.unsafe(nil)); end
536
-
537
- # Safely loads the document contained in +filename+. Returns the yaml contained in
538
- # +filename+ as a Ruby object, or if the file is empty, it returns
539
- # the specified +fallback+ return value, which defaults to +false+.
540
- # See safe_load for options.
541
- #
542
- # source://psych//lib/psych.rb#658
543
- def safe_load_file(filename, **kwargs); end
544
-
545
- # Dump Ruby +object+ to a JSON string.
546
- #
547
- # source://psych//lib/psych.rb#605
548
- def to_json(object); end
549
-
550
- # Load +yaml+ in to a Ruby data structure. If multiple documents are
551
- # provided, the object contained in the first document will be returned.
552
- # +filename+ will be used in the exception message if any exception
553
- # is raised while parsing. If +yaml+ is empty, it returns
554
- # the specified +fallback+ return value, which defaults to +false+.
555
- #
556
- # Raises a Psych::SyntaxError when a YAML syntax error is detected.
557
- #
558
- # Example:
559
- #
560
- # Psych.unsafe_load("--- a") # => 'a'
561
- # Psych.unsafe_load("---\n - a\n - b") # => ['a', 'b']
562
- #
563
- # begin
564
- # Psych.unsafe_load("--- `", filename: "file.txt")
565
- # rescue Psych::SyntaxError => ex
566
- # ex.file # => 'file.txt'
567
- # ex.message # => "(file.txt): found character that cannot start any token"
568
- # end
569
- #
570
- # When the optional +symbolize_names+ keyword argument is set to a
571
- # true value, returns symbols for keys in Hash objects (default: strings).
572
- #
573
- # Psych.unsafe_load("---\n foo: bar") # => {"foo"=>"bar"}
574
- # Psych.unsafe_load("---\n foo: bar", symbolize_names: true) # => {:foo=>"bar"}
575
- #
576
- # Raises a TypeError when `yaml` parameter is NilClass
577
- #
578
- # NOTE: This method *should not* be used to parse untrusted documents, such as
579
- # YAML documents that are supplied via user input. Instead, please use the
580
- # load method or the safe_load method.
581
- #
582
- # source://psych//lib/psych.rb#271
583
- def unsafe_load(yaml, filename: T.unsafe(nil), fallback: T.unsafe(nil), symbolize_names: T.unsafe(nil), freeze: T.unsafe(nil), strict_integer: T.unsafe(nil)); end
584
-
585
- # Load the document contained in +filename+. Returns the yaml contained in
586
- # +filename+ as a Ruby object, or if the file is empty, it returns
587
- # the specified +fallback+ return value, which defaults to +false+.
588
- #
589
- # NOTE: This method *should not* be used to parse untrusted documents, such as
590
- # YAML documents that are supplied via user input. Instead, please use the
591
- # safe_load_file method.
592
- #
593
- # source://psych//lib/psych.rb#647
594
- def unsafe_load_file(filename, **kwargs); end
595
-
596
- private
597
-
598
- # source://psych//lib/psych.rb#703
599
- def parse_caller(at); end
600
-
601
- # Workaround for emulating `warn '...', uplevel: 1` in Ruby 2.4 or lower.
602
- #
603
- # source://psych//lib/psych.rb#698
604
- def warn_with_uplevel(message, uplevel: T.unsafe(nil)); end
605
- end
606
- end
607
-
608
- # Subclasses `BadAlias` for backwards compatibility
609
- #
610
- # source://psych//lib/psych/exception.rb#10
611
- class Psych::AliasesNotEnabled < ::Psych::BadAlias
612
- # @return [AliasesNotEnabled] a new instance of AliasesNotEnabled
613
- #
614
- # source://psych//lib/psych/exception.rb#11
615
- def initialize; end
616
- end
617
-
618
- # Subclasses `BadAlias` for backwards compatibility
619
- #
620
- # source://psych//lib/psych/exception.rb#17
621
- class Psych::AnchorNotDefined < ::Psych::BadAlias
622
- # @return [AnchorNotDefined] a new instance of AnchorNotDefined
623
- #
624
- # source://psych//lib/psych/exception.rb#18
625
- def initialize(anchor_name); end
626
- end
627
-
628
- # source://psych//lib/psych/class_loader.rb#6
629
- class Psych::ClassLoader
630
- # @return [ClassLoader] a new instance of ClassLoader
631
- #
632
- # source://psych//lib/psych/class_loader.rb#21
633
- def initialize; end
634
-
635
- # source://psych//lib/psych/class_loader.rb#39
636
- def big_decimal; end
637
-
638
- # source://psych//lib/psych/class_loader.rb#39
639
- def complex; end
640
-
641
- # source://psych//lib/psych/class_loader.rb#39
642
- def date; end
643
-
644
- # source://psych//lib/psych/class_loader.rb#39
645
- def date_time; end
646
-
647
- # source://psych//lib/psych/class_loader.rb#39
648
- def exception; end
649
-
650
- # source://psych//lib/psych/class_loader.rb#25
651
- def load(klassname); end
652
-
653
- # source://psych//lib/psych/class_loader.rb#39
654
- def object; end
655
-
656
- # source://psych//lib/psych/class_loader.rb#39
657
- def psych_omap; end
658
-
659
- # source://psych//lib/psych/class_loader.rb#39
660
- def psych_set; end
661
-
662
- # source://psych//lib/psych/class_loader.rb#39
663
- def range; end
664
-
665
- # source://psych//lib/psych/class_loader.rb#39
666
- def rational; end
667
-
668
- # source://psych//lib/psych/class_loader.rb#39
669
- def regexp; end
670
-
671
- # source://psych//lib/psych/class_loader.rb#39
672
- def struct; end
673
-
674
- # source://psych//lib/psych/class_loader.rb#39
675
- def symbol; end
676
-
677
- # source://psych//lib/psych/class_loader.rb#31
678
- def symbolize(sym); end
679
-
680
- private
681
-
682
- # source://psych//lib/psych/class_loader.rb#47
683
- def find(klassname); end
684
-
685
- # source://psych//lib/psych/class_loader.rb#51
686
- def resolve(klassname); end
687
- end
688
-
689
- # source://psych//lib/psych/class_loader.rb#76
690
- class Psych::ClassLoader::Restricted < ::Psych::ClassLoader
691
- # @return [Restricted] a new instance of Restricted
692
- #
693
- # source://psych//lib/psych/class_loader.rb#77
694
- def initialize(classes, symbols); end
695
-
696
- # source://psych//lib/psych/class_loader.rb#83
697
- def symbolize(sym); end
698
-
699
- private
700
-
701
- # source://psych//lib/psych/class_loader.rb#95
702
- def find(klassname); end
703
- end
704
-
705
- # If an object defines +encode_with+, then an instance of Psych::Coder will
706
- # be passed to the method when the object is being serialized. The Coder
707
- # automatically assumes a Psych::Nodes::Mapping is being emitted. Other
708
- # objects like Sequence and Scalar may be emitted if +seq=+ or +scalar=+ are
709
- # called, respectively.
710
- #
711
- # source://psych//lib/psych/coder.rb#9
712
- class Psych::Coder
713
- # @return [Coder] a new instance of Coder
714
- #
715
- # source://psych//lib/psych/coder.rb#13
716
- def initialize(tag); end
717
-
718
- # source://psych//lib/psych/coder.rb#84
719
- def [](k); end
720
-
721
- # source://psych//lib/psych/coder.rb#78
722
- def []=(k, v); end
723
-
724
- # source://psych//lib/psych/coder.rb#78
725
- def add(k, v); end
726
-
727
- # Returns the value of attribute implicit.
728
- #
729
- # source://psych//lib/psych/coder.rb#10
730
- def implicit; end
731
-
732
- # Sets the attribute implicit
733
- #
734
- # @param value the value to set the attribute implicit to.
735
- #
736
- # source://psych//lib/psych/coder.rb#10
737
- def implicit=(_arg0); end
738
-
739
- # Emit a map. The coder will be yielded to the block.
740
- #
741
- # @yield [_self]
742
- # @yieldparam _self [Psych::Coder] the object that the method was called on
743
- #
744
- # source://psych//lib/psych/coder.rb#34
745
- def map(tag = T.unsafe(nil), style = T.unsafe(nil)); end
746
-
747
- # Emit a map with +value+
748
- #
749
- # source://psych//lib/psych/coder.rb#73
750
- def map=(map); end
751
-
752
- # Returns the value of attribute object.
753
- #
754
- # source://psych//lib/psych/coder.rb#10
755
- def object; end
756
-
757
- # Sets the attribute object
758
- #
759
- # @param value the value to set the attribute object to.
760
- #
761
- # source://psych//lib/psych/coder.rb#10
762
- def object=(_arg0); end
763
-
764
- # Emit a sequence with +map+ and +tag+
765
- #
766
- # source://psych//lib/psych/coder.rb#54
767
- def represent_map(tag, map); end
768
-
769
- # Emit an arbitrary object +obj+ and +tag+
770
- #
771
- # source://psych//lib/psych/coder.rb#60
772
- def represent_object(tag, obj); end
773
-
774
- # Emit a scalar with +value+ and +tag+
775
- #
776
- # source://psych//lib/psych/coder.rb#42
777
- def represent_scalar(tag, value); end
778
-
779
- # Emit a sequence with +list+ and +tag+
780
- #
781
- # source://psych//lib/psych/coder.rb#48
782
- def represent_seq(tag, list); end
783
-
784
- # source://psych//lib/psych/coder.rb#24
785
- def scalar(*args); end
786
-
787
- # Emit a scalar with +value+
788
- #
789
- # source://psych//lib/psych/coder.rb#67
790
- def scalar=(value); end
791
-
792
- # Returns the value of attribute seq.
793
- #
794
- # source://psych//lib/psych/coder.rb#11
795
- def seq; end
796
-
797
- # Emit a sequence of +list+
798
- #
799
- # source://psych//lib/psych/coder.rb#90
800
- def seq=(list); end
801
-
802
- # Returns the value of attribute style.
803
- #
804
- # source://psych//lib/psych/coder.rb#10
805
- def style; end
806
-
807
- # Sets the attribute style
808
- #
809
- # @param value the value to set the attribute style to.
810
- #
811
- # source://psych//lib/psych/coder.rb#10
812
- def style=(_arg0); end
813
-
814
- # Returns the value of attribute tag.
815
- #
816
- # source://psych//lib/psych/coder.rb#10
817
- def tag; end
818
-
819
- # Sets the attribute tag
820
- #
821
- # @param value the value to set the attribute tag to.
822
- #
823
- # source://psych//lib/psych/coder.rb#10
824
- def tag=(_arg0); end
825
-
826
- # Returns the value of attribute type.
827
- #
828
- # source://psych//lib/psych/coder.rb#11
829
- def type; end
830
- end
831
-
832
- # source://psych//lib/psych/exception.rb#23
833
- class Psych::DisallowedClass < ::Psych::Exception
834
- # @return [DisallowedClass] a new instance of DisallowedClass
835
- #
836
- # source://psych//lib/psych/exception.rb#24
837
- def initialize(action, klass_name); end
838
- end
839
-
840
- # Psych::Handler is an abstract base class that defines the events used
841
- # when dealing with Psych::Parser. Clients who want to use Psych::Parser
842
- # should implement a class that inherits from Psych::Handler and define
843
- # events that they can handle.
844
- #
845
- # Psych::Handler defines all events that Psych::Parser can possibly send to
846
- # event handlers.
847
- #
848
- # See Psych::Parser for more details
849
- #
850
- # source://psych//lib/psych/handler.rb#13
851
- class Psych::Handler
852
- # Called when an alias is found to +anchor+. +anchor+ will be the name
853
- # of the anchor found.
854
- #
855
- # === Example
856
- #
857
- # Here we have an example of an array that references itself in YAML:
858
- #
859
- # --- &ponies
860
- # - first element
861
- # - *ponies
862
- #
863
- # &ponies is the anchor, *ponies is the alias. In this case, alias is
864
- # called with "ponies".
865
- #
866
- # source://psych//lib/psych/handler.rb#110
867
- def alias(anchor); end
868
-
869
- # Called when an empty event happens. (Which, as far as I can tell, is
870
- # never).
871
- #
872
- # source://psych//lib/psych/handler.rb#236
873
- def empty; end
874
-
875
- # Called with the document ends. +implicit+ is a boolean value indicating
876
- # whether or not the document has an implicit ending.
877
- #
878
- # === Example
879
- #
880
- # Given the following YAML:
881
- #
882
- # ---
883
- # hello world
884
- #
885
- # +implicit+ will be true. Given this YAML:
886
- #
887
- # ---
888
- # hello world
889
- # ...
890
- #
891
- # +implicit+ will be false.
892
- #
893
- # source://psych//lib/psych/handler.rb#93
894
- def end_document(implicit); end
895
-
896
- # Called when a map ends
897
- #
898
- # source://psych//lib/psych/handler.rb#230
899
- def end_mapping; end
900
-
901
- # Called when a sequence ends.
902
- #
903
- # source://psych//lib/psych/handler.rb#191
904
- def end_sequence; end
905
-
906
- # Called when the YAML stream ends
907
- #
908
- # source://psych//lib/psych/handler.rb#241
909
- def end_stream; end
910
-
911
- # Called before each event with line/column information.
912
- #
913
- # source://psych//lib/psych/handler.rb#246
914
- def event_location(start_line, start_column, end_line, end_column); end
915
-
916
- # Called when a scalar +value+ is found. The scalar may have an
917
- # +anchor+, a +tag+, be implicitly +plain+ or implicitly +quoted+
918
- #
919
- # +value+ is the string value of the scalar
920
- # +anchor+ is an associated anchor or nil
921
- # +tag+ is an associated tag or nil
922
- # +plain+ is a boolean value
923
- # +quoted+ is a boolean value
924
- # +style+ is an integer indicating the string style
925
- #
926
- # See the constants in Psych::Nodes::Scalar for the possible values of
927
- # +style+
928
- #
929
- # === Example
930
- #
931
- # Here is a YAML document that exercises most of the possible ways this
932
- # method can be called:
933
- #
934
- # ---
935
- # - !str "foo"
936
- # - &anchor fun
937
- # - many
938
- # lines
939
- # - |
940
- # many
941
- # newlines
942
- #
943
- # The above YAML document contains a list with four strings. Here are
944
- # the parameters sent to this method in the same order:
945
- #
946
- # # value anchor tag plain quoted style
947
- # ["foo", nil, "!str", false, false, 3 ]
948
- # ["fun", "anchor", nil, true, false, 1 ]
949
- # ["many lines", nil, nil, true, false, 1 ]
950
- # ["many\nnewlines\n", nil, nil, false, true, 4 ]
951
- #
952
- # source://psych//lib/psych/handler.rb#150
953
- def scalar(value, anchor, tag, plain, quoted, style); end
954
-
955
- # Called when the document starts with the declared +version+,
956
- # +tag_directives+, if the document is +implicit+.
957
- #
958
- # +version+ will be an array of integers indicating the YAML version being
959
- # dealt with, +tag_directives+ is a list of tuples indicating the prefix
960
- # and suffix of each tag, and +implicit+ is a boolean indicating whether
961
- # the document is started implicitly.
962
- #
963
- # === Example
964
- #
965
- # Given the following YAML:
966
- #
967
- # %YAML 1.1
968
- # %TAG ! tag:tenderlovemaking.com,2009:
969
- # --- !squee
970
- #
971
- # The parameters for start_document must be this:
972
- #
973
- # version # => [1, 1]
974
- # tag_directives # => [["!", "tag:tenderlovemaking.com,2009:"]]
975
- # implicit # => false
976
- #
977
- # source://psych//lib/psych/handler.rb#72
978
- def start_document(version, tag_directives, implicit); end
979
-
980
- # Called when a map starts.
981
- #
982
- # +anchor+ is the anchor associated with the map or +nil+.
983
- # +tag+ is the tag associated with the map or +nil+.
984
- # +implicit+ is a boolean indicating whether or not the map was implicitly
985
- # started.
986
- # +style+ is an integer indicating the mapping style.
987
- #
988
- # See the constants in Psych::Nodes::Mapping for the possible values of
989
- # +style+.
990
- #
991
- # === Example
992
- #
993
- # Here is a YAML document that exercises most of the possible ways this
994
- # method can be called:
995
- #
996
- # ---
997
- # k: !!map { hello: world }
998
- # v: &pewpew
999
- # hello: world
1000
- #
1001
- # The above YAML document consists of three maps, an outer map that contains
1002
- # two inner maps. Below is a matrix of the parameters sent in order to
1003
- # represent these three maps:
1004
- #
1005
- # # anchor tag implicit style
1006
- # [nil, nil, true, 1 ]
1007
- # [nil, "tag:yaml.org,2002:map", false, 2 ]
1008
- # ["pewpew", nil, true, 1 ]
1009
- #
1010
- # source://psych//lib/psych/handler.rb#225
1011
- def start_mapping(anchor, tag, implicit, style); end
1012
-
1013
- # Called when a sequence is started.
1014
- #
1015
- # +anchor+ is the anchor associated with the sequence or nil.
1016
- # +tag+ is the tag associated with the sequence or nil.
1017
- # +implicit+ a boolean indicating whether or not the sequence was implicitly
1018
- # started.
1019
- # +style+ is an integer indicating the list style.
1020
- #
1021
- # See the constants in Psych::Nodes::Sequence for the possible values of
1022
- # +style+.
1023
- #
1024
- # === Example
1025
- #
1026
- # Here is a YAML document that exercises most of the possible ways this
1027
- # method can be called:
1028
- #
1029
- # ---
1030
- # - !!seq [
1031
- # a
1032
- # ]
1033
- # - &pewpew
1034
- # - b
1035
- #
1036
- # The above YAML document consists of three lists, an outer list that
1037
- # contains two inner lists. Here is a matrix of the parameters sent
1038
- # to represent these lists:
1039
- #
1040
- # # anchor tag implicit style
1041
- # [nil, nil, true, 1 ]
1042
- # [nil, "tag:yaml.org,2002:seq", false, 2 ]
1043
- # ["pewpew", nil, true, 1 ]
1044
- #
1045
- # source://psych//lib/psych/handler.rb#186
1046
- def start_sequence(anchor, tag, implicit, style); end
1047
-
1048
- # Called with +encoding+ when the YAML stream starts. This method is
1049
- # called once per stream. A stream may contain multiple documents.
1050
- #
1051
- # See the constants in Psych::Parser for the possible values of +encoding+.
1052
- #
1053
- # source://psych//lib/psych/handler.rb#47
1054
- def start_stream(encoding); end
1055
-
1056
- # Is this handler a streaming handler?
1057
- #
1058
- # @return [Boolean]
1059
- #
1060
- # source://psych//lib/psych/handler.rb#251
1061
- def streaming?; end
1062
- end
1063
-
1064
- # Configuration options for dumping YAML.
1065
- #
1066
- # source://psych//lib/psych/handler.rb#16
1067
- class Psych::Handler::DumperOptions
1068
- # @return [DumperOptions] a new instance of DumperOptions
1069
- #
1070
- # source://psych//lib/psych/handler.rb#19
1071
- def initialize; end
1072
-
1073
- # Returns the value of attribute canonical.
1074
- #
1075
- # source://psych//lib/psych/handler.rb#17
1076
- def canonical; end
1077
-
1078
- # Sets the attribute canonical
1079
- #
1080
- # @param value the value to set the attribute canonical to.
1081
- #
1082
- # source://psych//lib/psych/handler.rb#17
1083
- def canonical=(_arg0); end
1084
-
1085
- # Returns the value of attribute indentation.
1086
- #
1087
- # source://psych//lib/psych/handler.rb#17
1088
- def indentation; end
1089
-
1090
- # Sets the attribute indentation
1091
- #
1092
- # @param value the value to set the attribute indentation to.
1093
- #
1094
- # source://psych//lib/psych/handler.rb#17
1095
- def indentation=(_arg0); end
1096
-
1097
- # Returns the value of attribute line_width.
1098
- #
1099
- # source://psych//lib/psych/handler.rb#17
1100
- def line_width; end
1101
-
1102
- # Sets the attribute line_width
1103
- #
1104
- # @param value the value to set the attribute line_width to.
1105
- #
1106
- # source://psych//lib/psych/handler.rb#17
1107
- def line_width=(_arg0); end
1108
- end
1109
-
1110
- # source://psych//lib/psych/json/stream.rb#7
1111
- class Psych::JSON::Stream < ::Psych::Visitors::JSONTree
1112
- include ::Psych::Streaming
1113
- extend ::Psych::Streaming::ClassMethods
1114
- end
1115
-
1116
- # YAML event parser class. This class parses a YAML document and calls
1117
- # events on the handler that is passed to the constructor. The events can
1118
- # be used for things such as constructing a YAML AST or deserializing YAML
1119
- # documents. It can even be fed back to Psych::Emitter to emit the same
1120
- # document that was parsed.
1121
- #
1122
- # See Psych::Handler for documentation on the events that Psych::Parser emits.
1123
- #
1124
- # Here is an example that prints out ever scalar found in a YAML document:
1125
- #
1126
- # # Handler for detecting scalar values
1127
- # class ScalarHandler < Psych::Handler
1128
- # def scalar value, anchor, tag, plain, quoted, style
1129
- # puts value
1130
- # end
1131
- # end
1132
- #
1133
- # parser = Psych::Parser.new(ScalarHandler.new)
1134
- # parser.parse(yaml_document)
1135
- #
1136
- # Here is an example that feeds the parser back in to Psych::Emitter. The
1137
- # YAML document is read from STDIN and written back out to STDERR:
1138
- #
1139
- # parser = Psych::Parser.new(Psych::Emitter.new($stderr))
1140
- # parser.parse($stdin)
1141
- #
1142
- # Psych uses Psych::Parser in combination with Psych::TreeBuilder to
1143
- # construct an AST of the parsed YAML document.
1144
- #
1145
- # source://psych//lib/psych/parser.rb#33
1146
- class Psych::Parser
1147
- # Creates a new Psych::Parser instance with +handler+. YAML events will
1148
- # be called on +handler+. See Psych::Parser for more details.
1149
- #
1150
- # @return [Parser] a new instance of Parser
1151
- #
1152
- # source://psych//lib/psych/parser.rb#47
1153
- def initialize(handler = T.unsafe(nil)); end
1154
-
1155
- # Set the encoding for this parser to +encoding+
1156
- #
1157
- # source://psych//lib/psych/parser.rb#41
1158
- def external_encoding=(_arg0); end
1159
-
1160
- # The handler on which events will be called
1161
- #
1162
- # source://psych//lib/psych/parser.rb#38
1163
- def handler; end
1164
-
1165
- # The handler on which events will be called
1166
- #
1167
- # source://psych//lib/psych/parser.rb#38
1168
- def handler=(_arg0); end
1169
-
1170
- # call-seq:
1171
- # parser.parse(yaml)
1172
- #
1173
- # Parse the YAML document contained in +yaml+. Events will be called on
1174
- # the handler set on the parser instance.
1175
- #
1176
- # See Psych::Parser and Psych::Parser#handler
1177
- #
1178
- # source://psych//lib/psych/parser.rb#61
1179
- def parse(yaml, path = T.unsafe(nil)); end
1180
- end
1181
-
1182
- # Scan scalars for built in types
1183
- #
1184
- # source://psych//lib/psych/scalar_scanner.rb#6
1185
- class Psych::ScalarScanner
1186
- # Create a new scanner
1187
- #
1188
- # @return [ScalarScanner] a new instance of ScalarScanner
1189
- #
1190
- # source://psych//lib/psych/scalar_scanner.rb#30
1191
- def initialize(class_loader, strict_integer: T.unsafe(nil)); end
1192
-
1193
- # Returns the value of attribute class_loader.
1194
- #
1195
- # source://psych//lib/psych/scalar_scanner.rb#27
1196
- def class_loader; end
1197
-
1198
- # Parse and return an int from +string+
1199
- #
1200
- # source://psych//lib/psych/scalar_scanner.rb#109
1201
- def parse_int(string); end
1202
-
1203
- # Parse and return a Time from +string+
1204
- #
1205
- # source://psych//lib/psych/scalar_scanner.rb#115
1206
- def parse_time(string); end
1207
-
1208
- # Tokenize +string+ returning the Ruby object
1209
- #
1210
- # source://psych//lib/psych/scalar_scanner.rb#37
1211
- def tokenize(string); end
1212
- end
1213
-
1214
- # Same as above, but allows commas.
1215
- # Not to YML spec, but kept for backwards compatibility
1216
- #
1217
- # source://psych//lib/psych/scalar_scanner.rb#22
1218
- Psych::ScalarScanner::INTEGER_LEGACY = T.let(T.unsafe(nil), Regexp)
1219
-
1220
- # Taken from http://yaml.org/type/int.html
1221
- #
1222
- # source://psych//lib/psych/scalar_scanner.rb#15
1223
- Psych::ScalarScanner::INTEGER_STRICT = T.let(T.unsafe(nil), Regexp)
1224
-
1225
- # Psych::Stream is a streaming YAML emitter. It will not buffer your YAML,
1226
- # but send it straight to an IO.
1227
- #
1228
- # Here is an example use:
1229
- #
1230
- # stream = Psych::Stream.new($stdout)
1231
- # stream.start
1232
- # stream.push({:foo => 'bar'})
1233
- # stream.finish
1234
- #
1235
- # YAML will be immediately emitted to $stdout with no buffering.
1236
- #
1237
- # Psych::Stream#start will take a block and ensure that Psych::Stream#finish
1238
- # is called, so you can do this form:
1239
- #
1240
- # stream = Psych::Stream.new($stdout)
1241
- # stream.start do |em|
1242
- # em.push(:foo => 'bar')
1243
- # end
1244
- #
1245
- # source://psych//lib/psych/stream.rb#24
1246
- class Psych::Stream < ::Psych::Visitors::YAMLTree
1247
- include ::Psych::Streaming
1248
- extend ::Psych::Streaming::ClassMethods
1249
- end
1250
-
1251
- # source://psych//lib/psych/stream.rb#25
1252
- class Psych::Stream::Emitter < ::Psych::Emitter
1253
- # source://psych//lib/psych/stream.rb#26
1254
- def end_document(implicit_end = T.unsafe(nil)); end
1255
-
1256
- # @return [Boolean]
1257
- #
1258
- # source://psych//lib/psych/stream.rb#30
1259
- def streaming?; end
1260
- end
1261
-
1262
- # source://psych//lib/psych/streaming.rb#3
1263
- module Psych::Streaming
1264
- # Start streaming using +encoding+
1265
- #
1266
- # source://psych//lib/psych/streaming.rb#18
1267
- def start(encoding = T.unsafe(nil)); end
1268
-
1269
- private
1270
-
1271
- # source://psych//lib/psych/streaming.rb#25
1272
- def register(target, obj); end
1273
- end
1274
-
1275
- # source://psych//lib/psych/streaming.rb#4
1276
- module Psych::Streaming::ClassMethods
1277
- # Create a new streaming emitter. Emitter will print to +io+. See
1278
- # Psych::Stream for an example.
1279
- #
1280
- # source://psych//lib/psych/streaming.rb#8
1281
- def new(io); end
1282
- end
1283
-
1284
- # source://psych//lib/psych/syntax_error.rb#5
1285
- class Psych::SyntaxError < ::Psych::Exception
1286
- # @return [SyntaxError] a new instance of SyntaxError
1287
- #
1288
- # source://psych//lib/psych/syntax_error.rb#8
1289
- def initialize(file, line, col, offset, problem, context); end
1290
-
1291
- # Returns the value of attribute column.
1292
- #
1293
- # source://psych//lib/psych/syntax_error.rb#6
1294
- def column; end
1295
-
1296
- # Returns the value of attribute context.
1297
- #
1298
- # source://psych//lib/psych/syntax_error.rb#6
1299
- def context; end
1300
-
1301
- # Returns the value of attribute file.
1302
- #
1303
- # source://psych//lib/psych/syntax_error.rb#6
1304
- def file; end
1305
-
1306
- # Returns the value of attribute line.
1307
- #
1308
- # source://psych//lib/psych/syntax_error.rb#6
1309
- def line; end
1310
-
1311
- # Returns the value of attribute offset.
1312
- #
1313
- # source://psych//lib/psych/syntax_error.rb#6
1314
- def offset; end
1315
-
1316
- # Returns the value of attribute problem.
1317
- #
1318
- # source://psych//lib/psych/syntax_error.rb#6
1319
- def problem; end
1320
- end
1321
-
1322
- # This class works in conjunction with Psych::Parser to build an in-memory
1323
- # parse tree that represents a YAML document.
1324
- #
1325
- # == Example
1326
- #
1327
- # parser = Psych::Parser.new Psych::TreeBuilder.new
1328
- # parser.parse('--- foo')
1329
- # tree = parser.handler.root
1330
- #
1331
- # See Psych::Handler for documentation on the event methods used in this
1332
- # class.
1333
- #
1334
- # source://psych//lib/psych/tree_builder.rb#17
1335
- class Psych::TreeBuilder < ::Psych::Handler
1336
- # Create a new TreeBuilder instance
1337
- #
1338
- # @return [TreeBuilder] a new instance of TreeBuilder
1339
- #
1340
- # source://psych//lib/psych/tree_builder.rb#22
1341
- def initialize; end
1342
-
1343
- # source://psych//lib/psych/tree_builder.rb#103
1344
- def alias(anchor); end
1345
-
1346
- # Handles end_document events with +version+, +tag_directives+,
1347
- # and +implicit+ styling.
1348
- #
1349
- # See Psych::Handler#start_document
1350
- #
1351
- # source://psych//lib/psych/tree_builder.rb#77
1352
- def end_document(implicit_end = T.unsafe(nil)); end
1353
-
1354
- # source://psych//lib/psych/tree_builder.rb#52
1355
- def end_mapping; end
1356
-
1357
- # source://psych//lib/psych/tree_builder.rb#52
1358
- def end_sequence; end
1359
-
1360
- # source://psych//lib/psych/tree_builder.rb#90
1361
- def end_stream; end
1362
-
1363
- # source://psych//lib/psych/tree_builder.rb#33
1364
- def event_location(start_line, start_column, end_line, end_column); end
1365
-
1366
- # Returns the root node for the built tree
1367
- #
1368
- # source://psych//lib/psych/tree_builder.rb#19
1369
- def root; end
1370
-
1371
- # source://psych//lib/psych/tree_builder.rb#96
1372
- def scalar(value, anchor, tag, plain, quoted, style); end
1373
-
1374
- # Handles start_document events with +version+, +tag_directives+,
1375
- # and +implicit+ styling.
1376
- #
1377
- # See Psych::Handler#start_document
1378
- #
1379
- # source://psych//lib/psych/tree_builder.rb#65
1380
- def start_document(version, tag_directives, implicit); end
1381
-
1382
- # source://psych//lib/psych/tree_builder.rb#45
1383
- def start_mapping(anchor, tag, implicit, style); end
1384
-
1385
- # source://psych//lib/psych/tree_builder.rb#45
1386
- def start_sequence(anchor, tag, implicit, style); end
1387
-
1388
- # source://psych//lib/psych/tree_builder.rb#84
1389
- def start_stream(encoding); end
1390
-
1391
- private
1392
-
1393
- # source://psych//lib/psych/tree_builder.rb#116
1394
- def pop; end
1395
-
1396
- # source://psych//lib/psych/tree_builder.rb#111
1397
- def push(value); end
1398
-
1399
- # source://psych//lib/psych/tree_builder.rb#132
1400
- def set_end_location(node); end
1401
-
1402
- # source://psych//lib/psych/tree_builder.rb#122
1403
- def set_location(node); end
1404
-
1405
- # source://psych//lib/psych/tree_builder.rb#127
1406
- def set_start_location(node); end
1407
- end
1408
-
1409
- # The version of Psych you are using
1410
- #
1411
- # source://psych//lib/psych/versions.rb#5
1412
- Psych::VERSION = T.let(T.unsafe(nil), String)
1413
-
1414
- # source://psych//lib/psych/visitors/depth_first.rb#4
1415
- class Psych::Visitors::DepthFirst < ::Psych::Visitors::Visitor
1416
- # @return [DepthFirst] a new instance of DepthFirst
1417
- #
1418
- # source://psych//lib/psych/visitors/depth_first.rb#5
1419
- def initialize(block); end
1420
-
1421
- private
1422
-
1423
- # source://psych//lib/psych/visitors/depth_first.rb#11
1424
- def nary(o); end
1425
-
1426
- # source://psych//lib/psych/visitors/depth_first.rb#20
1427
- def terminal(o); end
1428
-
1429
- # source://psych//lib/psych/visitors/depth_first.rb#20
1430
- def visit_Psych_Nodes_Alias(o); end
1431
-
1432
- # source://psych//lib/psych/visitors/depth_first.rb#11
1433
- def visit_Psych_Nodes_Document(o); end
1434
-
1435
- # source://psych//lib/psych/visitors/depth_first.rb#11
1436
- def visit_Psych_Nodes_Mapping(o); end
1437
-
1438
- # source://psych//lib/psych/visitors/depth_first.rb#20
1439
- def visit_Psych_Nodes_Scalar(o); end
1440
-
1441
- # source://psych//lib/psych/visitors/depth_first.rb#11
1442
- def visit_Psych_Nodes_Sequence(o); end
1443
-
1444
- # source://psych//lib/psych/visitors/depth_first.rb#11
1445
- def visit_Psych_Nodes_Stream(o); end
1446
- end
1447
-
1448
- # source://psych//lib/psych/visitors/yaml_tree.rb#541
1449
- class Psych::Visitors::RestrictedYAMLTree < ::Psych::Visitors::YAMLTree
1450
- # @return [RestrictedYAMLTree] a new instance of RestrictedYAMLTree
1451
- #
1452
- # source://psych//lib/psych/visitors/yaml_tree.rb#553
1453
- def initialize(emitter, ss, options); end
1454
-
1455
- # source://psych//lib/psych/visitors/yaml_tree.rb#566
1456
- def accept(target); end
1457
-
1458
- # source://psych//lib/psych/visitors/yaml_tree.rb#578
1459
- def visit_Symbol(sym); end
1460
- end
1461
-
1462
- # source://psych//lib/psych/visitors/yaml_tree.rb#542
1463
- Psych::Visitors::RestrictedYAMLTree::DEFAULT_PERMITTED_CLASSES = T.let(T.unsafe(nil), Hash)
1464
-
1465
- # This class walks a YAML AST, converting each node to Ruby
1466
- #
1467
- # source://psych//lib/psych/visitors/to_ruby.rb#14
1468
- class Psych::Visitors::ToRuby < ::Psych::Visitors::Visitor
1469
- # @return [ToRuby] a new instance of ToRuby
1470
- #
1471
- # source://psych//lib/psych/visitors/to_ruby.rb#23
1472
- def initialize(ss, class_loader, symbolize_names: T.unsafe(nil), freeze: T.unsafe(nil)); end
1473
-
1474
- # source://psych//lib/psych/visitors/to_ruby.rb#34
1475
- def accept(target); end
1476
-
1477
- # Returns the value of attribute class_loader.
1478
- #
1479
- # source://psych//lib/psych/visitors/to_ruby.rb#21
1480
- def class_loader; end
1481
-
1482
- # source://psych//lib/psych/visitors/to_ruby.rb#327
1483
- def visit_Psych_Nodes_Alias(o); end
1484
-
1485
- # source://psych//lib/psych/visitors/to_ruby.rb#319
1486
- def visit_Psych_Nodes_Document(o); end
1487
-
1488
- # source://psych//lib/psych/visitors/to_ruby.rb#165
1489
- def visit_Psych_Nodes_Mapping(o); end
1490
-
1491
- # source://psych//lib/psych/visitors/to_ruby.rb#129
1492
- def visit_Psych_Nodes_Scalar(o); end
1493
-
1494
- # source://psych//lib/psych/visitors/to_ruby.rb#133
1495
- def visit_Psych_Nodes_Sequence(o); end
1496
-
1497
- # source://psych//lib/psych/visitors/to_ruby.rb#323
1498
- def visit_Psych_Nodes_Stream(o); end
1499
-
1500
- private
1501
-
1502
- # source://psych//lib/psych/visitors/to_ruby.rb#395
1503
- def deduplicate(key); end
1504
-
1505
- # source://psych//lib/psych/visitors/to_ruby.rb#51
1506
- def deserialize(o); end
1507
-
1508
- # source://psych//lib/psych/visitors/to_ruby.rb#412
1509
- def init_with(o, h, node); end
1510
-
1511
- # source://psych//lib/psych/visitors/to_ruby.rb#404
1512
- def merge_key(hash, key, val); end
1513
-
1514
- # source://psych//lib/psych/visitors/to_ruby.rb#333
1515
- def register(node, object); end
1516
-
1517
- # source://psych//lib/psych/visitors/to_ruby.rb#338
1518
- def register_empty(object); end
1519
-
1520
- # Convert +klassname+ to a Class
1521
- #
1522
- # source://psych//lib/psych/visitors/to_ruby.rb#425
1523
- def resolve_class(klassname); end
1524
-
1525
- # source://psych//lib/psych/visitors/to_ruby.rb#407
1526
- def revive(klass, node); end
1527
-
1528
- # source://psych//lib/psych/visitors/to_ruby.rb#344
1529
- def revive_hash(hash, o, tagged = T.unsafe(nil)); end
1530
-
1531
- class << self
1532
- # source://psych//lib/psych/visitors/to_ruby.rb#15
1533
- def create(symbolize_names: T.unsafe(nil), freeze: T.unsafe(nil), strict_integer: T.unsafe(nil)); end
1534
- end
1535
- end
1536
-
1537
- # source://psych//lib/psych/visitors/visitor.rb#4
1538
- class Psych::Visitors::Visitor
1539
- # source://psych//lib/psych/visitors/visitor.rb#5
1540
- def accept(target); end
1541
-
1542
- private
1543
-
1544
- # source://psych//lib/psych/visitors/visitor.rb#19
1545
- def dispatch; end
1546
-
1547
- # source://psych//lib/psych/visitors/visitor.rb#29
1548
- def visit(target); end
1549
-
1550
- class << self
1551
- # @api private
1552
- #
1553
- # source://psych//lib/psych/visitors/visitor.rb#12
1554
- def dispatch_cache; end
1555
- end
1556
- end
1557
-
1558
- # YAMLTree builds a YAML ast given a Ruby object. For example:
1559
- #
1560
- # builder = Psych::Visitors::YAMLTree.new
1561
- # builder << { :foo => 'bar' }
1562
- # builder.tree # => #<Psych::Nodes::Stream .. }
1563
- #
1564
- # source://psych//lib/psych/visitors/yaml_tree.rb#15
1565
- class Psych::Visitors::YAMLTree < ::Psych::Visitors::Visitor
1566
- # @return [YAMLTree] a new instance of YAMLTree
1567
- #
1568
- # source://psych//lib/psych/visitors/yaml_tree.rb#56
1569
- def initialize(emitter, ss, options); end
1570
-
1571
- # source://psych//lib/psych/visitors/yaml_tree.rb#103
1572
- def <<(object); end
1573
-
1574
- # source://psych//lib/psych/visitors/yaml_tree.rb#123
1575
- def accept(target); end
1576
-
1577
- # source://psych//lib/psych/visitors/yaml_tree.rb#92
1578
- def finish; end
1579
-
1580
- # Returns the value of attribute finished.
1581
- #
1582
- # source://psych//lib/psych/visitors/yaml_tree.rb#45
1583
- def finished; end
1584
-
1585
- # Returns the value of attribute finished.
1586
- #
1587
- # source://psych//lib/psych/visitors/yaml_tree.rb#45
1588
- def finished?; end
1589
-
1590
- # source://psych//lib/psych/visitors/yaml_tree.rb#103
1591
- def push(object); end
1592
-
1593
- # source://psych//lib/psych/visitors/yaml_tree.rb#86
1594
- def start(encoding = T.unsafe(nil)); end
1595
-
1596
- # Returns the value of attribute started.
1597
- #
1598
- # source://psych//lib/psych/visitors/yaml_tree.rb#45
1599
- def started; end
1600
-
1601
- # Returns the value of attribute started.
1602
- #
1603
- # source://psych//lib/psych/visitors/yaml_tree.rb#45
1604
- def started?; end
1605
-
1606
- # source://psych//lib/psych/visitors/yaml_tree.rb#98
1607
- def tree; end
1608
-
1609
- # source://psych//lib/psych/visitors/yaml_tree.rb#351
1610
- def visit_Array(o); end
1611
-
1612
- # source://psych//lib/psych/visitors/yaml_tree.rb#377
1613
- def visit_BasicObject(o); end
1614
-
1615
- # source://psych//lib/psych/visitors/yaml_tree.rb#251
1616
- def visit_BigDecimal(o); end
1617
-
1618
- # @raise [TypeError]
1619
- #
1620
- # source://psych//lib/psych/visitors/yaml_tree.rb#314
1621
- def visit_Class(o); end
1622
-
1623
- # source://psych//lib/psych/visitors/yaml_tree.rb#224
1624
- def visit_Complex(o); end
1625
-
1626
- # source://psych//lib/psych/visitors/yaml_tree.rb#195
1627
- def visit_Date(o); end
1628
-
1629
- # source://psych//lib/psych/visitors/yaml_tree.rb#199
1630
- def visit_DateTime(o); end
1631
-
1632
- # source://psych//lib/psych/visitors/yaml_tree.rb#153
1633
- def visit_Delegator(o); end
1634
-
1635
- # source://psych//lib/psych/visitors/yaml_tree.rb#148
1636
- def visit_Encoding(o); end
1637
-
1638
- # source://psych//lib/psych/visitors/yaml_tree.rb#359
1639
- def visit_Enumerator(o); end
1640
-
1641
- # source://psych//lib/psych/visitors/yaml_tree.rb#183
1642
- def visit_Exception(o); end
1643
-
1644
- # source://psych//lib/psych/visitors/yaml_tree.rb#234
1645
- def visit_FalseClass(o); end
1646
-
1647
- # source://psych//lib/psych/visitors/yaml_tree.rb#240
1648
- def visit_Float(o); end
1649
-
1650
- # source://psych//lib/psych/visitors/yaml_tree.rb#327
1651
- def visit_Hash(o); end
1652
-
1653
- # source://psych//lib/psych/visitors/yaml_tree.rb#234
1654
- def visit_Integer(o); end
1655
-
1656
- # @raise [TypeError]
1657
- #
1658
- # source://psych//lib/psych/visitors/yaml_tree.rb#309
1659
- def visit_Module(o); end
1660
-
1661
- # source://psych//lib/psych/visitors/yaml_tree.rb#187
1662
- def visit_NameError(o); end
1663
-
1664
- # source://psych//lib/psych/visitors/yaml_tree.rb#365
1665
- def visit_NilClass(o); end
1666
-
1667
- # source://psych//lib/psych/visitors/yaml_tree.rb#153
1668
- def visit_Object(o); end
1669
-
1670
- # source://psych//lib/psych/visitors/yaml_tree.rb#140
1671
- def visit_Psych_Omap(o); end
1672
-
1673
- # source://psych//lib/psych/visitors/yaml_tree.rb#340
1674
- def visit_Psych_Set(o); end
1675
-
1676
- # source://psych//lib/psych/visitors/yaml_tree.rb#319
1677
- def visit_Range(o); end
1678
-
1679
- # source://psych//lib/psych/visitors/yaml_tree.rb#211
1680
- def visit_Rational(o); end
1681
-
1682
- # source://psych//lib/psych/visitors/yaml_tree.rb#191
1683
- def visit_Regexp(o); end
1684
-
1685
- # source://psych//lib/psych/visitors/yaml_tree.rb#255
1686
- def visit_String(o); end
1687
-
1688
- # source://psych//lib/psych/visitors/yaml_tree.rb#169
1689
- def visit_Struct(o); end
1690
-
1691
- # source://psych//lib/psych/visitors/yaml_tree.rb#369
1692
- def visit_Symbol(o); end
1693
-
1694
- # source://psych//lib/psych/visitors/yaml_tree.rb#206
1695
- def visit_Time(o); end
1696
-
1697
- # source://psych//lib/psych/visitors/yaml_tree.rb#234
1698
- def visit_TrueClass(o); end
1699
-
1700
- private
1701
-
1702
- # @return [Boolean]
1703
- #
1704
- # source://psych//lib/psych/visitors/yaml_tree.rb#391
1705
- def binary?(string); end
1706
-
1707
- # source://psych//lib/psych/visitors/yaml_tree.rb#498
1708
- def dump_coder(o); end
1709
-
1710
- # source://psych//lib/psych/visitors/yaml_tree.rb#467
1711
- def dump_exception(o, msg); end
1712
-
1713
- # source://psych//lib/psych/visitors/yaml_tree.rb#533
1714
- def dump_ivars(target); end
1715
-
1716
- # source://psych//lib/psych/visitors/yaml_tree.rb#464
1717
- def dump_list(o); end
1718
-
1719
- # source://psych//lib/psych/visitors/yaml_tree.rb#511
1720
- def emit_coder(c, o); end
1721
-
1722
- # source://psych//lib/psych/visitors/yaml_tree.rb#485
1723
- def format_time(time, utc = T.unsafe(nil)); end
1724
-
1725
- # source://psych//lib/psych/visitors/yaml_tree.rb#493
1726
- def register(target, yaml_obj); end
1727
-
1728
- # source://psych//lib/psych/visitors/yaml_tree.rb#395
1729
- def visit_array_subclass(o); end
1730
-
1731
- # source://psych//lib/psych/visitors/yaml_tree.rb#426
1732
- def visit_hash_subclass(o); end
1733
-
1734
- class << self
1735
- # source://psych//lib/psych/visitors/yaml_tree.rb#49
1736
- def create(options = T.unsafe(nil), emitter = T.unsafe(nil)); end
1737
- end
1738
- end
1739
-
1740
- # source://psych//lib/psych/visitors/yaml_tree.rb#16
1741
- class Psych::Visitors::YAMLTree::Registrar
1742
- # @return [Registrar] a new instance of Registrar
1743
- #
1744
- # source://psych//lib/psych/visitors/yaml_tree.rb#17
1745
- def initialize; end
1746
-
1747
- # source://psych//lib/psych/visitors/yaml_tree.rb#36
1748
- def id_for(target); end
1749
-
1750
- # @return [Boolean]
1751
- #
1752
- # source://psych//lib/psych/visitors/yaml_tree.rb#30
1753
- def key?(target); end
1754
-
1755
- # source://psych//lib/psych/visitors/yaml_tree.rb#40
1756
- def node_for(target); end
1757
-
1758
- # source://psych//lib/psych/visitors/yaml_tree.rb#24
1759
- def register(target, node); end
1760
- end