tag:help.rubygems.org,2010-01-19:/discussions/problems/454-gem-sources-in-paths-dont-workRubyGems.org: Discussion 2011-05-27T00:25:52Ztag:help.rubygems.org,2010-01-19:Comment/46296512011-01-08T11:57:19Z2011-01-08T11:57:20ZGem sources in paths don't work<div><p>If I do "gem sources -a <a href=
"http://foo.com/abc">http://foo.com/abc</a>" the command fails
because Rubygems searches for
<code>http://foo.com/specs.4.8.gz</code> instead of <a href=
"http://foo.com/abc/specs.4.8.gz">http://foo.com/abc/specs.4.8.gz</a>`.
Whilst I understand why it would do this, I believe the correct
behaviour would be concat the path.</p>
<p>This boils down to line 239 of spec_fetcher.rb with the URI
instance. + is really an alias for merge, which isn't really the
behavior you want here.</p></div>Chris Lloydtag:help.rubygems.org,2010-01-19:Comment/46296512011-01-18T03:51:12Z2011-01-18T03:51:12ZGem sources in paths don't work<div><p>Ugh :( The gem server code is such a pain. Patches are certainly
welcome for this!</p></div>Nick Quarantotag:help.rubygems.org,2010-01-19:Comment/46296512011-01-18T03:52:17Z2011-01-18T03:52:17ZGem sources in paths don't work<div><p>That being said, maybe geminabox or stickler will treat this
right. Let me know if either of these work.</p>
<p><a href=
"https://github.com/cwninja/geminabox">https://github.com/cwninja/geminabox</a><br>
<a href=
"https://github.com/copiousfreetime/stickler">https://github.com/copiousfreetime/stickler</a></p></div>Nick Quarantotag:help.rubygems.org,2010-01-19:Comment/46296512011-01-18T05:03:54Z2011-01-18T05:03:55ZGem sources in paths don't work<div><p>The problem is with the Rubygems CLI not the server code
(Phewf!). The <a href=
"https://github.com/rubygems/rubygems/blob/master/lib/rubygems/spec_fetcher.rb#L239">
offending code</a> is pretty simple and the fix would probably look
like:</p>
<pre>
<code>spec_path = source_uri.dup
spec_path.path += "/#{file_name}.gz"</code>
</pre>
<p>Though that is totally untested. Probably would also have to
check for the case where the <code>source_uri</code> ends in a
slash. I would submit a patch but my laptop is in the mothership
:(</p></div>Chris Lloydtag:help.rubygems.org,2010-01-19:Comment/46296512011-05-27T00:25:52Z2011-05-27T00:25:52ZGem sources in paths don't work<div><p>Wow, this ticket hasn't been updated in forever. That class has
had a lot of changes but would still accept patches for this. Hit
us with a pull request please! :)</p></div>Nick Quaranto