acts-as-messageable 0.5.0 → 1.0.0

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