active_cached_resource 0.1.0 → 0.1.1

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