ory-client 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (419) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/Gemfile.lock +3 -2
  4. data/README.md +5 -5
  5. data/lib/ory-client/api/courier_api.rb +1 -1
  6. data/lib/ory-client/api/frontend_api.rb +1 -1
  7. data/lib/ory-client/api/identity_api.rb +1 -1
  8. data/lib/ory-client/api/jwk_api.rb +1 -1
  9. data/lib/ory-client/api/metadata_api.rb +1 -1
  10. data/lib/ory-client/api/o_auth2_api.rb +1 -1
  11. data/lib/ory-client/api/oidc_api.rb +1 -1
  12. data/lib/ory-client/api/permission_api.rb +1 -1
  13. data/lib/ory-client/api/project_api.rb +1 -1
  14. data/lib/ory-client/api/relationship_api.rb +1 -1
  15. data/lib/ory-client/api/wellknown_api.rb +1 -1
  16. data/lib/ory-client/api_client.rb +1 -1
  17. data/lib/ory-client/api_error.rb +1 -1
  18. data/lib/ory-client/configuration.rb +1 -1
  19. data/lib/ory-client/models/accept_o_auth2_consent_request.rb +1 -1
  20. data/lib/ory-client/models/accept_o_auth2_consent_request_session.rb +1 -1
  21. data/lib/ory-client/models/accept_o_auth2_login_request.rb +1 -1
  22. data/lib/ory-client/models/active_project_in_console.rb +1 -1
  23. data/lib/ory-client/models/authenticator_assurance_level.rb +1 -1
  24. data/lib/ory-client/models/check_opl_syntax_result.rb +1 -1
  25. data/lib/ory-client/models/check_permission_result.rb +1 -1
  26. data/lib/ory-client/models/cloud_account.rb +1 -1
  27. data/lib/ory-client/models/courier_message_status.rb +1 -1
  28. data/lib/ory-client/models/courier_message_type.rb +1 -1
  29. data/lib/ory-client/models/create_custom_domain_body.rb +1 -1
  30. data/lib/ory-client/models/create_identity_body.rb +1 -1
  31. data/lib/ory-client/models/create_json_web_key_set.rb +1 -1
  32. data/lib/ory-client/models/create_project_api_key_request.rb +1 -1
  33. data/lib/ory-client/models/create_project_body.rb +1 -1
  34. data/lib/ory-client/models/create_project_invite.rb +1 -1
  35. data/lib/ory-client/models/create_recovery_code_for_identity_body.rb +1 -1
  36. data/lib/ory-client/models/create_recovery_link_for_identity_body.rb +1 -1
  37. data/lib/ory-client/models/create_relationship_body.rb +1 -1
  38. data/lib/ory-client/models/create_subscription_body.rb +1 -1
  39. data/lib/ory-client/models/custom_domain.rb +1 -1
  40. data/lib/ory-client/models/custom_domain_quota.rb +1 -1
  41. data/lib/ory-client/models/delete_my_sessions_count.rb +1 -1
  42. data/lib/ory-client/models/error_authenticator_assurance_level_not_satisfied.rb +1 -1
  43. data/lib/ory-client/models/error_browser_location_change_required.rb +1 -1
  44. data/lib/ory-client/models/error_flow_replaced.rb +1 -1
  45. data/lib/ory-client/models/error_generic.rb +1 -1
  46. data/lib/ory-client/models/error_o_auth2.rb +1 -1
  47. data/lib/ory-client/models/expanded_permission_tree.rb +1 -1
  48. data/lib/ory-client/models/flow_error.rb +1 -1
  49. data/lib/ory-client/models/generic_error.rb +1 -1
  50. data/lib/ory-client/models/generic_error_content.rb +1 -1
  51. data/lib/ory-client/models/get_managed_identity_schema_location.rb +1 -1
  52. data/lib/ory-client/models/get_version200_response.rb +1 -1
  53. data/lib/ory-client/models/health_not_ready_status.rb +1 -1
  54. data/lib/ory-client/models/health_status.rb +1 -1
  55. data/lib/ory-client/models/identity.rb +1 -1
  56. data/lib/ory-client/models/identity_credentials.rb +1 -1
  57. data/lib/ory-client/models/identity_credentials_oidc.rb +1 -1
  58. data/lib/ory-client/models/identity_credentials_oidc_provider.rb +1 -1
  59. data/lib/ory-client/models/identity_credentials_password.rb +1 -1
  60. data/lib/ory-client/models/identity_credentials_type.rb +1 -1
  61. data/lib/ory-client/models/identity_schema_container.rb +1 -1
  62. data/lib/ory-client/models/identity_schema_preset.rb +1 -1
  63. data/lib/ory-client/models/identity_state.rb +1 -1
  64. data/lib/ory-client/models/identity_with_credentials.rb +1 -1
  65. data/lib/ory-client/models/identity_with_credentials_oidc.rb +1 -1
  66. data/lib/ory-client/models/identity_with_credentials_oidc_config.rb +1 -1
  67. data/lib/ory-client/models/identity_with_credentials_oidc_config_provider.rb +1 -1
  68. data/lib/ory-client/models/identity_with_credentials_password.rb +1 -1
  69. data/lib/ory-client/models/identity_with_credentials_password_config.rb +1 -1
  70. data/lib/ory-client/models/internal_is_owner_for_project_by_slug_body.rb +1 -1
  71. data/lib/ory-client/models/internal_provision_mock_subscription.rb +1 -1
  72. data/lib/ory-client/models/introspected_o_auth2_token.rb +1 -1
  73. data/lib/ory-client/models/invite_quota.rb +1 -1
  74. data/lib/ory-client/models/is_owner_for_project_by_slug.rb +1 -1
  75. data/lib/ory-client/models/is_ready200_response.rb +1 -1
  76. data/lib/ory-client/models/is_ready503_response.rb +1 -1
  77. data/lib/ory-client/models/json_patch.rb +1 -1
  78. data/lib/ory-client/models/json_web_key.rb +1 -1
  79. data/lib/ory-client/models/json_web_key_set.rb +1 -1
  80. data/lib/ory-client/models/keto_namespace.rb +1 -1
  81. data/lib/ory-client/models/login_flow.rb +1 -1
  82. data/lib/ory-client/models/logout_flow.rb +1 -1
  83. data/lib/ory-client/models/managed_identity_schema.rb +1 -1
  84. data/lib/ory-client/models/managed_identity_schema_validation_result.rb +1 -1
  85. data/lib/ory-client/models/message.rb +1 -1
  86. data/lib/ory-client/models/namespace.rb +1 -1
  87. data/lib/ory-client/models/needs_privileged_session_error.rb +1 -1
  88. data/lib/ory-client/models/normalized_project.rb +1 -1
  89. data/lib/ory-client/models/normalized_project_revision.rb +1 -1
  90. data/lib/ory-client/models/normalized_project_revision_hook.rb +1 -1
  91. data/lib/ory-client/models/normalized_project_revision_identity_schema.rb +1 -1
  92. data/lib/ory-client/models/normalized_project_revision_third_party_provider.rb +1 -1
  93. data/lib/ory-client/models/null_plan.rb +1 -1
  94. data/lib/ory-client/models/o_auth2_client.rb +1 -1
  95. data/lib/ory-client/models/o_auth2_client_token_lifespans.rb +1 -1
  96. data/lib/ory-client/models/o_auth2_consent_request.rb +1 -1
  97. data/lib/ory-client/models/o_auth2_consent_request_open_id_connect_context.rb +1 -1
  98. data/lib/ory-client/models/o_auth2_consent_session.rb +1 -1
  99. data/lib/ory-client/models/o_auth2_consent_session_expires_at.rb +1 -1
  100. data/lib/ory-client/models/o_auth2_login_request.rb +1 -1
  101. data/lib/ory-client/models/o_auth2_logout_request.rb +1 -1
  102. data/lib/ory-client/models/o_auth2_redirect_to.rb +1 -1
  103. data/lib/ory-client/models/o_auth2_token_exchange.rb +1 -1
  104. data/lib/ory-client/models/oidc_configuration.rb +1 -1
  105. data/lib/ory-client/models/oidc_user_info.rb +1 -1
  106. data/lib/ory-client/models/pagination.rb +1 -1
  107. data/lib/ory-client/models/pagination_headers.rb +1 -1
  108. data/lib/ory-client/models/parse_error.rb +1 -1
  109. data/lib/ory-client/models/perform_native_logout_body.rb +1 -1
  110. data/lib/ory-client/models/post_check_permission_body.rb +1 -1
  111. data/lib/ory-client/models/post_check_permission_or_error_body.rb +1 -1
  112. data/lib/ory-client/models/project.rb +1 -1
  113. data/lib/ory-client/models/project_api_key.rb +1 -1
  114. data/lib/ory-client/models/project_host.rb +1 -1
  115. data/lib/ory-client/models/project_invite.rb +1 -1
  116. data/lib/ory-client/models/project_metadata.rb +1 -1
  117. data/lib/ory-client/models/project_service_identity.rb +1 -1
  118. data/lib/ory-client/models/project_service_o_auth2.rb +1 -1
  119. data/lib/ory-client/models/project_service_permission.rb +1 -1
  120. data/lib/ory-client/models/project_services.rb +1 -1
  121. data/lib/ory-client/models/recovery_code_for_identity.rb +1 -1
  122. data/lib/ory-client/models/recovery_flow.rb +1 -1
  123. data/lib/ory-client/models/recovery_flow_state.rb +1 -1
  124. data/lib/ory-client/models/recovery_identity_address.rb +1 -1
  125. data/lib/ory-client/models/recovery_link_for_identity.rb +1 -1
  126. data/lib/ory-client/models/registration_flow.rb +1 -1
  127. data/lib/ory-client/models/reject_o_auth2_request.rb +1 -1
  128. data/lib/ory-client/models/relation_query.rb +1 -1
  129. data/lib/ory-client/models/relationship.rb +1 -1
  130. data/lib/ory-client/models/relationship_namespaces.rb +1 -1
  131. data/lib/ory-client/models/relationship_patch.rb +1 -1
  132. data/lib/ory-client/models/relationships.rb +1 -1
  133. data/lib/ory-client/models/schema_patch.rb +1 -1
  134. data/lib/ory-client/models/self_service_flow_expired_error.rb +1 -1
  135. data/lib/ory-client/models/session.rb +1 -1
  136. data/lib/ory-client/models/session_authentication_method.rb +1 -1
  137. data/lib/ory-client/models/session_device.rb +1 -1
  138. data/lib/ory-client/models/set_active_project_in_console_body.rb +1 -1
  139. data/lib/ory-client/models/set_custom_domain_body.rb +1 -1
  140. data/lib/ory-client/models/set_project.rb +1 -1
  141. data/lib/ory-client/models/settings_flow.rb +1 -1
  142. data/lib/ory-client/models/settings_flow_state.rb +1 -1
  143. data/lib/ory-client/models/source_position.rb +1 -1
  144. data/lib/ory-client/models/stripe_customer.rb +1 -1
  145. data/lib/ory-client/models/subject_set.rb +1 -1
  146. data/lib/ory-client/models/subscription.rb +1 -1
  147. data/lib/ory-client/models/successful_native_login.rb +1 -1
  148. data/lib/ory-client/models/successful_native_registration.rb +1 -1
  149. data/lib/ory-client/models/successful_project_update.rb +1 -1
  150. data/lib/ory-client/models/token_pagination.rb +1 -1
  151. data/lib/ory-client/models/token_pagination_headers.rb +1 -1
  152. data/lib/ory-client/models/token_pagination_request_parameters.rb +1 -1
  153. data/lib/ory-client/models/token_pagination_response_headers.rb +1 -1
  154. data/lib/ory-client/models/trust_o_auth2_jwt_grant_issuer.rb +1 -1
  155. data/lib/ory-client/models/trusted_o_auth2_jwt_grant_issuer.rb +1 -1
  156. data/lib/ory-client/models/trusted_o_auth2_jwt_grant_json_web_key.rb +1 -1
  157. data/lib/ory-client/models/ui_container.rb +1 -1
  158. data/lib/ory-client/models/ui_node.rb +1 -1
  159. data/lib/ory-client/models/ui_node_anchor_attributes.rb +1 -1
  160. data/lib/ory-client/models/ui_node_attributes.rb +1 -1
  161. data/lib/ory-client/models/ui_node_image_attributes.rb +1 -1
  162. data/lib/ory-client/models/ui_node_input_attributes.rb +1 -1
  163. data/lib/ory-client/models/ui_node_meta.rb +1 -1
  164. data/lib/ory-client/models/ui_node_script_attributes.rb +1 -1
  165. data/lib/ory-client/models/ui_node_text_attributes.rb +1 -1
  166. data/lib/ory-client/models/ui_text.rb +1 -1
  167. data/lib/ory-client/models/update_identity_body.rb +1 -1
  168. data/lib/ory-client/models/update_login_flow_body.rb +1 -1
  169. data/lib/ory-client/models/update_login_flow_with_lookup_secret_method.rb +1 -1
  170. data/lib/ory-client/models/update_login_flow_with_oidc_method.rb +1 -1
  171. data/lib/ory-client/models/update_login_flow_with_password_method.rb +1 -1
  172. data/lib/ory-client/models/update_login_flow_with_totp_method.rb +1 -1
  173. data/lib/ory-client/models/update_login_flow_with_web_authn_method.rb +1 -1
  174. data/lib/ory-client/models/update_recovery_flow_body.rb +1 -1
  175. data/lib/ory-client/models/update_recovery_flow_with_code_method.rb +1 -1
  176. data/lib/ory-client/models/update_recovery_flow_with_link_method.rb +1 -1
  177. data/lib/ory-client/models/update_registration_flow_body.rb +1 -1
  178. data/lib/ory-client/models/update_registration_flow_with_oidc_method.rb +1 -1
  179. data/lib/ory-client/models/update_registration_flow_with_password_method.rb +1 -1
  180. data/lib/ory-client/models/update_registration_flow_with_web_authn_method.rb +1 -1
  181. data/lib/ory-client/models/update_settings_flow_body.rb +1 -1
  182. data/lib/ory-client/models/update_settings_flow_with_lookup_method.rb +1 -1
  183. data/lib/ory-client/models/update_settings_flow_with_oidc_method.rb +1 -1
  184. data/lib/ory-client/models/update_settings_flow_with_password_method.rb +1 -1
  185. data/lib/ory-client/models/update_settings_flow_with_profile_method.rb +1 -1
  186. data/lib/ory-client/models/update_settings_flow_with_totp_method.rb +1 -1
  187. data/lib/ory-client/models/update_settings_flow_with_web_authn_method.rb +1 -1
  188. data/lib/ory-client/models/update_subscription_body.rb +1 -1
  189. data/lib/ory-client/models/update_verification_flow_body.rb +1 -1
  190. data/lib/ory-client/models/update_verification_flow_with_code_method_body.rb +1 -1
  191. data/lib/ory-client/models/update_verification_flow_with_link_method.rb +1 -1
  192. data/lib/ory-client/models/verifiable_identity_address.rb +1 -1
  193. data/lib/ory-client/models/verification_flow.rb +1 -1
  194. data/lib/ory-client/models/verification_flow_state.rb +1 -1
  195. data/lib/ory-client/models/version.rb +1 -1
  196. data/lib/ory-client/models/warning.rb +1 -1
  197. data/lib/ory-client/version.rb +2 -2
  198. data/lib/ory-client.rb +1 -1
  199. data/ory-client.gemspec +1 -1
  200. data/spec/api/courier_api_spec.rb +1 -1
  201. data/spec/api/frontend_api_spec.rb +1 -1
  202. data/spec/api/identity_api_spec.rb +1 -1
  203. data/spec/api/jwk_api_spec.rb +1 -1
  204. data/spec/api/metadata_api_spec.rb +1 -1
  205. data/spec/api/o_auth2_api_spec.rb +1 -1
  206. data/spec/api/oidc_api_spec.rb +1 -1
  207. data/spec/api/permission_api_spec.rb +1 -1
  208. data/spec/api/project_api_spec.rb +1 -1
  209. data/spec/api/relationship_api_spec.rb +1 -1
  210. data/spec/api/wellknown_api_spec.rb +1 -1
  211. data/spec/api_client_spec.rb +1 -1
  212. data/spec/configuration_spec.rb +1 -1
  213. data/spec/models/accept_o_auth2_consent_request_session_spec.rb +1 -1
  214. data/spec/models/accept_o_auth2_consent_request_spec.rb +1 -1
  215. data/spec/models/accept_o_auth2_login_request_spec.rb +1 -1
  216. data/spec/models/active_project_in_console_spec.rb +1 -1
  217. data/spec/models/authenticator_assurance_level_spec.rb +1 -1
  218. data/spec/models/check_opl_syntax_result_spec.rb +1 -1
  219. data/spec/models/check_permission_result_spec.rb +1 -1
  220. data/spec/models/cloud_account_spec.rb +1 -1
  221. data/spec/models/courier_message_status_spec.rb +1 -1
  222. data/spec/models/courier_message_type_spec.rb +1 -1
  223. data/spec/models/create_custom_domain_body_spec.rb +1 -1
  224. data/spec/models/create_identity_body_spec.rb +1 -1
  225. data/spec/models/create_json_web_key_set_spec.rb +1 -1
  226. data/spec/models/create_project_api_key_request_spec.rb +1 -1
  227. data/spec/models/create_project_body_spec.rb +1 -1
  228. data/spec/models/create_project_invite_spec.rb +1 -1
  229. data/spec/models/create_recovery_code_for_identity_body_spec.rb +1 -1
  230. data/spec/models/create_recovery_link_for_identity_body_spec.rb +1 -1
  231. data/spec/models/create_relationship_body_spec.rb +1 -1
  232. data/spec/models/create_subscription_body_spec.rb +1 -1
  233. data/spec/models/custom_domain_quota_spec.rb +1 -1
  234. data/spec/models/custom_domain_spec.rb +1 -1
  235. data/spec/models/delete_my_sessions_count_spec.rb +1 -1
  236. data/spec/models/error_authenticator_assurance_level_not_satisfied_spec.rb +1 -1
  237. data/spec/models/error_browser_location_change_required_spec.rb +1 -1
  238. data/spec/models/error_flow_replaced_spec.rb +1 -1
  239. data/spec/models/error_generic_spec.rb +1 -1
  240. data/spec/models/error_o_auth2_spec.rb +1 -1
  241. data/spec/models/expanded_permission_tree_spec.rb +1 -1
  242. data/spec/models/flow_error_spec.rb +1 -1
  243. data/spec/models/generic_error_content_spec.rb +1 -1
  244. data/spec/models/generic_error_spec.rb +1 -1
  245. data/spec/models/get_managed_identity_schema_location_spec.rb +1 -1
  246. data/spec/models/get_version200_response_spec.rb +1 -1
  247. data/spec/models/health_not_ready_status_spec.rb +1 -1
  248. data/spec/models/health_status_spec.rb +1 -1
  249. data/spec/models/identity_credentials_oidc_provider_spec.rb +1 -1
  250. data/spec/models/identity_credentials_oidc_spec.rb +1 -1
  251. data/spec/models/identity_credentials_password_spec.rb +1 -1
  252. data/spec/models/identity_credentials_spec.rb +1 -1
  253. data/spec/models/identity_credentials_type_spec.rb +1 -1
  254. data/spec/models/identity_schema_container_spec.rb +1 -1
  255. data/spec/models/identity_schema_preset_spec.rb +1 -1
  256. data/spec/models/identity_spec.rb +1 -1
  257. data/spec/models/identity_state_spec.rb +1 -1
  258. data/spec/models/identity_with_credentials_oidc_config_provider_spec.rb +1 -1
  259. data/spec/models/identity_with_credentials_oidc_config_spec.rb +1 -1
  260. data/spec/models/identity_with_credentials_oidc_spec.rb +1 -1
  261. data/spec/models/identity_with_credentials_password_config_spec.rb +1 -1
  262. data/spec/models/identity_with_credentials_password_spec.rb +1 -1
  263. data/spec/models/identity_with_credentials_spec.rb +1 -1
  264. data/spec/models/internal_is_owner_for_project_by_slug_body_spec.rb +1 -1
  265. data/spec/models/internal_provision_mock_subscription_spec.rb +1 -1
  266. data/spec/models/introspected_o_auth2_token_spec.rb +1 -1
  267. data/spec/models/invite_quota_spec.rb +1 -1
  268. data/spec/models/is_owner_for_project_by_slug_spec.rb +1 -1
  269. data/spec/models/is_ready200_response_spec.rb +1 -1
  270. data/spec/models/is_ready503_response_spec.rb +1 -1
  271. data/spec/models/json_patch_spec.rb +1 -1
  272. data/spec/models/json_web_key_set_spec.rb +1 -1
  273. data/spec/models/json_web_key_spec.rb +1 -1
  274. data/spec/models/keto_namespace_spec.rb +1 -1
  275. data/spec/models/login_flow_spec.rb +1 -1
  276. data/spec/models/logout_flow_spec.rb +1 -1
  277. data/spec/models/managed_identity_schema_spec.rb +1 -1
  278. data/spec/models/managed_identity_schema_validation_result_spec.rb +1 -1
  279. data/spec/models/message_spec.rb +1 -1
  280. data/spec/models/namespace_spec.rb +1 -1
  281. data/spec/models/needs_privileged_session_error_spec.rb +1 -1
  282. data/spec/models/normalized_project_revision_hook_spec.rb +1 -1
  283. data/spec/models/normalized_project_revision_identity_schema_spec.rb +1 -1
  284. data/spec/models/normalized_project_revision_spec.rb +1 -1
  285. data/spec/models/normalized_project_revision_third_party_provider_spec.rb +1 -1
  286. data/spec/models/normalized_project_spec.rb +1 -1
  287. data/spec/models/null_plan_spec.rb +1 -1
  288. data/spec/models/o_auth2_client_spec.rb +1 -1
  289. data/spec/models/o_auth2_client_token_lifespans_spec.rb +1 -1
  290. data/spec/models/o_auth2_consent_request_open_id_connect_context_spec.rb +1 -1
  291. data/spec/models/o_auth2_consent_request_spec.rb +1 -1
  292. data/spec/models/o_auth2_consent_session_expires_at_spec.rb +1 -1
  293. data/spec/models/o_auth2_consent_session_spec.rb +1 -1
  294. data/spec/models/o_auth2_login_request_spec.rb +1 -1
  295. data/spec/models/o_auth2_logout_request_spec.rb +1 -1
  296. data/spec/models/o_auth2_redirect_to_spec.rb +1 -1
  297. data/spec/models/o_auth2_token_exchange_spec.rb +1 -1
  298. data/spec/models/oidc_configuration_spec.rb +1 -1
  299. data/spec/models/oidc_user_info_spec.rb +1 -1
  300. data/spec/models/pagination_headers_spec.rb +1 -1
  301. data/spec/models/pagination_spec.rb +1 -1
  302. data/spec/models/parse_error_spec.rb +1 -1
  303. data/spec/models/perform_native_logout_body_spec.rb +1 -1
  304. data/spec/models/post_check_permission_body_spec.rb +1 -1
  305. data/spec/models/post_check_permission_or_error_body_spec.rb +1 -1
  306. data/spec/models/project_api_key_spec.rb +1 -1
  307. data/spec/models/project_host_spec.rb +1 -1
  308. data/spec/models/project_invite_spec.rb +1 -1
  309. data/spec/models/project_metadata_spec.rb +1 -1
  310. data/spec/models/project_service_identity_spec.rb +1 -1
  311. data/spec/models/project_service_o_auth2_spec.rb +1 -1
  312. data/spec/models/project_service_permission_spec.rb +1 -1
  313. data/spec/models/project_services_spec.rb +1 -1
  314. data/spec/models/project_spec.rb +1 -1
  315. data/spec/models/recovery_code_for_identity_spec.rb +1 -1
  316. data/spec/models/recovery_flow_spec.rb +1 -1
  317. data/spec/models/recovery_flow_state_spec.rb +1 -1
  318. data/spec/models/recovery_identity_address_spec.rb +1 -1
  319. data/spec/models/recovery_link_for_identity_spec.rb +1 -1
  320. data/spec/models/registration_flow_spec.rb +1 -1
  321. data/spec/models/reject_o_auth2_request_spec.rb +1 -1
  322. data/spec/models/relation_query_spec.rb +1 -1
  323. data/spec/models/relationship_namespaces_spec.rb +1 -1
  324. data/spec/models/relationship_patch_spec.rb +1 -1
  325. data/spec/models/relationship_spec.rb +1 -1
  326. data/spec/models/relationships_spec.rb +1 -1
  327. data/spec/models/schema_patch_spec.rb +1 -1
  328. data/spec/models/self_service_flow_expired_error_spec.rb +1 -1
  329. data/spec/models/session_authentication_method_spec.rb +1 -1
  330. data/spec/models/session_device_spec.rb +1 -1
  331. data/spec/models/session_spec.rb +1 -1
  332. data/spec/models/set_active_project_in_console_body_spec.rb +1 -1
  333. data/spec/models/set_custom_domain_body_spec.rb +1 -1
  334. data/spec/models/set_project_spec.rb +1 -1
  335. data/spec/models/settings_flow_spec.rb +1 -1
  336. data/spec/models/settings_flow_state_spec.rb +1 -1
  337. data/spec/models/source_position_spec.rb +1 -1
  338. data/spec/models/stripe_customer_spec.rb +1 -1
  339. data/spec/models/subject_set_spec.rb +1 -1
  340. data/spec/models/subscription_spec.rb +1 -1
  341. data/spec/models/successful_native_login_spec.rb +1 -1
  342. data/spec/models/successful_native_registration_spec.rb +1 -1
  343. data/spec/models/successful_project_update_spec.rb +1 -1
  344. data/spec/models/token_pagination_headers_spec.rb +1 -1
  345. data/spec/models/token_pagination_request_parameters_spec.rb +1 -1
  346. data/spec/models/token_pagination_response_headers_spec.rb +1 -1
  347. data/spec/models/token_pagination_spec.rb +1 -1
  348. data/spec/models/trust_o_auth2_jwt_grant_issuer_spec.rb +1 -1
  349. data/spec/models/trusted_o_auth2_jwt_grant_issuer_spec.rb +1 -1
  350. data/spec/models/trusted_o_auth2_jwt_grant_json_web_key_spec.rb +1 -1
  351. data/spec/models/ui_container_spec.rb +1 -1
  352. data/spec/models/ui_node_anchor_attributes_spec.rb +1 -1
  353. data/spec/models/ui_node_attributes_spec.rb +1 -1
  354. data/spec/models/ui_node_image_attributes_spec.rb +1 -1
  355. data/spec/models/ui_node_input_attributes_spec.rb +1 -1
  356. data/spec/models/ui_node_meta_spec.rb +1 -1
  357. data/spec/models/ui_node_script_attributes_spec.rb +1 -1
  358. data/spec/models/ui_node_spec.rb +1 -1
  359. data/spec/models/ui_node_text_attributes_spec.rb +1 -1
  360. data/spec/models/ui_text_spec.rb +1 -1
  361. data/spec/models/update_identity_body_spec.rb +1 -1
  362. data/spec/models/update_login_flow_body_spec.rb +1 -1
  363. data/spec/models/update_login_flow_with_lookup_secret_method_spec.rb +1 -1
  364. data/spec/models/update_login_flow_with_oidc_method_spec.rb +1 -1
  365. data/spec/models/update_login_flow_with_password_method_spec.rb +1 -1
  366. data/spec/models/update_login_flow_with_totp_method_spec.rb +1 -1
  367. data/spec/models/update_login_flow_with_web_authn_method_spec.rb +1 -1
  368. data/spec/models/update_recovery_flow_body_spec.rb +1 -1
  369. data/spec/models/update_recovery_flow_with_code_method_spec.rb +1 -1
  370. data/spec/models/update_recovery_flow_with_link_method_spec.rb +1 -1
  371. data/spec/models/update_registration_flow_body_spec.rb +1 -1
  372. data/spec/models/update_registration_flow_with_oidc_method_spec.rb +1 -1
  373. data/spec/models/update_registration_flow_with_password_method_spec.rb +1 -1
  374. data/spec/models/update_registration_flow_with_web_authn_method_spec.rb +1 -1
  375. data/spec/models/update_settings_flow_body_spec.rb +1 -1
  376. data/spec/models/update_settings_flow_with_lookup_method_spec.rb +1 -1
  377. data/spec/models/update_settings_flow_with_oidc_method_spec.rb +1 -1
  378. data/spec/models/update_settings_flow_with_password_method_spec.rb +1 -1
  379. data/spec/models/update_settings_flow_with_profile_method_spec.rb +1 -1
  380. data/spec/models/update_settings_flow_with_totp_method_spec.rb +1 -1
  381. data/spec/models/update_settings_flow_with_web_authn_method_spec.rb +1 -1
  382. data/spec/models/update_subscription_body_spec.rb +1 -1
  383. data/spec/models/update_verification_flow_body_spec.rb +1 -1
  384. data/spec/models/update_verification_flow_with_code_method_body_spec.rb +1 -1
  385. data/spec/models/update_verification_flow_with_link_method_spec.rb +1 -1
  386. data/spec/models/verifiable_identity_address_spec.rb +1 -1
  387. data/spec/models/verification_flow_spec.rb +1 -1
  388. data/spec/models/verification_flow_state_spec.rb +1 -1
  389. data/spec/models/version_spec.rb +1 -1
  390. data/spec/models/warning_spec.rb +1 -1
  391. data/spec/spec_helper.rb +1 -1
  392. data/vendor/bundle/ruby/2.5.0/cache/stringio-3.0.4.gem +0 -0
  393. data/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/byebug-11.1.3/gem_make.out +2 -2
  394. data/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/ffi-1.15.5/gem_make.out +2 -2
  395. data/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/jaro_winkler-1.5.4/gem_make.out +2 -2
  396. data/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/psych-4.0.6/gem_make.out +2 -2
  397. data/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/{stringio-3.0.2 → stringio-3.0.4}/gem.build_complete +0 -0
  398. data/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/{stringio-3.0.2 → stringio-3.0.4}/gem_make.out +6 -6
  399. data/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/{stringio-3.0.2 → stringio-3.0.4}/mkmf.log +2 -2
  400. data/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/stringio-3.0.4/stringio.so +0 -0
  401. data/vendor/bundle/ruby/2.5.0/gems/byebug-11.1.3/ext/byebug/Makefile +2 -2
  402. data/vendor/bundle/ruby/2.5.0/gems/ffi-1.15.5/ext/ffi_c/Makefile +2 -2
  403. data/vendor/bundle/ruby/2.5.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler/Makefile +2 -2
  404. data/vendor/bundle/ruby/2.5.0/gems/psych-4.0.6/ext/psych/Makefile +2 -2
  405. data/vendor/bundle/ruby/2.5.0/gems/{stringio-3.0.2 → stringio-3.0.4}/README.md +0 -0
  406. data/vendor/bundle/ruby/2.5.0/gems/{stringio-3.0.2 → stringio-3.0.4}/ext/stringio/.sitearchdir.time +0 -0
  407. data/vendor/bundle/ruby/2.5.0/gems/{stringio-3.0.2 → stringio-3.0.4}/ext/stringio/Makefile +2 -2
  408. data/vendor/bundle/ruby/2.5.0/gems/{stringio-3.0.2 → stringio-3.0.4}/ext/stringio/extconf.rb +0 -0
  409. data/vendor/bundle/ruby/2.5.0/gems/{stringio-3.0.2 → stringio-3.0.4}/ext/stringio/stringio.c +241 -132
  410. data/vendor/bundle/ruby/2.5.0/gems/stringio-3.0.4/ext/stringio/stringio.o +0 -0
  411. data/vendor/bundle/ruby/2.5.0/gems/stringio-3.0.4/ext/stringio/stringio.so +0 -0
  412. data/vendor/bundle/ruby/2.5.0/gems/stringio-3.0.4/lib/stringio.so +0 -0
  413. data/vendor/bundle/ruby/2.5.0/specifications/{stringio-3.0.2.gemspec → stringio-3.0.4.gemspec} +3 -3
  414. metadata +16 -16
  415. data/vendor/bundle/ruby/2.5.0/cache/stringio-3.0.2.gem +0 -0
  416. data/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/stringio-3.0.2/stringio.so +0 -0
  417. data/vendor/bundle/ruby/2.5.0/gems/stringio-3.0.2/ext/stringio/stringio.o +0 -0
  418. data/vendor/bundle/ruby/2.5.0/gems/stringio-3.0.2/ext/stringio/stringio.so +0 -0
  419. data/vendor/bundle/ruby/2.5.0/gems/stringio-3.0.2/lib/stringio.so +0 -0
