<?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>sparkymat &#187; ruby</title>
	<atom:link href="http://www.sparkymat.net/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sparkymat.net</link>
	<description></description>
	<lastBuildDate>Wed, 21 Dec 2011 17:09:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Programming Blog</title>
		<link>http://www.sparkymat.net/2008/11/programming-blog/</link>
		<comments>http://www.sparkymat.net/2008/11/programming-blog/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 07:00:53 +0000</pubDate>
		<dc:creator>sparkymat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.sparkymat.net/?p=200</guid>
		<description><![CDATA[I have started a programming blog here.]]></description>
			<content:encoded><![CDATA[<p>I have started a programming blog <a title="The Sparky Labs" href="http://labs.sparkymat.net/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sparkymat.net/2008/11/programming-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby 1.9 on Openmoko!!</title>
		<link>http://www.sparkymat.net/2008/08/ruby-19-on-openmoko/</link>
		<comments>http://www.sparkymat.net/2008/08/ruby-19-on-openmoko/#comments</comments>
		<pubDate>Sun, 10 Aug 2008 11:21:40 +0000</pubDate>
		<dc:creator>sparkymat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[openmoko]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.sparkymat.net/?p=217</guid>
		<description><![CDATA[Managed to compile and package Ruby 1.9.0-3 for Openmoko!!! Download: ruby19-complete_190-3_armv4t [Update] Here&#8217;s the ruby package without dev and documentation (this would be smaller and more appropriate on the phone) &#8211; ruby19_190-3_armv4t]]></description>
			<content:encoded><![CDATA[<p>Managed to compile and package Ruby 1.9.0-3 for Openmoko!!!</p>
<p>Download: <a href="http://blog.sparkymat.net/wp-content/uploads/2008/08/ruby19-complete_190-3_armv4t.ipk">ruby19-complete_190-3_armv4t</a></p>
<p>[Update]</p>
<p>Here&#8217;s the ruby package without dev and documentation (this would be smaller and more appropriate on the phone) &#8211; <a href="http://blog.sparkymat.net/wp-content/uploads/2008/08/ruby19_190-3_armv4t.ipk">ruby19_190-3_armv4t</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sparkymat.net/2008/08/ruby-19-on-openmoko/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Rubygame 3 on Ruby 1.9</title>
		<link>http://www.sparkymat.net/2008/04/rubygame-3-on-ruby-19/</link>
		<comments>http://www.sparkymat.net/2008/04/rubygame-3-on-ruby-19/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 13:53:34 +0000</pubDate>
		<dc:creator>sparkymat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubygame]]></category>

		<guid isPermaLink="false">http://blog.sparkymat.net/2008/04/02/rubygame-3-on-ruby-19/</guid>
		<description><![CDATA[Creating a Ruby 1.9 sandbox 1. mkdir /home/user/ruby19 (example folder) 2. cd /home/user/ruby19 3. mkdir src 4. cd src 5. wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.0-1.tar.bz2 6. tar -jxvf ruby-1.9.0-1.tar.bz2 7. cd ruby-1.9.0-1 8. ./configure &#8211;prefix=/home/user/ruby19 9. make 10. make install Now you can switch to this sandbox at any time by executing &#8216;export PATH=/home/user/ruby19/bin:$PATH&#8217; in a shell. Chipmunk [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Creating a Ruby 1.9 sandbox</strong></p>
<p>1. mkdir /home/user/ruby19 (example folder)<br />
2. cd /home/user/ruby19<br />
3. mkdir src<br />
4. cd src<br />
5. wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.0-1.tar.bz2<br />
6. tar -jxvf ruby-1.9.0-1.tar.bz2<br />
7. cd ruby-1.9.0-1<br />
8. ./configure &#8211;prefix=/home/user/ruby19<br />
9. make<br />
10. make install</p>
<p>Now you can switch to this sandbox at any time by executing &#8216;export PATH=/home/user/ruby19/bin:$PATH&#8217; in a shell.</p>
<p><strong>Chipmunk Installation</strong></p>
<p>Chipmunk is required for Rubygame 3</p>
<p>1. wget http://files.slembcke.net/chipmunk/release/ChipmunkLatest.tgz<br />
2. tar -zxvf ChipmunkLatest.tgz<br />
3. cd Chipmunk-4.0.2<br />
4. cd ruby<br />
5. export PATH=/home/user/ruby19/bin:$PATH (* switching to Ruby 1.9 sandbox)<br />
6. ruby extconf.rb<br />
7. make<br />
8. make install</p>
<p><strong>Rubygame 3 Installation</strong></p>
<p>1. mkdir /home/user/rubygame (example path)<br />
2. cd /home/user/rubygame<br />
3. svn co https://rubygame.svn.sourceforge.net/svnroot/rubygame/trunk rubygame3<br />
4. cd rubygame3/<br />
5. export PATH=/home/user/ruby19/bin:$PATH (* switching to Ruby 1.9 sandbox)<br />
6. cat Rakefile | sed s/PLATFORM/RUBY_PLATFORM/ > Rakefile.new;mv Rakefile.new Rakefile (* this replaces PLATFORM with RUBY_PLATFORM in the Rakefile)<br />
7. CFLAGS=&#8221;-I/home/user/ruby19/include/ruby-1.9.0 -I/home/user/ruby19/include/ruby-1.9.0/i686-linux&#8221; rake install<br />
8. cd ~/rubygame/rubygame3/samples/<br />
9. ruby chimp.rb<br />
10. Punch the monkey!! <img src='http://www.sparkymat.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sparkymat.net/2008/04/rubygame-3-on-ruby-19/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Building an “include” graph</title>
		<link>http://www.sparkymat.net/2006/08/building-an-include-graph/</link>
		<comments>http://www.sparkymat.net/2006/08/building-an-include-graph/#comments</comments>
		<pubDate>Mon, 07 Aug 2006 03:08:38 +0000</pubDate>
		<dc:creator>sparkymat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.sparkymat.net/2006/08/06/building-an-include-graph/</guid>
		<description><![CDATA[How easy would it be to build include graphs in ruby? Here&#8217;s my first attempt: [ruby] $list_of_files = Hash.new $list_of_files.each {&#124;node&#124; node = Array.new } def store_includes(pathname) lines = IO.readlines(pathname) lines.each {&#124;line&#124; if line.include? &#8220;#include&#8221; include_file = line[line.index("#include")+"#include".size,line.size] fidx = 0 sidx = 0 if include_file.include?(&#8220;&#8221;") fidx = include_file.index(&#8220;&#8221;") + 1 sidx = include_file.index(&#8220;&#8221;",fidx+1) &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>How easy would it be to build include graphs in ruby?</p>
<p>Here&#8217;s my first attempt:</p>
<p>[ruby]<br />
$list_of_files = Hash.new<br />
$list_of_files.each {|node|<br />
node = Array.new<br />
}<br />
def store_includes(pathname)<br />
lines = IO.readlines(pathname)<br />
lines.each {|line|<br />
if line.include? &#8220;#include&#8221;<br />
include_file = line[line.index("#include")+"#include".size,line.size]<br />
fidx = 0<br />
sidx = 0</p>
<p>if include_file.include?(&#8220;&#8221;")<br />
fidx = include_file.index(&#8220;&#8221;") + 1<br />
sidx = include_file.index(&#8220;&#8221;",fidx+1) &#8211; 1<br />
end</p>
<p>if include_file.include?(&#8216;< ')<br />
fidx = include_file.index('<') + 1<br />
sidx = include_file.index('>&#8216;) &#8211; 1<br />
end</p>
<p>include_file = include_file[fidx..sidx]<br />
$list_of_files[pathname].add(include_file)<br />
end<br />
}<br />
end</p>
<p>def iterate_files(pathname)<br />
list = [] #alternate way of initializing an array<br />
if pathname==&#8221;.&#8221; or pathname==nil<br />
list = Dir["*"]<br />
else<br />
list = Dir[pathname + File::SEPERATOR + "*"]<br />
end<br />
list.each { |path|<br />
if File.filetype(path) == &#8220;directory&#8221;<br />
iterate_files(pathname)<br />
end<br />
if File.filetype(path) == &#8220;file&#8221;<br />
store_includes(path)<br />
end<br />
}<br />
end<br />
[/ruby]</p>
<p>Any comments?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sparkymat.net/2006/08/building-an-include-graph/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>File extensions in ruby</title>
		<link>http://www.sparkymat.net/2006/08/file-extensions-in-ruby/</link>
		<comments>http://www.sparkymat.net/2006/08/file-extensions-in-ruby/#comments</comments>
		<pubDate>Sun, 06 Aug 2006 07:06:47 +0000</pubDate>
		<dc:creator>sparkymat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.sparkymat.net/2006/08/06/file-extensions-in-ruby/</guid>
		<description><![CDATA[Is there a more efficient way to extract the file extensions in ruby? I currently do the following. [ruby] ext = File.basename(filepath).reverse.split(&#8216;.&#8217;)[0].reverse [/ruby]]]></description>
			<content:encoded><![CDATA[<p>Is there a more efficient way to extract the file extensions in ruby? I currently do the following.</p>
<p>[ruby]</p>
<p>ext = File.basename(filepath).reverse.split(&#8216;.&#8217;)[0].reverse</p>
<p>[/ruby] </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sparkymat.net/2006/08/file-extensions-in-ruby/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

