<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>just_add_watir &#124; Advanced recipes for Watir &#187; .dirname</title>
	<atom:link href="http://justaddwatir.com/tag/dirname/feed/" rel="self" type="application/rss+xml" />
	<link>http://justaddwatir.com</link>
	<description>Advanced recipes for Watir</description>
	<lastBuildDate>Wed, 21 Oct 2009 02:44:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Q. How do I require all ruby files in the current directory?</title>
		<link>http://justaddwatir.com/2008/q-how-do-i-require-all-ruby-files-in-the-current-directory/</link>
		<comments>http://justaddwatir.com/2008/q-how-do-i-require-all-ruby-files-in-the-current-directory/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 11:08:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[watir]]></category>
		<category><![CDATA[.dirname]]></category>
		<category><![CDATA[File]]></category>

		<guid isPermaLink="false">http://justaddwatir.com/watir/?p=19</guid>
		<description><![CDATA[A. Iterate over the directory using the File class ...
Example watir:

dir = File.dirname&#40;__FILE__&#41;
 Dir&#91;File.expand_path&#40;&#34;#{dir}/*.rb&#34;&#41;&#93;.uniq.each do &#124;file&#124;
  require file
 end

]]></description>
			<content:encoded><![CDATA[<p><strong>A. Iterate over the directory using the File class ...</strong><br />
Example watir:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">dir = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span>
 <span style="color:#CC00FF; font-weight:bold;">Dir</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">expand_path</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;#{dir}/*.rb&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">uniq</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>file<span style="color:#006600; font-weight:bold;">|</span>
  <span style="color:#CC0066; font-weight:bold;">require</span> file
 <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://justaddwatir.com/2008/q-how-do-i-require-all-ruby-files-in-the-current-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