@@ -12,7 +12,7 @@
12
12
 
13
13
  **********************************************************************/
14
14
 
15
- #define STRINGIO_VERSION "3.0.2"
15
+ #define STRINGIO_VERSION "3.0.4"
16
16
 
17
17
  #include "ruby.h"
18
18
  #include "ruby/io.h"
@@ -67,15 +67,20 @@ strio_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash,
67
67
  e = strchr(++n, ':');
68
68
  len = e ? e - n : (long)strlen(n);
69
69
  if (len > 0 && len <= ENCODING_MAXNAMELEN) {
70
+ rb_encoding *enc;
70
71
  if (e) {
71
72
  memcpy(encname, n, len);
72
73
  encname[len] = '\0';
73
74
  n = encname;
74
75
  }
75
- convconfig_p->enc = rb_enc_find(n);
76
+ enc = rb_enc_find(n);
77
+ if (e)
78
+ convconfig_p->enc2 = enc;
79
+ else
80
+ convconfig_p->enc = enc;
76
81
  }
77
82
  if (e && (len = strlen(++e)) > 0 && len <= ENCODING_MAXNAMELEN) {
78
- convconfig_p->enc2 = rb_enc_find(e);
83
+ convconfig_p->enc = rb_enc_find(e);
79
84
  }
