<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: RubyGems: Problems and (proposed) Solutions</title>
	<atom:link href="http://yehudakatz.com/2009/06/15/rubygems-problems-and-proposed-solutions/feed/" rel="self" type="application/rss+xml" />
	<link>http://yehudakatz.com/2009/06/15/rubygems-problems-and-proposed-solutions/</link>
	<description>Random Geek-Related Thoughts</description>
	<lastBuildDate>Tue, 16 Mar 2010 14:46:49 -0700</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Dan Kubb</title>
		<link>http://yehudakatz.com/2009/06/15/rubygems-problems-and-proposed-solutions/comment-page-1/#comment-16626</link>
		<dc:creator>Dan Kubb</dc:creator>
		<pubDate>Tue, 23 Jun 2009 03:20:10 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=259#comment-16626</guid>
		<description>One of the things I really liked about the CPAN installation process was that the tests were run for each package that you attemp to install.  When there are failures you know up-front rather than later on when you try to use the package.  It would be nice if there was a way with either rubygems or rip for the author to specify if you want the tests/specs to be executed prior to installing the package.</description>
		<content:encoded><![CDATA[<p>One of the things I really liked about the CPAN installation process was that the tests were run for each package that you attemp to install.  When there are failures you know up-front rather than later on when you try to use the package.  It would be nice if there was a way with either rubygems or rip for the author to specify if you want the tests/specs to be executed prior to installing the package.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: draegtun</title>
		<link>http://yehudakatz.com/2009/06/15/rubygems-problems-and-proposed-solutions/comment-page-1/#comment-16594</link>
		<dc:creator>draegtun</dc:creator>
		<pubDate>Thu, 18 Jun 2009 11:14:09 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=259#comment-16594</guid>
		<description>&quot;What I’d like to do here is take the good ideas that exist in Merb, rip, and the Python community and make them native to Rubygems, addressing the problems I outlined above that are inherent to the transition.&quot;

It wouldn&#039;t do RubyGems any harm If you could also take a page (or two!) out of Perl &amp; CPAN&#039;s book.

/I3az/</description>
		<content:encoded><![CDATA[<p>&#8220;What I’d like to do here is take the good ideas that exist in Merb, rip, and the Python community and make them native to Rubygems, addressing the problems I outlined above that are inherent to the transition.&#8221;</p>
<p>It wouldn&#8217;t do RubyGems any harm If you could also take a page (or two!) out of Perl &amp; CPAN&#8217;s book.</p>
<p>/I3az/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dr Nic</title>
		<link>http://yehudakatz.com/2009/06/15/rubygems-problems-and-proposed-solutions/comment-page-1/#comment-16583</link>
		<dc:creator>Dr Nic</dc:creator>
		<pubDate>Wed, 17 Jun 2009 01:34:04 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=259#comment-16583</guid>
		<description>Re: one folder within lib/ - this would prevent the rubygems + hoe plugin mechanism which require a lib/hoe/my_plugin.rb structure. I&#039;ll re-read what you propose again, nonetheless.

Having outlined some existing conflicts, there&#039;s no real need for &quot;plugins&quot; to be within the lib folder of a gem. Why not a &quot;plugins/hoe/my_plugin.rb&quot; structure, for example.

FYI Ryan Davis&#039; summary of hoe 2&#039;s plugins is at http://blog.zenspider.com/2009/06/hoe-2-electric-boogaloo.html</description>
		<content:encoded><![CDATA[<p>Re: one folder within lib/ &#8211; this would prevent the rubygems + hoe plugin mechanism which require a lib/hoe/my_plugin.rb structure. I&#8217;ll re-read what you propose again, nonetheless.</p>
<p>Having outlined some existing conflicts, there&#8217;s no real need for &#8220;plugins&#8221; to be within the lib folder of a gem. Why not a &#8220;plugins/hoe/my_plugin.rb&#8221; structure, for example.</p>
<p>FYI Ryan Davis&#8217; summary of hoe 2&#8217;s plugins is at <a href="http://blog.zenspider.com/2009/06/hoe-2-electric-boogaloo.html" rel="nofollow">http://blog.zenspider.com/2009/06/hoe-2-electric-boogaloo.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wycats</title>
		<link>http://yehudakatz.com/2009/06/15/rubygems-problems-and-proposed-solutions/comment-page-1/#comment-16581</link>
		<dc:creator>wycats</dc:creator>
		<pubDate>Tue, 16 Jun 2009 16:27:16 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=259#comment-16581</guid>
		<description>@roger actually, your first wish is handled by my proposal. I&#039;m suggesting that if your gem is named ParseTree, you are only allowed to have ParseTree.rb.</description>
		<content:encoded><![CDATA[<p>@roger actually, your first wish is handled by my proposal. I&#8217;m suggesting that if your gem is named ParseTree, you are only allowed to have ParseTree.rb.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: roger</title>
		<link>http://yehudakatz.com/2009/06/15/rubygems-problems-and-proposed-solutions/comment-page-1/#comment-16580</link>
		<dc:creator>roger</dc:creator>
		<pubDate>Tue, 16 Jun 2009 16:05:57 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=259#comment-16580</guid>
		<description>My wish for gems...
in no order...

some naming convention--if your gem is named ParseTree, you require &#039;parse_tree&#039; or what not.  mime-types you are killing me!


different dependencies based on platform.

ability to have different binaries [i.e. so if I&#039;m in 1.9 and do an install with a binary gem, it won&#039;t install a 1.8 binary].

ability to install from a url

searching for gems not be case sensitive.

Sorry they&#039;re not related to your post just wanted to get that off my chest.
-=r</description>
		<content:encoded><![CDATA[<p>My wish for gems&#8230;<br />
in no order&#8230;</p>
<p>some naming convention&#8211;if your gem is named ParseTree, you require &#8216;parse_tree&#8217; or what not.  mime-types you are killing me!</p>
<p>different dependencies based on platform.</p>
<p>ability to have different binaries [i.e. so if I'm in 1.9 and do an install with a binary gem, it won't install a 1.8 binary].</p>
<p>ability to install from a url</p>
<p>searching for gems not be case sensitive.</p>
<p>Sorry they&#8217;re not related to your post just wanted to get that off my chest.<br />
-=r</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: raggi</title>
		<link>http://yehudakatz.com/2009/06/15/rubygems-problems-and-proposed-solutions/comment-page-1/#comment-16576</link>
		<dc:creator>raggi</dc:creator>
		<pubDate>Tue, 16 Jun 2009 10:15:56 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=259#comment-16576</guid>
		<description>I couldn&#039;t agree more with the warnings for bad convention usage.

Sometimes there are valid reasons for doing this, but clearly it&#039;s rare. When there are, it&#039;s just one or two more files in the top level, for require (more on this later).

The pain point here for a lot of folks I think is testing and managing the load path. Under good advice, they&#039;re told not to modify the load path, but this kind of layout can become a real pain to run libs locally or do exploratory testing work from the repo.

Gems installed that run an extconf.rb or other external builder should be made platform specific before installation. In other words, especially in ~/.gem, they should be installed as -x86* or -java* if they build on those platforms. These gems should also be explicitly interpreter version specific.

The manifest problem reaches a bit farther, however. It&#039;s not just lib dir layout that needs a hike in order to make memory usage sane (on MRI), it&#039;s also adding some new solution for plugin discovery. At present we&#039;re at the crossroads, where rubygems is now running through a lot of code (on YARV) to avoid loading the gemspecs (manifests). This is great, and works well, until one starts searching for plugins. All of a sudden we&#039;re splatting many a string all over ram, just to find a match.

It makes me almost tempted to go down the amalgamite route and to start hiding away parts of the implementation in order to avoid loading the specs. Amusingly it would have made Tims job a lot easier too, being that we could have used a simple cached nested set arrangement in a db, and just selected from it.

Just more food for thought.</description>
		<content:encoded><![CDATA[<p>I couldn&#8217;t agree more with the warnings for bad convention usage.</p>
<p>Sometimes there are valid reasons for doing this, but clearly it&#8217;s rare. When there are, it&#8217;s just one or two more files in the top level, for require (more on this later).</p>
<p>The pain point here for a lot of folks I think is testing and managing the load path. Under good advice, they&#8217;re told not to modify the load path, but this kind of layout can become a real pain to run libs locally or do exploratory testing work from the repo.</p>
<p>Gems installed that run an extconf.rb or other external builder should be made platform specific before installation. In other words, especially in ~/.gem, they should be installed as -x86* or -java* if they build on those platforms. These gems should also be explicitly interpreter version specific.</p>
<p>The manifest problem reaches a bit farther, however. It&#8217;s not just lib dir layout that needs a hike in order to make memory usage sane (on MRI), it&#8217;s also adding some new solution for plugin discovery. At present we&#8217;re at the crossroads, where rubygems is now running through a lot of code (on YARV) to avoid loading the gemspecs (manifests). This is great, and works well, until one starts searching for plugins. All of a sudden we&#8217;re splatting many a string all over ram, just to find a match.</p>
<p>It makes me almost tempted to go down the amalgamite route and to start hiding away parts of the implementation in order to avoid loading the specs. Amusingly it would have made Tims job a lot easier too, being that we could have used a simple cached nested set arrangement in a db, and just selected from it.</p>
<p>Just more food for thought.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shane</title>
		<link>http://yehudakatz.com/2009/06/15/rubygems-problems-and-proposed-solutions/comment-page-1/#comment-16575</link>
		<dc:creator>Shane</dc:creator>
		<pubDate>Tue, 16 Jun 2009 06:52:24 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=259#comment-16575</guid>
		<description>A bit OT but I&#039;d like to expand gem dependencies talk to include platform dependencies.

If we are looking for low hanging fruit that would make lives a lot easier could we do something more with required_ruby_version to better express Ruby version compatibility from authors? Perhaps make it a requirement or use a less inclusive default like the ~&gt; ruby version at the time of gem build?

I&#039;d love gem list, search etc. to show me only gems expected to work on my platform but myself (like most authors?) don&#039;t even set the gemspec property because of the (current?) &gt; 0 default I think. This would be good first step before attempting a gem install ... --test

Obviously this has come about because of Ruby 1.9 but it applies equally to people running any version of Ruby on any platform.</description>
		<content:encoded><![CDATA[<p>A bit OT but I&#8217;d like to expand gem dependencies talk to include platform dependencies.</p>
<p>If we are looking for low hanging fruit that would make lives a lot easier could we do something more with required_ruby_version to better express Ruby version compatibility from authors? Perhaps make it a requirement or use a less inclusive default like the ~&gt; ruby version at the time of gem build?</p>
<p>I&#8217;d love gem list, search etc. to show me only gems expected to work on my platform but myself (like most authors?) don&#8217;t even set the gemspec property because of the (current?) &gt; 0 default I think. This would be good first step before attempting a gem install &#8230; &#8211;test</p>
<p>Obviously this has come about because of Ruby 1.9 but it applies equally to people running any version of Ruby on any platform.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wycats</title>
		<link>http://yehudakatz.com/2009/06/15/rubygems-problems-and-proposed-solutions/comment-page-1/#comment-16572</link>
		<dc:creator>wycats</dc:creator>
		<pubDate>Tue, 16 Jun 2009 04:18:32 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=259#comment-16572</guid>
		<description>@charles

I don&#039;t really see this as pushing the problem to the producer... in fact, I think it simplifies the choices of the producer, making it easier to make standard gems.

It is true that multiple gems that install into win32/process and win32/clipboard would become win32-process and win32-clipboard. However, the current situation creates potential conflicts, because no top-level name is owned by anyone. As a result, if I write a gem called win32-pid and put something in win32/process, I might stomp over the win32-process gem. Stuff like this happens in the wild.

Auxiliary files would not need to be contained in the lib directory. I was perhaps a bit imprecise. What I meant to say was that only a single directory could be added to the load path, and that directory must contain only the foo directory and foo.rb. This is already what the vast majority of gems do, since it&#039;s a pretty reasonable practice even without enforcing.

I&#039;ve done some work on loading multiple versions of a library. It&#039;s quite possible for many situations, but not all, because it&#039;s possible for loading a library to manipulate global state or run code in the global context. If gems would agree to put all running code inside a single namespace, I have code that would enable loading a gem into a different namespace (but again, this sort of thing would not work for many existing gems because of how dynamic Ruby is).</description>
		<content:encoded><![CDATA[<p>@charles</p>
<p>I don&#8217;t really see this as pushing the problem to the producer&#8230; in fact, I think it simplifies the choices of the producer, making it easier to make standard gems.</p>
<p>It is true that multiple gems that install into win32/process and win32/clipboard would become win32-process and win32-clipboard. However, the current situation creates potential conflicts, because no top-level name is owned by anyone. As a result, if I write a gem called win32-pid and put something in win32/process, I might stomp over the win32-process gem. Stuff like this happens in the wild.</p>
<p>Auxiliary files would not need to be contained in the lib directory. I was perhaps a bit imprecise. What I meant to say was that only a single directory could be added to the load path, and that directory must contain only the foo directory and foo.rb. This is already what the vast majority of gems do, since it&#8217;s a pretty reasonable practice even without enforcing.</p>
<p>I&#8217;ve done some work on loading multiple versions of a library. It&#8217;s quite possible for many situations, but not all, because it&#8217;s possible for loading a library to manipulate global state or run code in the global context. If gems would agree to put all running code inside a single namespace, I have code that would enable loading a gem into a different namespace (but again, this sort of thing would not work for many existing gems because of how dynamic Ruby is).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles L</title>
		<link>http://yehudakatz.com/2009/06/15/rubygems-problems-and-proposed-solutions/comment-page-1/#comment-16571</link>
		<dc:creator>Charles L</dc:creator>
		<pubDate>Tue, 16 Jun 2009 03:43:27 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=259#comment-16571</guid>
		<description>So what you&#039;re proposing is essentially to push the namespacing problem onto the gem producer, whereas current rubygems makes this the problem of the consumer. The proposed mechanism will also mean conflating gem names with the actual require paths, which is a fairly big change, and perhaps sub-optimal.

One effect would be requires will need to contain the user name for github gem distribution. Another would be gems that provide files at something other than a top-level namespace would need to be flattened. Currently I have installed win32-process, and win32-clipboard, which provide for requiring &#039;win32/process&#039; and &#039;win32/clipboard&#039; respectively.

In which case, if we&#039;re going to have to change the client code require paths, we can simple make any given gem minimially &quot;compliant&quot; by unpacking into a directory based on its gem name and creating the stub ruby file at the top level which loads the gem within. Alternatively, if you want to avoid overriding require, just put them all in the loadpath - $:.unshift(*Dir[File.dirname(__FILE__) + &#039;/gems/*/lib&#039;]).

Another thing to consider is auxiliary files like tests, misc data files etc. By putting them in the same foo/ directory, they would be available within the load path, which seems a bit inelegant.

I think it could be more interesting to see more work on the issue of loading multiple versions of a library, or more generally the ability to require a gem (or whatever) into its own isolated namespace (similar to python&#039;s ability to make namespacing the job of a module consumer). I&#039;ve done some work on this exploiting the anonymous module option of Kernel#load, to provide what is essentially, require &#039;mycode&#039;, :into =&gt; MyModule.</description>
		<content:encoded><![CDATA[<p>So what you&#8217;re proposing is essentially to push the namespacing problem onto the gem producer, whereas current rubygems makes this the problem of the consumer. The proposed mechanism will also mean conflating gem names with the actual require paths, which is a fairly big change, and perhaps sub-optimal.</p>
<p>One effect would be requires will need to contain the user name for github gem distribution. Another would be gems that provide files at something other than a top-level namespace would need to be flattened. Currently I have installed win32-process, and win32-clipboard, which provide for requiring &#8216;win32/process&#8217; and &#8216;win32/clipboard&#8217; respectively.</p>
<p>In which case, if we&#8217;re going to have to change the client code require paths, we can simple make any given gem minimially &#8220;compliant&#8221; by unpacking into a directory based on its gem name and creating the stub ruby file at the top level which loads the gem within. Alternatively, if you want to avoid overriding require, just put them all in the loadpath &#8211; $:.unshift(*Dir[File.dirname(__FILE__) + '/gems/*/lib']).</p>
<p>Another thing to consider is auxiliary files like tests, misc data files etc. By putting them in the same foo/ directory, they would be available within the load path, which seems a bit inelegant.</p>
<p>I think it could be more interesting to see more work on the issue of loading multiple versions of a library, or more generally the ability to require a gem (or whatever) into its own isolated namespace (similar to python&#8217;s ability to make namespacing the job of a module consumer). I&#8217;ve done some work on this exploiting the anonymous module option of Kernel#load, to provide what is essentially, require &#8216;mycode&#8217;, :into =&gt; MyModule.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
