<?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 Good Practice</title>
	<atom:link href="http://yehudakatz.com/2009/07/24/rubygems-good-practice/feed/" rel="self" type="application/rss+xml" />
	<link>http://yehudakatz.com/2009/07/24/rubygems-good-practice/</link>
	<description>Random Geek-Related Thoughts</description>
	<lastBuildDate>Sat, 13 Mar 2010 08:40:57 -0800</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Matt Mitchell</title>
		<link>http://yehudakatz.com/2009/07/24/rubygems-good-practice/comment-page-1/#comment-16977</link>
		<dc:creator>Matt Mitchell</dc:creator>
		<pubDate>Wed, 12 Aug 2009 02:54:22 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=307#comment-16977</guid>
		<description>For the LoadError stuff, how about use Gem.available? instead?

Matt</description>
		<content:encoded><![CDATA[<p>For the LoadError stuff, how about use Gem.available? instead?</p>
<p>Matt</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ara.t.howard</title>
		<link>http://yehudakatz.com/2009/07/24/rubygems-good-practice/comment-page-1/#comment-16931</link>
		<dc:creator>ara.t.howard</dc:creator>
		<pubDate>Sun, 02 Aug 2009 02:48:41 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=307#comment-16931</guid>
		<description>i think this is a bit pre-mature.  specifically i think the approach of pushing gem&#039;s load paths onto $LOAD_PATH is massively flawed and predict it will be removed.  i have already had issues with it several times where gem &#039;a&#039; finds a resource erroneously in gem &#039;b&#039;s directory.  it would be trival (like simply making the gem call take a block - doh!) for rubygems to do a push/pop of the load path during gem loading to provide isolation during loading for guaranteed dependency resolution and i&#039;ve hacked many dep problems into submission be doing precisely this.

if you consider the ramifications (which i think few even understand) that the current gem loading has, which is that:

&quot;requiring dependency &#039;A&#039; means that that client code should then look for each and every other resouce *first* in &#039;A&#039;s private lib directory regardless of whether is has anything to do with &#039;A&#039; or not&quot; is just so patently wrong i think it will not stand the test of time -- saying that i want to load gem &#039;A&#039; doesn&#039;t mean, to any sane person, that i want to load any other gem/lib i require from gem &#039;A&#039;s shit if it happens to provide it.

a larger reason to specify the gem version is that gem authors are bad, really, really bad, at understanding the semantics of version numbers - specifically with regard to interface/implementation issues.  i seriously doubt if 1 in 50 ruby developers could explain the &#039;1&#039;, &#039;4&#039;, and &#039;2&#039; in 1.4.2.  rails itself has suffered badly from this - otherwise you&#039;d be working on rails 7.0 or something ;-)  github has compounded this issue by forcing developers to bump version numbers to force a gem build without really specifying how or why - just that it should be &#039;higher&#039;.

most of the shops i&#039;ve worked at have literally had to re-invent rubygems packaging or a least maintain their own gem servers for just this reason.


i agree with you regarding sane rescuing of LoadError and minimizing over specification of versions though.</description>
		<content:encoded><![CDATA[<p>i think this is a bit pre-mature.  specifically i think the approach of pushing gem&#8217;s load paths onto $LOAD_PATH is massively flawed and predict it will be removed.  i have already had issues with it several times where gem &#8216;a&#8217; finds a resource erroneously in gem &#8216;b&#8217;s directory.  it would be trival (like simply making the gem call take a block &#8211; doh!) for rubygems to do a push/pop of the load path during gem loading to provide isolation during loading for guaranteed dependency resolution and i&#8217;ve hacked many dep problems into submission be doing precisely this.</p>
<p>if you consider the ramifications (which i think few even understand) that the current gem loading has, which is that:</p>
<p>&#8220;requiring dependency &#8216;A&#8217; means that that client code should then look for each and every other resouce *first* in &#8216;A&#8217;s private lib directory regardless of whether is has anything to do with &#8216;A&#8217; or not&#8221; is just so patently wrong i think it will not stand the test of time &#8212; saying that i want to load gem &#8216;A&#8217; doesn&#8217;t mean, to any sane person, that i want to load any other gem/lib i require from gem &#8216;A&#8217;s shit if it happens to provide it.</p>
<p>a larger reason to specify the gem version is that gem authors are bad, really, really bad, at understanding the semantics of version numbers &#8211; specifically with regard to interface/implementation issues.  i seriously doubt if 1 in 50 ruby developers could explain the &#8216;1&#8242;, &#8216;4&#8242;, and &#8216;2&#8242; in 1.4.2.  rails itself has suffered badly from this &#8211; otherwise you&#8217;d be working on rails 7.0 or something ;-)  github has compounded this issue by forcing developers to bump version numbers to force a gem build without really specifying how or why &#8211; just that it should be &#8216;higher&#8217;.</p>
<p>most of the shops i&#8217;ve worked at have literally had to re-invent rubygems packaging or a least maintain their own gem servers for just this reason.</p>
<p>i agree with you regarding sane rescuing of LoadError and minimizing over specification of versions though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Deepak Kannan</title>
		<link>http://yehudakatz.com/2009/07/24/rubygems-good-practice/comment-page-1/#comment-16924</link>
		<dc:creator>Deepak Kannan</dc:creator>
		<pubDate>Fri, 31 Jul 2009 15:47:38 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=307#comment-16924</guid>
		<description>Why not fail early if rubygems is not there? It will be just another dependency.
Also in ruby1.9 rubygems is built-in right? 

If we try to gracefully handle a rubygems error, do i need to know about how ruby gems resolves the dependencies? Although, in my opinion it would be worthwhile to not use rubygems only if it decreases the memory consumption. 

i looked at:
 http://github.com/fabien/minigems/tree/master
 http://rubyforge.org/pipermail/rubygems-developers/2008-July/003988.html</description>
		<content:encoded><![CDATA[<p>Why not fail early if rubygems is not there? It will be just another dependency.<br />
Also in ruby1.9 rubygems is built-in right? </p>
<p>If we try to gracefully handle a rubygems error, do i need to know about how ruby gems resolves the dependencies? Although, in my opinion it would be worthwhile to not use rubygems only if it decreases the memory consumption. </p>
<p>i looked at:<br />
 <a href="http://github.com/fabien/minigems/tree/master" rel="nofollow">http://github.com/fabien/minigems/tree/master</a><br />
 <a href="http://rubyforge.org/pipermail/rubygems-developers/2008-July/003988.html" rel="nofollow">http://rubyforge.org/pipermail/rubygems-developers/2008-July/003988.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raimonds</title>
		<link>http://yehudakatz.com/2009/07/24/rubygems-good-practice/comment-page-1/#comment-16904</link>
		<dc:creator>Raimonds</dc:creator>
		<pubDate>Wed, 29 Jul 2009 10:07:17 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=307#comment-16904</guid>
		<description>Why are you using loading of mocha gem in ActiveSupport TestCase class definition?
http://github.com/rails/rails/commit/7583a24ee0ea85d55a5e235c3082f1b67d3d7694

It seems not according to your recommendation here :)

Because of rescuing of LoadError I several time had difficulties to understand why ActiveRecord unit tests are failing with strange MethodMissing errors.</description>
		<content:encoded><![CDATA[<p>Why are you using loading of mocha gem in ActiveSupport TestCase class definition?<br />
<a href="http://github.com/rails/rails/commit/7583a24ee0ea85d55a5e235c3082f1b67d3d7694" rel="nofollow">http://github.com/rails/rails/commit/7583a24ee0ea85d55a5e235c3082f1b67d3d7694</a></p>
<p>It seems not according to your recommendation here :)</p>
<p>Because of rescuing of LoadError I several time had difficulties to understand why ActiveRecord unit tests are failing with strange MethodMissing errors.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: grosser</title>
		<link>http://yehudakatz.com/2009/07/24/rubygems-good-practice/comment-page-1/#comment-16884</link>
		<dc:creator>grosser</dc:creator>
		<pubDate>Sat, 25 Jul 2009 06:40:23 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=307#comment-16884</guid>
		<description>I really like this idea, it also enables others to simply use the gem even if they do not seem to have the correct version of another gem installed, or to unpack a gem etc.</description>
		<content:encoded><![CDATA[<p>I really like this idea, it also enables others to simply use the gem even if they do not seem to have the correct version of another gem installed, or to unpack a gem etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Carey-Smith</title>
		<link>http://yehudakatz.com/2009/07/24/rubygems-good-practice/comment-page-1/#comment-16883</link>
		<dc:creator>Tim Carey-Smith</dc:creator>
		<pubDate>Sat, 25 Jul 2009 06:15:59 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=307#comment-16883</guid>
		<description>One thing to address would be the reason people do the &#039;gem &quot;abcd&quot;, &quot;&gt;=1.0.2&quot;&#039; in their lib file. 

The most common reason is while development, but the way to solve this is to use the gem specification and activate the dependencies in the Rakefile and spec/spec_helper.rb. 

Using a Gemfile like in the wycats/bundler and then something like: &#039;Gem::Manifest.activate&#039; would do nicely.</description>
		<content:encoded><![CDATA[<p>One thing to address would be the reason people do the &#8216;gem &#8220;abcd&#8221;, &#8220;&gt;=1.0.2&#8243;&#8216; in their lib file. </p>
<p>The most common reason is while development, but the way to solve this is to use the gem specification and activate the dependencies in the Rakefile and spec/spec_helper.rb. </p>
<p>Using a Gemfile like in the wycats/bundler and then something like: &#8216;Gem::Manifest.activate&#8217; would do nicely.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan DeLeo</title>
		<link>http://yehudakatz.com/2009/07/24/rubygems-good-practice/comment-page-1/#comment-16880</link>
		<dc:creator>Dan DeLeo</dc:creator>
		<pubDate>Fri, 24 Jul 2009 15:36:48 +0000</pubDate>
		<guid isPermaLink="false">http://yehudakatz.com/?p=307#comment-16880</guid>
		<description>There was a rant along these lines some months ago. I gave me one of those *HEADDESK* &quot;OMG you&#039;re right!&quot; type epiphanies and I&#039;ve been doing exactly this ever since. It&#039;s easy. Listen to this man!</description>
		<content:encoded><![CDATA[<p>There was a rant along these lines some months ago. I gave me one of those *HEADDESK* &#8220;OMG you&#8217;re right!&#8221; type epiphanies and I&#8217;ve been doing exactly this ever since. It&#8217;s easy. Listen to this man!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