80
85
  }
81
86
  }
@@ -252,9 +257,20 @@ strio_s_allocate(VALUE klass)
252
257
  }
253
258
 
254
259
  /*
255
- * call-seq: StringIO.new(string=""[, mode])
260
+ * call-seq:
261
+ * StringIO.new(string = '', mode = 'r+') -> new_stringio
262
+ *
263
+ * Note that +mode+ defaults to <tt>'r'</tt> if +string+ is frozen.
264
+ *
265
+ * Returns a new \StringIO instance formed from +string+ and +mode+;
266
+ * see {Access Modes}[https://docs.ruby-lang.org/en/master/File.html#class-File-label-Access+Modes]:
256
267
  *
257
- * Creates new StringIO instance from with _string_ and _mode_.
268
+ * strio = StringIO.new # => #<StringIO>
269
+ * strio.close
270
+ *
271
+ * The instance should be closed when no longer needed.
272
+ *
273
+ * Related: StringIO.open (accepts block; closes automatically).
258
274
  */
259
275
  static VALUE
260
276
  strio_initialize(int argc, VALUE *argv, VALUE self)
@@ -387,11 +403,26 @@ strio_finalize(VALUE self)
387
403
  }
388
404
 
389
405
  /*
390
- * call-seq: StringIO.open(string=""[, mode]) {|strio| ...}
406
+ * call-seq:
407
+ * StringIO.open(string = '', mode = 'r+') {|strio| ... }
408
+ *
409
+ * Note that +mode+ defaults to <tt>'r'</tt> if +string+ is frozen.
410
+ *
411
+ * Creates a new \StringIO instance formed from +string+ and +mode+;
412
+ * see {Access Modes}[https://docs.ruby-lang.org/en/master/File.html#class-File-label-Access+Modes].
413
+ *
414
+ * With no block, returns the new instance:
415
+ *
416
+ * strio = StringIO.open # => #<StringIO>
417
+ *
418
+ * With a block, calls the block with the new instance
419
+ * and returns the block's value;
420
+ * closes the instance on block exit.
391
421
  *
392
- * Equivalent to StringIO.new except that when it is called with a block, it
393
- * yields with the new instance and closes it, and returns the result which
394
- * returned from the block.
422
+ * StringIO.open {|strio| p strio }
423
+ * # => #<StringIO>
424
+ *
425
+ * Related: StringIO.new.
395
426
  */
