ruby-changes:58569
From: Burdette <ko1@a...>
Date: Tue, 5 Nov 2019 08:03:20 +0900 (JST)
Subject: [ruby-changes:58569] 74bb8fb348 (master): More rdoc for ENV
https://git.ruby-lang.org/ruby.git/commit/?id=74bb8fb348 From 74bb8fb3480d0b0acaa6ef0bb93cc990cc7bf639 Mon Sep 17 00:00:00 2001 From: Burdette Lamar <BurdetteLamar@Y...> Date: Mon, 4 Nov 2019 17:03:01 -0600 Subject: More rdoc for ENV diff --git a/hash.c b/hash.c index 0eb101e..8cc450f 100644 --- a/hash.c +++ b/hash.c @@ -6214,6 +6214,34 @@ Init_Hash(void) https://github.com/ruby/ruby/blob/trunk/hash.c#L6214 /* Document-class: ENV * * ENV is a hash-like accessor for environment variables. + * + * === Interaction with the Operating System + * The ENV object interacts with the operating system's environment variables: + * - When you get the value for a name in ENV, the value is retrieved from among the current environment variables. + * - When you create or set a name-value pair in ENV, the name and value are immediately set in the environment variables. + * - When you delete a name-value pair in ENV, it is immediately deleted from the environment variables. + * === Names and Values + * Generally speaking, each name or value is a String. + * + * Strictly speaking: + * - Each name or value must be one of the following: + * - A String. + * - An object that responds to #to_str by returning a String, which will be used as the name or value. + * - A name may not: + * - Be the empty string. + * - Contain character <code>=</code> or the NUL character (<code>"\0"</code>). + * - Have an ASCII-incompatible encoding (e.g., UTF-16LE, ISO-2022-JP). + + * === About Ordering + * ENV presents its content in the order found + * in the operating system's environment variables. + * Therefore the ordering of ENV content is OS-dependent, and may be indeterminate. + * + * This will be seen in: + * - A Hash returned by an ENV method. + * - An Enumerator returned by an ENV method. + * - An Array returned by ENV.keys, ENV.values, or ENV.to_a. + * - The String returned by ENV.inspect. */ /* -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/