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