[#63592] [ruby-trunk - Bug #10009] IO operation is 10x slower in multi-thread environment — normalperson@...
Issue #10009 has been updated by Eric Wong.
3 messages
2014/07/08
[#63682] [ruby-trunk - Feature #10030] [PATCH] reduce rb_iseq_struct to 296 bytes — ko1@...
Issue #10030 has been updated by Koichi Sasada.
3 messages
2014/07/13
[#63703] [ruby-trunk - Feature #10030] [PATCH] reduce rb_iseq_struct to 296 bytes — ko1@...
Issue #10030 has been updated by Koichi Sasada.
3 messages
2014/07/14
[#63743] [ruby-trunk - Bug #10037] Since r46798 on Solaris, "[BUG] rb_vm_get_cref: unreachable" during make — ngotogenome@...
Issue #10037 has been updated by Naohisa Goto.
3 messages
2014/07/15
[#64136] Ruby 2.1.2 (and 2.1.1 and probably others) assumes a libffi with 3 version numbers in extconf.rb — "Jeffrey 'jf' Lim" <jfs.world@...>
As per subject.
4 messages
2014/07/31
[#64138] Re: Ruby 2.1.2 (and 2.1.1 and probably others) assumes a libffi with 3 version numbers in extconf.rb
— "Jeffrey 'jf' Lim" <jfs.world@...>
2014/07/31
On Thu, Jul 31, 2014 at 6:03 PM, Jeffrey 'jf' Lim <[email protected]>
[ruby-core:63841] [ruby-trunk - Feature #10065] Make `gem env` command output valid YAML
From:
davidm@...
Date:
2014-07-18 23:01:51 UTC
List:
ruby-core #63841
Issue #10065 has been updated by David MacMahon.
It doesn't *need* to be YAML, but does it need *not* to be YAML? It is sooooo close already why not make it YAML? Besides, much of the info in the `GEM CONFIGURATION` section (where the only non-YAML syntax exists) comes from YAML files already (i.e. `${HOME}/.gemrc` and the system-wide `gemrc` file), so why output that in a different format?
How would the proposed change make it too clumsy to be useful? If anything, it makes it less clumsy to use. The current output of `gem environment` cannot be eval'd by Ruby, so what benefit does the rocket ship provide over the colon?
Without the proposed patch:
```bash
$ ruby -r pp -r yaml -e 'pp YAML.load `gem env`'
/Users/davidm/local/lib/ruby/2.1.0/psych.rb:370:in `parse': (<unknown>): did not find expected '-' indicator while parsing a block collection at line 16 column 6 (Psych::SyntaxError)
from /Users/davidm/local/lib/ruby/2.1.0/psych.rb:370:in `parse_stream'
from /Users/davidm/local/lib/ruby/2.1.0/psych.rb:318:in `parse'
from /Users/davidm/local/lib/ruby/2.1.0/psych.rb:245:in `load'
from -e:1:in `<main>'
```
Emulating the proposed patch at runtime:
```bash
$ ruby -r pp -r yaml -e 'pp YAML.load `gem env`.gsub(" =>",":")'
{"RubyGems Environment"=>
[{"RUBYGEMS VERSION"=>"2.4.1"},
# etc...
```
----------------------------------------
Feature #10065: Make `gem env` command output valid YAML
https://bugs.ruby-lang.org/issues/10065#change-47874
* 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/