<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>opensoul.org - Ruby's require doesn't expand paths Comments</title>
  <id>tag:www.opensoul.org,2008:/2008/1/9/ruby-s-require-doesn-t-expand-paths/comments</id>
  <generator version="0.8.0" uri="http://mephistoblog.com">Mephisto Drax</generator>
  <link href="http://www.opensoul.org/2008/1/9/ruby-s-require-doesn-t-expand-paths/comments.xml" rel="self" type="application/atom+xml"/>
  <link href="/2008/1/9/ruby-s-require-doesn-t-expand-paths" rel="alternate" type="text/html"/>
  <updated>2008-05-28T01:03:44Z</updated>
  <entry xml:base="http://www.opensoul.org/">
    <author>
      <name>Jamie Flournoy</name>
    </author>
    <id>tag:www.opensoul.org,2008-01-09:4946:6275</id>
    <published>2008-05-28T01:03:44Z</published>
    <updated>2008-05-28T01:03:44Z</updated>
    <category term="Code"/>
    <link href="http://www.opensoul.org/2008/1/9/ruby-s-require-doesn-t-expand-paths" rel="alternate" type="text/html"/>
    <title>Comment on 'Ruby's require doesn't expand paths' by Jamie Flournoy</title>
<content type="html">&lt;p&gt;I wrote a snippet that automates this, in case you aren&#8217;t up for the global search and replace alternative.&lt;/p&gt;


	&lt;p&gt;http://www.pervasivecode.com/blog/2008/05/16/rails-snippet-require-app-files-only-once/&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://www.opensoul.org/">
    <author>
      <name>Rob Sanheim</name>
    </author>
    <id>tag:www.opensoul.org,2008-01-09:4946:5814</id>
    <published>2008-04-23T00:56:54Z</published>
    <updated>2008-04-23T00:56:54Z</updated>
    <category term="Code"/>
    <link href="http://www.opensoul.org/2008/1/9/ruby-s-require-doesn-t-expand-paths" rel="alternate" type="text/html"/>
    <title>Comment on 'Ruby's require doesn't expand paths' by Rob Sanheim</title>
<content type="html">&lt;p&gt;This is fixed in 1.9.  WIll be very nice to drop the nasty expand_path everywhere.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://www.opensoul.org/">
    <author>
      <name>Brandon</name>
    </author>
    <id>tag:www.opensoul.org,2008-01-09:4946:5097</id>
    <published>2008-01-21T01:23:52Z</published>
    <updated>2008-01-21T01:23:52Z</updated>
    <category term="Code"/>
    <link href="http://www.opensoul.org/2008/1/9/ruby-s-require-doesn-t-expand-paths" rel="alternate" type="text/html"/>
    <title>Comment on 'Ruby's require doesn't expand paths' by Brandon</title>
<content type="html">&lt;p&gt;James,&lt;/p&gt;


	&lt;p&gt;I think you have that backwards.  From the &lt;a href=&quot;http://ruby-doc.org/core/classes/Kernel.html#M005966&quot;&gt;Ruby &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; docs for &lt;code&gt;#require&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;The name of the loaded feature is added to the array in $&#8221;. A feature will not be loaded if it‘s name already appears in $&#8221;.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;Also, neither &lt;code&gt;#require&lt;/code&gt; or &lt;code&gt;#load&lt;/code&gt; behave differently based on if the file is modified.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://www.opensoul.org/">
    <author>
      <name>James Deville</name>
    </author>
    <id>tag:www.opensoul.org,2008-01-09:4946:5064</id>
    <published>2008-01-19T05:32:54Z</published>
    <updated>2008-01-19T05:32:54Z</updated>
    <category term="Code"/>
    <link href="http://www.opensoul.org/2008/1/9/ruby-s-require-doesn-t-expand-paths" rel="alternate" type="text/html"/>
    <title>Comment on 'Ruby's require doesn't expand paths' by James Deville</title>
<content type="html">&lt;p&gt;Another issue is that require is not meant to load a file only once. Load is. If you require a file, change it, and require it again, your changes will be picked up. If you load a file, change it, and load it again, no change. This is on purpose since sometimes you do want to load a file twice.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://www.opensoul.org/">
    <author>
      <name>James Moore</name>
    </author>
    <id>tag:www.opensoul.org,2008-01-09:4946:4950</id>
    <published>2008-01-09T18:52:10Z</published>
    <updated>2008-01-09T18:52:10Z</updated>
    <category term="Code"/>
    <link href="http://www.opensoul.org/2008/1/9/ruby-s-require-doesn-t-expand-paths" rel="alternate" type="text/html"/>
    <title>Comment on 'Ruby's require doesn't expand paths' by James Moore</title>
<content type="html">&lt;p&gt;Another way to solve this is that everyone always does the vanilla&lt;/p&gt;


	&lt;p&gt;require File.dirname(&lt;i&gt;&lt;span class=&quot;caps&quot;&gt;FILE&lt;/span&gt;&lt;/i&gt;) + &#8217;/../test_helper&#8217;&lt;/p&gt;


	&lt;p&gt;But add a test_helper.rb file (or files, depending on how many sublevels you have) that then includes the right test_helper.rb.&lt;/p&gt;


	&lt;p&gt;The advantage to doing it this way is you never have to care how many /../ substrings there are in your paths.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://www.opensoul.org/">
    <author>
      <name>Eric-Olivier Lamey</name>
    </author>
    <id>tag:www.opensoul.org,2008-01-09:4946:4948</id>
    <published>2008-01-09T11:52:28Z</published>
    <updated>2008-01-09T11:52:28Z</updated>
    <category term="Code"/>
    <link href="http://www.opensoul.org/2008/1/9/ruby-s-require-doesn-t-expand-paths" rel="alternate" type="text/html"/>
    <title>Comment on 'Ruby's require doesn't expand paths' by Eric-Olivier Lamey</title>
<content type="html">&lt;p&gt;I think this behaviour was changed in ruby 1.9.&lt;/p&gt;</content>  </entry>
</feed>
