Issue #10065 has been updated by David MacMahon.


I just realized that the current output is actually valid Markdown (at least Github Flavored Markdown).  The proposed patch does not change that at all.  It just makes the output valid (Github Flavored) Markdown *and* valid YAML! 

The other ideas I allude to at the end of the original post would affect the Markdown aspect of the output, but let's keep those out of the current discussion (for now).


----------------------------------------
Feature #10065: Make `gem env` command output valid YAML
https://bugs.ruby-lang.org/issues/10065#change-47878

* Author: David MacMahon
* Status: Feedback
* Priority: Normal
* Assignee: Eric Hodel
* Category: lib/rubygems
* Target version: 
----------------------------------------
The output of `gem environment` is close to being valid YAML, but the `GEM CONFIGURATION` section uses `key => value` instead of `key: value` so the output cannot be parsed by YAML.  The attached patch changes just one line to make the output of `gem environment` be valid YAML.

I could not find a specification for the output of the `gem environment` command so I am filing this as a feature request rather than as a bug.

The attached patch is the minimum change necessary to create valid YAML.  I think the structure of the resulting YAML output is not optimal.  It is currently a one element Hash whose only value is an Array of one element Hashes.  Is it preferable to address that in a separate feature request or as an expansion of this one?


---Files--------------------------------
0001-Make-gem-env-command-output-valid-YAML.patch (1.12 KB)


-- 
https://bugs.ruby-lang.org/