396
427
  static VALUE
397
428
  strio_s_open(int argc, VALUE *argv, VALUE klass)
@@ -477,9 +508,23 @@ strio_unimpl(int argc, VALUE *argv, VALUE self)
477
508
  }
478
509
 
479
510
  /*
480
- * call-seq: strio.string -> string
511
+ * call-seq:
512
+ * string -> string
513
+ *
514
+ * Returns underlying string:
515
+ *
516
+ * StringIO.open('foo') do |strio|
517
+ * p strio.string
518
+ * strio.string = 'bar'
519
+ * p strio.string
520
+ * end
521
+ *
522
+ * Output:
523
+ *
524
+ * "foo"
525
+ * "bar"
481
526
  *
482
- * Returns underlying String object, the subject of IO.
527
+ * Related: StringIO#string= (assigns the underlying string).
483
528
  */
484
529
  static VALUE
485
530
  strio_get_string(VALUE self)
@@ -489,9 +534,23 @@ strio_get_string(VALUE self)
489
534
 
490
535
  /*
491
536
  * call-seq:
492
- * strio.string = string -> string
537
+ * string = other_string -> other_string
493
538
  *
494
- * Changes underlying String object, the subject of IO.
539
+ * Assigns the underlying string as +other_string+, and sets position to zero;
540
+ * returns +other_string+:
541
+ *
542
+ * StringIO.open('foo') do |strio|
543
+ * p strio.string
544
+ * strio.string = 'bar'
545
+ * p strio.string
546
+ * end
547
+ *
548
+ * Output:
549
+ *
550
+ * "foo"
551
+ * "bar"
552
+ *
553
+ * Related: StringIO#string (returns the underlying string).
495
554
  */
