<?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>Eureka Man &#187; Ruby</title>
	<atom:link href="http://eurekaman.com/category/ruby/feed" rel="self" type="application/rss+xml" />
	<link>http://eurekaman.com</link>
	<description>Pure Gold</description>
	<lastBuildDate>Mon, 28 Jun 2010 05:38:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Commenting Ruby in Xcode</title>
		<link>http://eurekaman.com/commenting-ruby-in-xcode</link>
		<comments>http://eurekaman.com/commenting-ruby-in-xcode#comments</comments>
		<pubDate>Sat, 09 Dec 2006 06:34:02 +0000</pubDate>
		<dc:creator>Eureka Man</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://eurekaman.com/commenting-ruby-in-xcode</guid>
		<description><![CDATA[UPDATE: The new TextWrangler 2.2 has Ruby highlighting. Yay!
Coding Ruby in Xcode on a Mac?  Like the built-in syntax highlighting but wondering why the apple+/ shortcut makes C comments, not Ruby comments?  The following might save you a few minutes digging.
Find and open this file:
/Library
  /Application&#160;Support
    /Apple
   [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><strong>UPDATE:</strong> The new <a href="http://www.barebones.com/products/textwrangler/">TextWrangler 2.2</a> has Ruby highlighting. Yay!</p></blockquote>
<p>Coding Ruby in Xcode on a Mac?  Like the built-in syntax highlighting but wondering why the apple+/ shortcut makes C comments, not Ruby comments?  The following might save you a few minutes digging.</p>
<p>Find and open this file:</p>
<pre>/Library
  /Application&nbsp;Support
    /Apple
      /Developer&nbsp;Tools
        /Scripts
          /10-User Scripts
            /30-Comments
              /10-un_commentLines.pl</pre>
<p>Replace this...</p>
<div class="igBar"><span id="lperl-3"><a href="#" onclick="javascript:showPlainTxt('perl-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PERL:</span>
<div id="perl-3">
<div class="perl">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># determine the type of file we have by looking for the #! line at the top</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># careful--it might already be commented out!</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$commentString</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$fileString</span> =~ <a href="http://www.perldoc.com/perl5.6/pod/func/m.html"><span style="color: #000066;">m</span></a>!^<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$perlCmt</span>|<span style="color: #0000ff;">$cCmt</span><span style="color: #66cc66;">&#41;</span>?<span style="color: #808080; font-style: italic;">#\!\s*.*?/perl|^($perlCmt|$cCmt)?#\!\s*.*?/sh!) {</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0000ff;">$commentString</span> = <span style="color: #0000ff;">$perlCmt</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0000ff;">$commentString</span> = <span style="color: #0000ff;">$cCmt</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>...with this...</p>
<div class="igBar"><span id="lperl-4"><a href="#" onclick="javascript:showPlainTxt('perl-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PERL:</span>
<div id="perl-4">
<div class="perl">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$fileName</span> = <span style="color: #ff0000;">"%%%{PBXFilePath}%%%"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># determine the type of file we have by looking for the #! line at the top</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># careful--it might already be commented out!</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># Otherwise look at the file extension</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$commentString</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$fileString</span> =~ <a href="http://www.perldoc.com/perl5.6/pod/func/m.html"><span style="color: #000066;">m</span></a>!^<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$perlCmt</span>|<span style="color: #0000ff;">$cCmt</span><span style="color: #66cc66;">&#41;</span>?<span style="color: #808080; font-style: italic;">#\!\s*.*?/perl|^($perlCmt|$cCmt)?#\!\s*.*?/sh!</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">||&nbsp; <span style="color: #0000ff;">$fileName</span> =~ <a href="http://www.perldoc.com/perl5.6/pod/func/m.html"><span style="color: #000066;">m</span></a>!\.<span style="color: #66cc66;">&#40;</span>rb|pl|sh<span style="color: #66cc66;">&#41;</span>$!<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0000ff;">$commentString</span> = <span style="color: #0000ff;">$perlCmt</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0000ff;">$commentString</span> = <span style="color: #0000ff;">$cCmt</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Restart Xcode.  Now commenting should work properly.</p>
]]></content:encoded>
			<wfw:commentRss>http://eurekaman.com/commenting-ruby-in-xcode/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
