rubygems / new-index

Prototype and documentation of the new gem index format
12 stars 2 forks source link

Version list format of deps file is not extensible #3

Closed sheerun closed 10 years ago

sheerun commented 10 years ago

Allowing spaces in dependences versions while spaces are used to separate columns in deps file makes this format pretty much not extensible.

How about stripping spaces of all versions like so:

1.5.7.rc2 rake:>=0.7.1,activesupport:=1.3.1|ruby:>=1.8.7,rubygems:>1.3.1

This allows to add third column (sha?) in future and still use split(' ') to separate them.

Also I don't think you should encourage clients to use split(' ', 2) because it's not forward-compatible way of parsing files.

sheerun commented 10 years ago

Also, it's not the case that splitting second column by `and then by|is slower than using 3 columns instead, and usesplit(' ')`? In first case versions string needs to be traversed 2 times by algorithm.

1.5.7.rc2 rake:>=0.7.1,activesupport:=1.3.1 ruby:>=1.8.7,rubygems:>1.3.1
sheerun commented 10 years ago

OK, I see following:

The requirements after the | character are currently limited to ruby and rubygems, but could be expanded to include any arbitrary requirement in the future. Code that parses those requirements should ignore unknown keys for future compatibility.

I understand if in future an sha will need to be added there will be something like:

1.5.7.rc2 rake:>=0.7.1,activesupport:=1.3.1|ruby:>=1.8.7,rubygems:>1.3.1,sha:673823c4

right?

indirect commented 10 years ago

Yup, you've got it.

On Tue, Apr 8, 2014 at 4:14 AM, Adam Stankiewicz notifications@github.com wrote:

OK, I see following:

The requirements after the | character are currently limited to ruby and rubygems, but could be expanded to include any arbitrary requirement in the future. Code that parses those requirements should ignore unknown keys for future compatibility. I understand if in future an sha will need to be added there will be something like:

1.5.7.rc2 rake:>=0.7.1,activesupport:=1.3.1|ruby:>=1.8.7,rubygems:>1.3.1,sha:673823c4

right?

Reply to this email directly or view it on GitHub: https://github.com/bundler/new-index/issues/3#issuecomment-39836173