496
555
  static VALUE
497
556
  strio_set_string(VALUE self, VALUE string)
@@ -509,10 +568,13 @@ strio_set_string(VALUE self, VALUE string)
509
568
 
510
569
  /*
511
570
  * call-seq:
512
- * strio.close -> nil
571
+ * close -> nil
572
+ *
573
+ * Closes +self+ for both reading and writing.
513
574
  *
514
- * Closes a StringIO. The stream is unavailable for any further data
515
- * operations; an +IOError+ is raised if such an attempt is made.
575
+ * Raises IOError if reading or writing is attempted.
576
+ *
577
+ * Related: StringIO#close_read, StringIO#close_write.
516
578
  */
517
579
  static VALUE
518
580
  strio_close(VALUE self)
@@ -524,10 +586,13 @@ strio_close(VALUE self)
524
586
 
525
587
  /*
526
588
  * call-seq:
527
- * strio.close_read -> nil
589
+ * close_read -> nil
590
+ *
591
+ * Closes +self+ for reading; closed-write setting remains unchanged.
592
+ *
593
+ * Raises IOError if reading is attempted.
528
594
  *
529
- * Closes the read end of a StringIO. Will raise an +IOError+ if the
530
- * receiver is not readable.
595
+ * Related: StringIO#close, StringIO#close_write.
531
596
  */
532
597
  static VALUE
533
598
  strio_close_read(VALUE self)
@@ -542,10 +607,13 @@ strio_close_read(VALUE self)
542
607
 
543
608
  /*
544
609
  * call-seq:
545
- * strio.close_write -> nil
610
+ * close_write -> nil
546
611
  *
547
- * Closes the write end of a StringIO. Will raise an +IOError+ if the
548
- * receiver is not writeable.
612
+ * Closes +self+ for writing; closed-read setting remains unchanged.
613
+ *
614
+ * Raises IOError if writing is attempted.
615
+ *
616
+ * Related: StringIO#close, StringIO#close_read.
549
617
  */
550
618
  static VALUE
551
619
  strio_close_write(VALUE self)
@@ -560,9 +628,10 @@ strio_close_write(VALUE self)
560
628
 
561
629
  /*
562
630
  * call-seq:
563
- * strio.closed? -> true or false
631
+ * closed? -> true or false
564
632
  *
565
- * Returns +true+ if the stream is completely closed, +false+ otherwise.
633
+ * Returns +true+ if +self+ is closed for both reading and writing,
634
+ * +false+ otherwise.
566
635
  */
567
636
  static VALUE
568
637
  strio_closed(VALUE self)
@@ -574,9 +643,9 @@ strio_closed(VALUE self)
574
643
 
575
644
  /*
576
645
  * call-seq:
577
- * strio.closed_read? -> true or false
646
+ * closed_read? -> true or false
578
647
  *
579
- * Returns +true+ if the stream is not readable, +false+ otherwise.
648
+ * Returns +true+ if +self+ is closed for reading, +false+ otherwise.
580
649
  */
581
650
  static VALUE
582
651
  strio_closed_read(VALUE self)
@@ -588,9 +657,9 @@ strio_closed_read(VALUE self)
588
657
 
589
658
  /*
590
659
  * call-seq:
591
- * strio.closed_write? -> true or false
660
+ * closed_write? -> true or false
592
661
  *
593
- * Returns +true+ if the stream is not writable, +false+ otherwise.
662
+ * Returns +true+ if +self+ is closed for writing, +false+ otherwise.
594
663
  */
595
664
  static VALUE
596
665
  strio_closed_write(VALUE self)
@@ -610,11 +679,14 @@ strio_to_read(VALUE self)
610
679
 
611
680
  /*
612
681
  * call-seq:
613
- * strio.eof -> true or false
614
- * strio.eof? -> true or false
682
+ * eof? -> true or false
683
+ *
684
+ * Returns +true+ if positioned at end-of-stream, +false+ otherwise;
685
+ * see {Position}[https://docs.ruby-lang.org/en/master/File.html#class-File-label-Position].
615
686
  *
616
- * Returns true if the stream is at the end of the data (underlying string).
617
- * The stream must be opened for reading or an +IOError+ will be raised.
687
+ * Raises IOError if the stream is not opened for reading.
688
+ *
689
+ * StreamIO#eof is an alias for StreamIO#eof?.
618
690
  */
619
691
  static VALUE
620
692
  strio_eof(VALUE self)
@@ -644,13 +716,10 @@ strio_copy(VALUE copy, VALUE orig)
644
716
 
645
717
  /*
646
718
  * call-seq:
647
- * strio.lineno -> integer
719
+ * lineno -> current_line_number
648
720
  *
649
- * Returns the current line number. The stream must be
650
- * opened for reading. +lineno+ counts the number of times +gets+ is
651
- * called, rather than the number of newlines encountered. The two
652
- * values will differ if +gets+ is called with a separator other than
653
- * newline. See also the <code>$.</code> variable.
721
+ * Returns the current line number in +self+;
722
+ * see {Line Number}[https://docs.ruby-lang.org/en/master/IO.html#label-Line+Number].
654
723
  */
655
724
  static VALUE
656
725
  strio_get_lineno(VALUE self)
@@ -660,10 +729,10 @@ strio_get_lineno(VALUE self)
660
729
 
661
730
  /*
662
731
  * call-seq:
663
- * strio.lineno = integer -> integer
732
+ * lineno = new_line_number -> new_line_number
664
733
  *
665
- * Manually sets the current line number to the given value.
666
- * <code>$.</code> is updated only on the next read.
734
+ * Sets the current line number in +self+ to the given +new_line_number+;
735
+ * see {Line Number}[https://docs.ruby-lang.org/en/master/IO.html#label-Line+Number].
667
736
  */
668
737
  static VALUE
669
738
  strio_set_lineno(VALUE self, VALUE lineno)
@@ -674,9 +743,10 @@ strio_set_lineno(VALUE self, VALUE lineno)
674
743
 
675
744
  /*
676
745
  * call-seq:
677
- * strio.binmode -> stringio
746
+ * binmode -> self
678
747
  *
679
- * Puts stream into binary mode. See IO#binmode.
748
+ * Sets the data mode in +self+ to binary mode;
749
+ * see {Data Mode}[https://docs.ruby-lang.org/en/master/File.html#class-File-label-Data+Mode].
680
750
  *
681
751
  */
682
752
  static VALUE
@@ -700,11 +770,27 @@ strio_binmode(VALUE self)
700
770
 
701
771
  /*
702
772
  * call-seq:
703
- * strio.reopen(other_StrIO) -> strio
704
- * strio.reopen(string, mode) -> strio
773
+ * reopen(other, mode = 'r+') -> self
774
+ *
775
+ * Reinitializes the stream with the given +other+ (string or StringIO) and +mode+;
776
+ * see IO.new:
777
+ *
778
+ * StringIO.open('foo') do |strio|
779
+ * p strio.string
780
+ * strio.reopen('bar')
781
+ * p strio.string
782
+ * other_strio = StringIO.new('baz')
783
+ * strio.reopen(other_strio)
784
+ * p strio.string
785
+ * other_strio.close
786
+ * end
787
+ *
788
+ * Output:
789
+ *
790
+ * "foo"
791
+ * "bar"
792
+ * "baz"
705
793
  *
706
- * Reinitializes the stream with the given <i>other_StrIO</i> or _string_
707
- * and _mode_ (see StringIO#new).
708
794
  */
709
795
  static VALUE
710
796
  strio_reopen(int argc, VALUE *argv, VALUE self)
@@ -718,10 +804,12 @@ strio_reopen(int argc, VALUE *argv, VALUE self)
718
804
 
719
805
  /*
720
806
  * call-seq:
721
- * strio.pos -> integer
722
- * strio.tell -> integer
807
+ * pos -> stream_position
723
808
  *
724
- * Returns the current offset (in bytes).
809
+ * Returns the current position (in bytes);
810
+ * see {Position}[https://docs.ruby-lang.org/en/master/IO.html#label-Position].
811
+ *
812
+ * StringIO#tell is an alias for StringIO#pos.
725
813
  */
726
814
  static VALUE
727
815
  strio_get_pos(VALUE self)
@@ -731,9 +819,10 @@ strio_get_pos(VALUE self)
731
819
 
732
820
  /*
733
821
  * call-seq:
734
- * strio.pos = integer -> integer
822
+ * pos = new_position -> new_position
735
823
  *
736
- * Seeks to the given position (in bytes).
824
+ * Sets the current position (in bytes);
825
+ * see {Position}[https://docs.ruby-lang.org/en/master/IO.html#label-Position].
737
826
  */
738
827
  static VALUE
739
828
  strio_set_pos(VALUE self, VALUE pos)
@@ -749,10 +838,11 @@ strio_set_pos(VALUE self, VALUE pos)
749
838
 
750
839
  /*
751
840
  * call-seq:
752
- * strio.rewind -> 0
841
+ * rewind -> 0
753
842
  *
754
- * Positions the stream to the beginning of input, resetting
755
- * +lineno+ to zero.
843
+ * Sets the current position and line number to zero;
844
+ * see {Position}[https://docs.ruby-lang.org/en/master/IO.html#label-Position]
845
+ * and {Line Number}[https://docs.ruby-lang.org/en/master/IO.html#label-Line+Number].
756
846
  */
757
847
  static VALUE
758
848
  strio_rewind(VALUE self)
@@ -765,10 +855,11 @@ strio_rewind(VALUE self)
765
855
 
766
856
  /*
767
857
  * call-seq:
768
- * strio.seek(amount, whence=SEEK_SET) -> 0
858
+ * seek(offset, whence = SEEK_SET) -> 0
769
859
  *
770
- * Seeks to a given offset _amount_ in the stream according to
771
- * the value of _whence_ (see IO#seek).
860
+ * Sets the current position to the given integer +offset+ (in bytes),
861
+ * with respect to a given constant +whence+;
862
+ * see {Position}[https://docs.ruby-lang.org/en/master/IO.html#label-Position].
772
863
  */
773
864
  static VALUE
774
865
  strio_seek(int argc, VALUE *argv, VALUE self)
@@ -804,9 +895,9 @@ strio_seek(int argc, VALUE *argv, VALUE self)
804
895
 
805
896
  /*
806
897
  * call-seq:
807
- * strio.sync -> true
898
+ * sync -> true
808
899
  *
809
- * Returns +true+ always.
900
+ * Returns +true+; implemented only for compatibility with other stream classes.
810
901
  */
811
902
  static VALUE
812
903
  strio_get_sync(VALUE self)
@@ -821,10 +912,12 @@ strio_get_sync(VALUE self)
821
912
 
822
913
  /*
823
914
  * call-seq:
824
- * strio.each_byte {|byte| block } -> strio
825
- * strio.each_byte -> anEnumerator
915
+ * each_byte {|byte| ... } -> self
916
+ *
917
+ * With a block given, calls the block with each remaining byte in the stream;
918
+ * see {Byte IO}[https://docs.ruby-lang.org/en/master/IO.html#label-Byte+IO].
826
919
  *
827
- * See IO#each_byte.
920
+ * With no block given, returns an enumerator.
828
921
  */
829
922
  static VALUE
830
923
  strio_each_byte(VALUE self)
@@ -842,9 +935,10 @@ strio_each_byte(VALUE self)
842
935
 
843
936
  /*
844
937
  * call-seq:
845
- * strio.getc -> string or nil
938
+ * getc -> character or nil
846
939
  *
847
- * See IO#getc.
940
+ * Reads and returns the next character from the stream;
941
+ * see {Character IO}[https://docs.ruby-lang.org/en/master/IO.html#label-Character+IO].
848
942
  */
849
943
  static VALUE
850
944
  strio_getc(VALUE self)
@@ -867,9 +961,10 @@ strio_getc(VALUE self)
867
961
 
868
962
  /*
869
963
  * call-seq:
870
- * strio.getbyte -> fixnum or nil
964
+ * getbyte -> byte or nil
871
965
  *
872
- * See IO#getbyte.
966
+ * Reads and returns the next 8-bit byte from the stream;
967
+ * see {Byte IO}[https://docs.ruby-lang.org/en/master/IO.html#label-Byte+IO].
873
968
  */
874
969
  static VALUE
875
970
  strio_getbyte(VALUE self)
@@ -905,12 +1000,10 @@ strio_extend(struct StringIO *ptr, long pos, long len)
905
1000
 
906
1001
  /*
907
1002
  * call-seq:
908
- * strio.ungetc(string) -> nil
1003
+ * ungetc(character) -> nil
909
1004
  *
910
- * Pushes back one character (passed as a parameter)
911
- * such that a subsequent buffered read will return it. There is no
912
- * limitation for multiple pushbacks including pushing back behind the
913
- * beginning of the buffer string.
1005
+ * Pushes back ("unshifts") a character or integer onto the stream;
1006
+ * see {Character IO}[https://docs.ruby-lang.org/en/master/IO.html#label-Character+IO].
914
1007
  */
915
1008
  static VALUE
916
1009
  strio_ungetc(VALUE self, VALUE c)
@@ -945,9 +1038,10 @@ strio_ungetc(VALUE self, VALUE c)
945
1038
 
946
1039
  /*
947
1040
  * call-seq:
948
- * strio.ungetbyte(fixnum) -> nil
1041
+ * ungetbyte(byte) -> nil
949
1042
  *
950
- * See IO#ungetbyte
1043
+ * Pushes back ("unshifts") an 8-bit byte onto the stream;
1044
+ * see {Byte IO}[https://docs.ruby-lang.org/en/master/IO.html#label-Byte+IO].
951
1045
  */
952
1046
  static VALUE
953
1047
  strio_ungetbyte(VALUE self, VALUE c)
@@ -984,7 +1078,7 @@ strio_unget_bytes(struct StringIO *ptr, const char *cp, long cl)
984
1078
  len = RSTRING_LEN(str);
985
1079
  rest = pos - len;
986
1080
  if (cl > pos) {
987
- long ex = (rest < 0 ? cl-pos : cl+rest);
1081
+ long ex = cl - (rest < 0 ? pos : len);
988
1082
  rb_str_modify_expand(str, ex);
989
1083
  rb_str_set_len(str, len + ex);
990
1084
  s = RSTRING_PTR(str);
@@ -1007,9 +1101,10 @@ strio_unget_bytes(struct StringIO *ptr, const char *cp, long cl)
1007
1101
 
1008
1102
  /*
1009
1103
  * call-seq:
1010
- * strio.readchar -> string
1104
+ * readchar -> string
1011
1105
  *
1012
- * See IO#readchar.
1106
+ * Like +getc+, but raises an exception if already at end-of-stream;
1107
+ * see {Character IO}[https://docs.ruby-lang.org/en/master/IO.html#label-Character+IO].
1013
1108
  */
1014
1109
  static VALUE
1015
1110
  strio_readchar(VALUE self)
@@ -1021,9 +1116,10 @@ strio_readchar(VALUE self)
1021
1116
 
1022
1117
  /*
1023
1118
  * call-seq:
1024
- * strio.readbyte -> fixnum
1119
+ * readbyte -> byte
1025
1120
  *
1026
- * See IO#readbyte.
1121
+ * Like +getbyte+, but raises an exception if already at end-of-stream;
1122
+ * see {Byte IO}[https://docs.ruby-lang.org/en/master/IO.html#label-Byte+IO].
1027
1123
  */
1028
1124
  static VALUE
1029
1125
  strio_readbyte(VALUE self)
@@ -1035,10 +1131,12 @@ strio_readbyte(VALUE self)
1035
1131
 
1036
1132
  /*
1037
1133
  * call-seq:
1038
- * strio.each_char {|char| block } -> strio
1039
- * strio.each_char -> anEnumerator
1134
+ * each_char {|c| ... } -> self
1135
+ *
1136
+ * With a block given, calls the block with each remaining character in the stream;
1137
+ * see {Character IO}[https://docs.ruby-lang.org/en/master/IO.html#label-Character+IO].
1040
1138
  *
1041
- * See IO#each_char.
1139
+ * With no block given, returns an enumerator.
1042
1140
  */
1043
1141
  static VALUE
1044
1142
  strio_each_char(VALUE self)
@@ -1055,10 +1153,12 @@ strio_each_char(VALUE self)
1055
1153
 
1056
1154
  /*
1057
1155
  * call-seq:
1058
- * strio.each_codepoint {|c| block } -> strio
1059
- * strio.each_codepoint -> anEnumerator
1156
+ * each_codepoint {|codepoint| ... } -> self
1060
1157
  *
1061
- * See IO#each_codepoint.
1158
+ * With a block given, calls the block with each remaining codepoint in the stream;
1159
+ * see {Codepoint IO}[https://docs.ruby-lang.org/en/master/IO.html#label-Codepoint+IO].
1160
+ *
1161
+ * With no block given, returns an enumerator.
1062
1162
  */
1063
1163
  static VALUE
1064
1164
  strio_each_codepoint(VALUE self)
@@ -1125,8 +1225,10 @@ prepare_getline_args(struct getline_arg *arg, int argc, VALUE *argv)
1125
1225
  {
1126
1226
  VALUE str, lim, opts;
1127
1227
  long limit = -1;
1228
+ int respect_chomp;
1128
1229
 
1129
1230
  argc = rb_scan_args(argc, argv, "02:", &str, &lim, &opts);
1231
+ respect_chomp = argc == 0 || !NIL_P(str);
1130
1232
  switch (argc) {
1131
1233
  case 0:
1132
1234
  str = rb_rs;
@@ -1160,7 +1262,9 @@ prepare_getline_args(struct getline_arg *arg, int argc, VALUE *argv)
1160
1262
  keywords[0] = rb_intern_const("chomp");
1161
1263
  }
1162
1264
  rb_get_kwargs(opts, keywords, 0, 1, &vchomp);
1163
- arg->chomp = (vchomp != Qundef) && RTEST(vchomp);
1265
+ if (respect_chomp) {
1266
+ arg->chomp = (vchomp != Qundef) && RTEST(vchomp);
1267
+ }
1164
1268
  }
1165
1269
  return arg;
1166
1270
  }
@@ -1181,7 +1285,7 @@ strio_getline(struct getline_arg *arg, struct StringIO *ptr)
1181
1285
  const char *s, *e, *p;
1182
1286
  long n, limit = arg->limit;
1183
1287
  VALUE str = arg->rs;
1184
- int w = 0;
1288
+ long w = 0;
1185
1289
  rb_encoding *enc = get_enc(ptr);
1186
1290
 
1187
1291
  if (ptr->pos >= (n = RSTRING_LEN(ptr->string))) {
@@ -1200,6 +1304,7 @@ strio_getline(struct getline_arg *arg, struct StringIO *ptr)
1200
1304
  str = strio_substr(ptr, ptr->pos, e - s - w, enc);
1201
1305
  }
1202
1306
  else if ((n = RSTRING_LEN(str)) == 0) {
1307
+ const char *paragraph_end = NULL;
1203
1308
  p = s;
1204
1309
  while (p[(p + 1 < e) && (*p == '\r') && 0] == '\n') {
1205
1310
  p += *p == '\r';
@@ -1209,19 +1314,21 @@ strio_getline(struct getline_arg *arg, struct StringIO *ptr)
1209
1314
  }
1210
1315
  s = p;
1211
1316
  while ((p = memchr(p, '\n', e - p)) && (p != e)) {
1212
- if (*++p == '\n') {
1213
- e = p + 1;
1214
- w = (arg->chomp ? 1 : 0);
1215
- break;
1216
- }
1217
- else if (*p == '\r' && p < e && p[1] == '\n') {
1218
- e = p + 2;
1219
- w = (arg->chomp ? 2 : 0);
1220
- break;
1221
- }
1317
+ p++;
1318
+ if (!((p < e && *p == '\n') ||
1319
+ (p + 1 < e && *p == '\r' && *(p+1) == '\n'))) {
1320
+ continue;
1321
+ }
1322
+ paragraph_end = p - ((*(p-2) == '\r') ? 2 : 1);
1323
+ while ((p < e && *p == '\n') ||
1324
+ (p + 1 < e && *p == '\r' && *(p+1) == '\n')) {
1325
+ p += (*p == '\r') ? 2 : 1;
1326
+ }
1327
+ e = p;
1328
+ break;
1222
1329
  }
1223
- if (!w && arg->chomp) {
1224
- w = chomp_newline_width(s, e);
1330
+ if (arg->chomp && paragraph_end) {
1331
+ w = e - paragraph_end;
1225
1332
  }
1226
1333
  str = strio_substr(ptr, s - RSTRING_PTR(ptr->string), e - s - w, enc);
1227
1334
  }
@@ -1237,7 +1344,8 @@ strio_getline(struct getline_arg *arg, struct StringIO *ptr)
1237
1344
  if (e - s < 1024) {
1238
1345
  for (p = s; p + n <= e; ++p) {
1239
1346
  if (MEMCMP(p, RSTRING_PTR(str), char, n) == 0) {
1240
- e = p + (arg->chomp ? 0 : n);
1347
+ e = p + n;
1348
+ w = (arg->chomp ? n : 0);
1241
1349
  break;
1242
1350
  }
1243
1351
  }
@@ -1260,11 +1368,13 @@ strio_getline(struct getline_arg *arg, struct StringIO *ptr)
1260
1368
 
1261
1369
  /*
1262
1370
  * call-seq:
1263
- * strio.gets(sep=$/, chomp: false) -> string or nil
1264
- * strio.gets(limit, chomp: false) -> string or nil
1265
- * strio.gets(sep, limit, chomp: false) -> string or nil
1371
+ * gets(sep = $/, chomp: false) -> string or nil
1372
+ * gets(limit, chomp: false) -> string or nil
1373
+ * gets(sep, limit, chomp: false) -> string or nil
1266
1374
  *
1267
- * See IO#gets.
1375
+ * Reads and returns a line from the stream;
1376
+ * assigns the return value to <tt>$_</tt>;
1377
+ * see {Line IO}[https://docs.ruby-lang.org/en/master/IO.html#label-Line+IO].
1268
1378
  */
1269
1379
  static VALUE
1270
1380
  strio_gets(int argc, VALUE *argv, VALUE self)
@@ -1284,11 +1394,12 @@ strio_gets(int argc, VALUE *argv, VALUE self)
1284
1394
 
1285
1395
  /*
1286
1396
  * call-seq:
1287
- * strio.readline(sep=$/, chomp: false) -> string
1288
- * strio.readline(limit, chomp: false) -> string or nil
1289
- * strio.readline(sep, limit, chomp: false) -> string or nil
1397
+ * readline(sep = $/, chomp: false) -> string
1398
+ * readline(limit, chomp: false) -> string
1399
+ * readline(sep, limit, chomp: false) -> string
1290
1400
  *
1291
- * See IO#readline.
1401
+ * Reads a line as with IO#gets, but raises EOFError if already at end-of-file;
1402
+ * see {Line IO}[https://docs.ruby-lang.org/en/master/IO.html#label-Line+IO].
1292
1403
  */
1293
1404
  static VALUE
1294
1405
  strio_readline(int argc, VALUE *argv, VALUE self)
@@ -1300,17 +1411,16 @@ strio_readline(int argc, VALUE *argv, VALUE self)
1300
1411
 
1301
1412
  /*
1302
1413
  * call-seq:
1303
- * strio.each(sep=$/, chomp: false) {|line| block } -> strio
1304
- * strio.each(limit, chomp: false) {|line| block } -> strio
1305
- * strio.each(sep, limit, chomp: false) {|line| block } -> strio
1306
- * strio.each(...) -> anEnumerator
1414
+ * each_line(sep = $/, chomp: false) {|line| ... } -> self
1415
+ * each_line(limit, chomp: false) {|line| ... } -> self
1416
+ * each_line(sep, limit, chomp: false) {|line| ... } -> self
1307
1417
  *
1308
- * strio.each_line(sep=$/, chomp: false) {|line| block } -> strio
1309
- * strio.each_line(limit, chomp: false) {|line| block } -> strio
1310
- * strio.each_line(sep, limit, chomp: false) {|line| block } -> strio
1311
- * strio.each_line(...) -> anEnumerator
1418
+ * Calls the block with each remaining line read from the stream;
1419
+ * does nothing if already at end-of-file;
1420
+ * returns +self+.
1421
+ * See {Line IO}[https://docs.ruby-lang.org/en/master/IO.html#label-Line+IO].
1312
1422
  *
1313
- * See IO#each.
1423
+ * StringIO#each is an alias for StringIO#each_line.
1314
1424
  */
1315
1425
  static VALUE
1316
1426
  strio_each(int argc, VALUE *argv, VALUE self)
@@ -1655,7 +1765,7 @@ strio_truncate(VALUE self, VALUE len)
1655
1765
  if (plen < l) {
1656
1766
  MEMZERO(RSTRING_PTR(string) + plen, char, l - plen);
1657
1767
  }
1658
- return len;
1768
+ return INT2FIX(0);
1659
1769
  }
1660
1770
 
1661
1771
  /*
@@ -1711,7 +1821,14 @@ strio_set_encoding(int argc, VALUE *argv, VALUE self)
1711
1821
  enc = rb_default_external_encoding();
1712
1822
  }
1713
1823
  else {
1714
- enc = rb_to_encoding(ext_enc);
1824
+ enc = rb_find_encoding(ext_enc);
1825
+ if (!enc) {
1826
+ struct rb_io_enc_t convconfig;
1827
+ int oflags, fmode;
1828
+ VALUE vmode = rb_str_append(rb_str_new_cstr("r:"), ext_enc);
1829
+ rb_io_extract_modeenc(&vmode, 0, Qnil, &oflags, &fmode, &convconfig);
1830
+ enc = convconfig.enc2;
1831
+ }
1715
1832
  }
1716
1833
  ptr->enc = enc;
1717
1834
  if (WRITABLE(self)) {
@@ -1731,24 +1848,16 @@ strio_set_encoding_by_bom(VALUE self)
1731
1848
  }
1732
1849
 
1733
1850
  /*
1734
- * Pseudo I/O on String object, with interface corresponding to IO.
1851
+ * \IO streams for strings, with access similar to
1852
+ * {IO}[https://docs.ruby-lang.org/en/master/IO.html];
1853
+ * see {IO}[https://docs.ruby-lang.org/en/master/IO.html].
1735
1854
  *
1736
- * Commonly used to simulate <code>$stdio</code> or <code>$stderr</code>
1855
+ * === About the Examples
1737
1856
  *
1738
- * === Examples
1857
+ * Examples on this page assume that \StringIO has been required:
1739
1858
  *
1740
1859
  * require 'stringio'
1741
1860
  *
1742
- * # Writing stream emulation
1743
- * io = StringIO.new
1744
- * io.puts "Hello World"
1745
- * io.string #=> "Hello World\n"
1746
- *
1747
- * # Reading stream emulation
1748
- * io = StringIO.new "first\nsecond\nlast\n"
1749
- * io.getc #=> "f"
1750
- * io.gets #=> "irst\n"
1751
- * io.read #=> "second\nlast\n"
1752
1861
  */
1753
1862
  void
1754
1863
  Init_stringio(void)