<?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>Brain Matters &#187; ruby</title>
	<atom:link href="http://blog.agoragames.com/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.agoragames.com</link>
	<description></description>
	<lastBuildDate>Thu, 29 Jul 2010 19:13:58 +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>Brightercove</title>
		<link>http://blog.agoragames.com/2010/07/29/brightercove/</link>
		<comments>http://blog.agoragames.com/2010/07/29/brightercove/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 19:13:58 +0000</pubDate>
		<dc:creator>David Czarnecki</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[brightcove]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.agoragames.com/?p=676</guid>
		<description><![CDATA[We&#8217;re using Brightcove here at Agora Games for some video platform work. In our group chats, we&#8217;ve talked about, &#8220;It would be nice if we had a Ruby API for interacting with Brightcove.&#8221;
And so I did just that, http://github.com/agoragames/brightcove


sudo gem install brightcove-api

&#62;&#62; require &#039;brightcove-api&#039;
=&#62; true
&#62;&#62; brightcove = Brightcove::API.new(&#039;0Z2dtxTdJAxtbZ-d0U7Bhio2V1Rhr5Iafl5FFtDPY8E.&#039;)
=&#62; #&#60;brightcove ::API:0x114dbc8 @token=&#34;0Z2dtxTdJAxtbZ-d0U7Bhio2V1Rhr5Iafl5FFtDPY8E.&#34;, @api_url=&#34;http://api.brightcove.com/services/library&#34;&#62;
&#62;&#62; response = brightcove.get(&#039;find_all_videos&#039;, [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re using <a href="http://www.brightcove.com/en/">Brightcove</a> here at Agora Games for some video platform work. In our group chats, we&#8217;ve talked about, &#8220;It would be nice if we had a Ruby API for interacting with Brightcove.&#8221;</p>
<p>And so I did just that, <a href="http://github.com/agoragames/brightcove">http://github.com/agoragames/brightcove</a></p>
<pre class="brush: ruby">

sudo gem install brightcove-api

&gt;&gt; require &#039;brightcove-api&#039;
=&gt; true
&gt;&gt; brightcove = Brightcove::API.new(&#039;0Z2dtxTdJAxtbZ-d0U7Bhio2V1Rhr5Iafl5FFtDPY8E.&#039;)
=&gt; #&lt;brightcove ::API:0x114dbc8 @token=&quot;0Z2dtxTdJAxtbZ-d0U7Bhio2V1Rhr5Iafl5FFtDPY8E.&quot;, @api_url=&quot;http://api.brightcove.com/services/library&quot;&gt;
&gt;&gt; response = brightcove.get(&#039;find_all_videos&#039;, {:page_size =&gt; 3, :video_fields =&gt; &#039;id,name,linkURL,linkText&#039;})
=&gt; {&quot;items&quot;=&gt;[{&quot;name&quot;=&gt;&quot;Documentarian Skydiving&quot;, &quot;id&quot;=&gt;496518762, &quot;linkText&quot;=&gt;nil, &quot;linkURL&quot;=&gt;nil}, {&quot;name&quot;=&gt;&quot;Surface Tricks&quot;, &quot;id&quot;=&gt;496518763, &quot;linkText&quot;=&gt;nil, &quot;linkURL&quot;=&gt;nil}, {&quot;name&quot;=&gt;&quot;Free Skiing&quot;, &quot;id&quot;=&gt;496518765, &quot;linkText&quot;=&gt;nil, &quot;linkURL&quot;=&gt;nil}], &quot;page_number&quot;=&gt;0, &quot;page_size&quot;=&gt;3, &quot;total_count&quot;=&gt;-1}
</pre>
<p></brightcove></p>




	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F07%2F29%2Fbrightercove%2F&amp;title=Brightercove" title="Reddit"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F07%2F29%2Fbrightercove%2F&amp;title=Brightercove&amp;bodytext=We%27re%20using%20Brightcove%20here%20at%20Agora%20Games%20for%20some%20video%20platform%20work.%20In%20our%20group%20chats%2C%20we%27ve%20talked%20about%2C%20%22It%20would%20be%20nice%20if%20we%20had%20a%20Ruby%20API%20for%20interacting%20with%20Brightcove.%22%0D%0A%0D%0AAnd%20so%20I%20did%20just%20that%2C%20http%3A%2F%2Fgithub.com%2Fagoragames%2Fbrightco" title="Digg"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F07%2F29%2Fbrightercove%2F&amp;title=Brightercove&amp;notes=We%27re%20using%20Brightcove%20here%20at%20Agora%20Games%20for%20some%20video%20platform%20work.%20In%20our%20group%20chats%2C%20we%27ve%20talked%20about%2C%20%22It%20would%20be%20nice%20if%20we%20had%20a%20Ruby%20API%20for%20interacting%20with%20Brightcove.%22%0D%0A%0D%0AAnd%20so%20I%20did%20just%20that%2C%20http%3A%2F%2Fgithub.com%2Fagoragames%2Fbrightco" title="del.icio.us"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fblog.agoragames.com%2F2010%2F07%2F29%2Fbrightercove%2F" title="Technorati"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.agoragames.com/2010/07/29/brightercove/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting Up a Rails 3 Development Environment</title>
		<link>http://blog.agoragames.com/2010/06/24/setting-up-a-rails-3-development-environment/</link>
		<comments>http://blog.agoragames.com/2010/06/24/setting-up-a-rails-3-development-environment/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 16:24:04 +0000</pubDate>
		<dc:creator>tquackenbush</dc:creator>
				<category><![CDATA[Bending Rails]]></category>
		<category><![CDATA[Engineering]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails3]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rvm]]></category>
		<category><![CDATA[setup]]></category>

		<guid isPermaLink="false">http://blog.agoragames.com/?p=585</guid>
		<description><![CDATA[Getting started with Rails 3 development is a very straightforward process, granted you have the prerequisite version of Ruby installed on your system. Ruby Version Manager (RVM) is a utility that makes it very easy and painless to switch between Ruby versions while maintaining your system&#8217;s stock Ruby installation. RVM not only enables you to [...]]]></description>
			<content:encoded><![CDATA[<p><!-- code {   font-family: Courier New, Courier, mono; } pre {   font-family: Courier New, Courier, mono; } ul {   margin-bottom: 0; } ul li {    list-style: circle; } -->Getting started with Rails 3 development is a very straightforward process, granted you have the prerequisite version of Ruby installed on your system. <a href="http://rvm.beginrescueend.com">Ruby Version Manager</a> (RVM) is a utility that makes it very easy and painless to switch between Ruby versions while maintaining your system&#8217;s stock Ruby installation. RVM not only enables you to switch between Ruby versions, but also maintains distinct gem sets specific to each of those versions which is very helpful when testing out new Rails environments.</p>
<p>Before we jump into setup, first a bit about our pre-Rails3 environment:</p>
<ul>
<li>Mac OS X 10.5.8</li>
<li>ruby 1.8.6 (2009-06-08 patchlevel 369) [universal-darwin9.0] (stock)</li>
<li>RubyGems 1.3.7</li>
<li>Various older versions of Rails (2.3.8, 2.3.5, 2.3.4, 2.3.2, 2.2.2, 2.1.1, 2.1.0, 2.0.2, 1.2.6, 1.2.3)</li>
</ul>
<p>We will be installing the latest release of Rails which, as of this writing, is Rails 3 beta4.<br />
We will also complete setup using the latest version of Ruby 1.9.<br />
The minimal version of Ruby 1.9 required for this Rails release is 1.9.2.<br />
To complete setup with Ruby 1.8.7, consult the <a href="http://guides.rails.info/3_0_release_notes.html#rails-3-requires-at-least-ruby-187">Rails 3 release notes</a> for the minimal version requirements.</p>
<p>The basic installation steps are as follows:</p>
<ol>
<li>Install RVM (Ruby Version Manger)</li>
<li>Install Ruby 1.9.2</li>
<li>Install Rails3 beta4</li>
<li>Profit!</li>
</ol>
<p>To install, issue the following commands in a terminal window:</p>
<ol>
<li id="sidebar"><code>bash &lt; &lt;( curl http://rvm.beginrescueend.com/releases/rvm-install-head )</code>
<ul>
<li>This is the preferred RVM installation method as described in the <a href="http://rvm.beginrescueend.com/rvm/install/">RVM installation instructions</a>.</li>
</ul>
</li>
<li><code>rvm install 1.9.2-head</code></li>
<li><code>rvm 1.9.2-head</code></li>
<li><code>gem install rails --pre</code></li>
</ol>
<p>Installation of the rails gem should also install it&#8217;s respective dependencies:</p>
<pre>    [05:16:50][tquackenbush@TQuackenbush ~]$ gem list

    *** LOCAL GEMS ***
never
    abstract (1.0.0)
    actionmailer (3.0.0.beta4)
    actionpack (3.0.0.beta4)
    activemodel (3.0.0.beta4)
    activerecord (3.0.0.beta4)
    activeresource (3.0.0.beta4)
    activesupport (3.0.0.beta4)
    arel (0.4.0)
    builder (2.1.2)
    bundler (0.9.26)
    erubis (2.6.5)
    i18n (0.4.1)
    mail (2.2.5)
    mime-types (1.16)
    polyglot (0.3.1)
    rack (1.1.0)
    rack-mount (0.6.4)
    rack-test (0.5.4)
    rails (3.0.0.beta4)
    railties (3.0.0.beta4)
    rake (0.8.7)
    rdoc (2.5.8)
    thor (0.13.6)
    treetop (1.4.8)
    tzinfo (0.3.22)</pre>
<p>To test out your new installation, try creating a new bare bones Rails 3 application like so:</p>
<ol>
<li><code>rails new test_app</code></li>
<li><code>cd test_app</code></li>
<li><code>bundle install</code>
<ul>
<li>Bundler is the new default dependency manager in Rails 3, and will install any missing gems required by the project.</li>
<li>In my case, this was &#8217;sqlite3-ruby (1.3.0)&#8217;</li>
</ul>
</li>
<li><code>rails server</code></li>
</ol>
<p>As in Rails 2, this should launch a WEBrick server instance listening on localhost port 3000 with output similar to:</p>
<pre>    =&gt; Booting WEBrick
    =&gt; Rails 3.0.0.beta4 application starting in development on http://0.0.0.0:3000
    =&gt; Call with -d to detach
    =&gt; Ctrl-C to shutdown server
    [2010-06-23 16:54:06] INFO  WEBrick 1.3.1
    [2010-06-23 16:54:06] INFO  ruby 1.9.2 (2010-06-22) [i386-darwin9.8.0]
    [2010-06-23 16:54:06] INFO  WEBrick::HTTPServer#start: pid=6529 port=3000</pre>
<p>And that&#8217;s it! You&#8217;re all ready to go with Rails 3!</p>
<p><strong>Update: June 25th, 2010</strong> (David Czarnecki)</p>
<p>I ran into an issue on one system where rvm and Ruby 1.9.2 were correctly installed on the system, but Rails 3 would not install. The installation would go as follows.</p>
<blockquote>
<pre>machine-name:~ dczarnecki$ gem install rails --pre
WARNING:  RubyGems 1.2+ index not found for:

RubyGems will revert to legacy indexes degrading performance.</pre>
</blockquote>
<p>I blew away the ~/.gemrc file and Rails 3 installed successfully. YMMV.</p>
<p><strong>Update: June 29th, 2010</strong> (Joshua Childs)<br />
Ran into two issues with with dependencies while getting setup on my Ubuntu workstation.</p>
<p>First was while problem I ran into was while following the installation steps.</p>
<pre class="brush: bash">
# Command:
josh@jagar-tharn:~$ rvm install 1.9.2-head

# Response:
fail: bison is not available in your path. Please ensure it exists before compiling from head.

# Solution:
sudo apt-get install bison
</pre>
<p>And the second problem I ran into was while using bundle to setup my dependencies. My workstation did not have sqlite3 installed.</p>
<pre class="brush: bash">
# Command:
josh@jagar-tharn:~/projects/test_app$ bundle install

# Response:
...
Using rails (3.0.0.beta4) from bundler gems
Installing sqlite3-ruby (1.3.0) from rubygems repository at http://rubygems.org/ with native extensions /home/josh/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rubygems/ext/builder.rb:46: warning: Insecure world writable dir /usr/local/libevent/ in PATH, mode 040777
/home/josh/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions&#039;: ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/home/josh/.rvm/rubies/ruby-1.9.2-head/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try &#039;port install sqlite3 +universal&#039; or &#039;yum install sqlite3-devel&#039;
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/home/josh/.rvm/rubies/ruby-1.9.2-head/bin/ruby
	--with-sqlite3-dir
	--without-sqlite3-dir
	--with-sqlite3-include
	--without-sqlite3-include=${sqlite3-dir}/include
	--with-sqlite3-lib
	--without-sqlite3-lib=${sqlite3-dir}/lib
...

# Solution:
josh@jagar-tharn:~/projects/test_app$ sudo apt-get install sqlite3
josh@jagar-tharn:~/projects/test_app$ sudo apt-get install libsqlite3-dev
</pre>




	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F06%2F24%2Fsetting-up-a-rails-3-development-environment%2F&amp;title=Setting%20Up%20a%20Rails%203%20Development%20Environment" title="Reddit"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F06%2F24%2Fsetting-up-a-rails-3-development-environment%2F&amp;title=Setting%20Up%20a%20Rails%203%20Development%20Environment&amp;bodytext=Getting%20started%20with%20Rails%203%20development%20is%20a%20very%20straightforward%20process%2C%20granted%20you%20have%20the%20prerequisite%20version%20of%20Ruby%20installed%20on%20your%20system.%20Ruby%20Version%20Manager%20%28RVM%29%20is%20a%20utility%20that%20makes%20it%20very%20easy%20and%20painless%20to%20switch%20between%20Rub" title="Digg"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F06%2F24%2Fsetting-up-a-rails-3-development-environment%2F&amp;title=Setting%20Up%20a%20Rails%203%20Development%20Environment&amp;notes=Getting%20started%20with%20Rails%203%20development%20is%20a%20very%20straightforward%20process%2C%20granted%20you%20have%20the%20prerequisite%20version%20of%20Ruby%20installed%20on%20your%20system.%20Ruby%20Version%20Manager%20%28RVM%29%20is%20a%20utility%20that%20makes%20it%20very%20easy%20and%20painless%20to%20switch%20between%20Rub" title="del.icio.us"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fblog.agoragames.com%2F2010%2F06%2F24%2Fsetting-up-a-rails-3-development-environment%2F" title="Technorati"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.agoragames.com/2010/06/24/setting-up-a-rails-3-development-environment/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>It&#8217;s My Gem In A Box</title>
		<link>http://blog.agoragames.com/2010/04/28/its-my-gem-in-a-box/</link>
		<comments>http://blog.agoragames.com/2010/04/28/its-my-gem-in-a-box/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 21:04:59 +0000</pubDate>
		<dc:creator>David Czarnecki</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[gem in a box]]></category>
		<category><![CDATA[jeweler]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.agoragames.com/?p=550</guid>
		<description><![CDATA[Hey developers, I got something real important to give you. So just sit down, and listen.

We recently started a number of projects, each of which will require the use of a common library. So, here&#8217;s how it went down:
* Create the common library as a gem using the jeweler tool.
* Install Gem in a Box [...]]]></description>
			<content:encoded><![CDATA[<p>Hey developers, I got something real important to give you. So just sit down, and listen.</p>
<p><span id="more-550"></span></p>
<p>We recently started a number of projects, each of which will require the use of a common library. So, here&#8217;s how it went down:</p>
<p>* Create the common library as a gem using the <a href="http://github.com/technicalpickles/jeweler">jeweler</a> tool.</p>
<p>* Install <a href="http://tomlea.co.uk/posts/gem-in-a-box/">Gem in a Box</a> to allow the gem to be downloaded internally by our developers using gem install.</p>
<p>* Upload the common library gem.</p>
<p>BLAMMO! Now every developer can pull my gem ;)</p>
<p>But seriously, &#8220;Gem in a Box&#8221; is awesome and a great way to share gems internally at your office.</p>




	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F04%2F28%2Fits-my-gem-in-a-box%2F&amp;title=It%27s%20My%20Gem%20In%20A%20Box%20" title="Reddit"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F04%2F28%2Fits-my-gem-in-a-box%2F&amp;title=It%27s%20My%20Gem%20In%20A%20Box%20&amp;bodytext=Hey%20developers%2C%20I%20got%20something%20real%20important%20to%20give%20you.%20So%20just%20sit%20down%2C%20and%20listen.%0D%0A%0D%0A%0D%0A%0D%0AWe%20recently%20started%20a%20number%20of%20projects%2C%20each%20of%20which%20will%20require%20the%20use%20of%20a%20common%20library.%20So%2C%20here%27s%20how%20it%20went%20down%3A%0D%0A%0D%0A%2A%20Create%20the%20common%20lib" title="Digg"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F04%2F28%2Fits-my-gem-in-a-box%2F&amp;title=It%27s%20My%20Gem%20In%20A%20Box%20&amp;notes=Hey%20developers%2C%20I%20got%20something%20real%20important%20to%20give%20you.%20So%20just%20sit%20down%2C%20and%20listen.%0D%0A%0D%0A%0D%0A%0D%0AWe%20recently%20started%20a%20number%20of%20projects%2C%20each%20of%20which%20will%20require%20the%20use%20of%20a%20common%20library.%20So%2C%20here%27s%20how%20it%20went%20down%3A%0D%0A%0D%0A%2A%20Create%20the%20common%20lib" title="del.icio.us"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fblog.agoragames.com%2F2010%2F04%2F28%2Fits-my-gem-in-a-box%2F" title="Technorati"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.agoragames.com/2010/04/28/its-my-gem-in-a-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Experimenting with Redis</title>
		<link>http://blog.agoragames.com/2010/02/23/experimenting-with-redis/</link>
		<comments>http://blog.agoragames.com/2010/02/23/experimenting-with-redis/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 13:05:04 +0000</pubDate>
		<dc:creator>David Czarnecki</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[redis]]></category>
		<category><![CDATA[resque]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.agoragames.com/?p=470</guid>
		<description><![CDATA[Yesterday I started looking at ways to do inter-application communication. In a number of projects we&#8217;ve done here at Agora Games, we&#8217;ve used queues to make that happen. Redis has been on my radar for awhile now, but yesterday I drove my Chevy to the levee and guess what? The levee is NOT dry people. [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I started looking at ways to do inter-application communication. In a number of projects we&#8217;ve done here at Agora Games, we&#8217;ve used queues to make that happen. <a href="http://code.google.com/p/redis/">Redis</a> has been on my radar for awhile now, but yesterday I drove my Chevy to the levee and guess what? The levee is NOT dry people. I mean, who drinks rye anyway these days? Old people.</p>
<p><span id="more-470"></span></p>
<p>Right, <a href="http://code.google.com/p/redis/">Redis</a>.</p>
<p>&#8220;Redis is an advanced key-value store. It is similar to memcached but the dataset is not volatile, and values can be strings, exactly like in memcached, but also lists, sets, and ordered sets. All this data types can be manipulated with atomic operations to push/pop elements, add/remove elements, perform server side union, intersection, difference between sets, and so forth. Redis supports different kind of sorting abilities.&#8221;</p>
<p>I was particularly interested in the support in Redis for lists, which would allow me to have one application push stuff into the datastore and allow for another application to pull stuff from the datastore. A datastore that could operate as a queue? I guess this is as close as we&#8217;re going to get to flying cars in 2010. Redis is also supposed to be wicked fast and there are a number of libraries available in your programming language of choice with which to communicate with Redis.</p>
<p>Redis setup was trivial and &#8220;just worked&#8221;.</p>
<p>After starting the Redis server, I could just prototype in script/console.</p>
<p>Here we go:</p>
<pre style="font-family: monospace;"><span>&gt;&gt;</span> redis_queue = Redis.<span>new</span>
<span>=&gt;</span> <span>#&lt;Redis:0x222df9c @thread_safe=nil, @logger=nil, @password=nil, @timeout=5, @db=0, @sock=nil, @host="127.0.0.1", @port=6379&gt;</span>
<span>&gt;&gt;</span> redis_queue.<span>push_tail</span> <span>'strings'</span>, <span>'string 1'</span>
<span>=&gt;</span> <span>"OK"
&gt;&gt; </span>redis_queue.<span>push_tail</span> <span>'strings'</span>, <span>'string 2'</span><span>
&gt;&gt;</span> <span>"OK"</span><span>
&gt;&gt;</span> redis_queue.<span>list_length</span><span>(</span><span>'strings'</span><span>)</span><span>
=&gt;</span> <span>2
&gt;&gt; </span>redis_queue.<span>list_range</span><span>(</span><span>'strings'</span>, <span>0</span>, <span>-</span><span>1</span><span>)</span>
=&gt; ["string 1", "string 2"]
&gt;&gt; some_string = redis_queue.pop_head('strings')
=&gt; "string 1"
&gt;&gt; r.list_range('strings', 0, -1)
=&gt; ["string 2"]
&gt;&gt; r.list_length('strings')
=&gt; 1
&gt;&gt; quit</pre>
<p><a href="http://code.google.com/p/redis/wiki/CommandReference">There are quite a few commands that make Redis even more awesome, but for now I&#8217;m sold</a>. (If using an entire sentence as a link is wrong then I don&#8217;t want to be right)</p>
<p>Also, I know of <a href="http://github.com/defunkt/resque#readme">Resque</a>, &#8220;a Redis-backed library for creating background jobs, placing those jobs on multiple queues, and processing them later.&#8221; If I ever feel like driving the Mercedes Benz of flying cars, I&#8217;ll use it.</p>




	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F02%2F23%2Fexperimenting-with-redis%2F&amp;title=Experimenting%20with%20Redis" title="Reddit"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F02%2F23%2Fexperimenting-with-redis%2F&amp;title=Experimenting%20with%20Redis&amp;bodytext=Yesterday%20I%20started%20looking%20at%20ways%20to%20do%20inter-application%20communication.%20In%20a%20number%20of%20projects%20we%27ve%20done%20here%20at%20Agora%20Games%2C%20we%27ve%20used%20queues%20to%20make%20that%20happen.%20Redis%20has%20been%20on%20my%20radar%20for%20awhile%20now%2C%20but%20yesterday%20I%20drove%20my%20Chevy%20to%20the" title="Digg"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F02%2F23%2Fexperimenting-with-redis%2F&amp;title=Experimenting%20with%20Redis&amp;notes=Yesterday%20I%20started%20looking%20at%20ways%20to%20do%20inter-application%20communication.%20In%20a%20number%20of%20projects%20we%27ve%20done%20here%20at%20Agora%20Games%2C%20we%27ve%20used%20queues%20to%20make%20that%20happen.%20Redis%20has%20been%20on%20my%20radar%20for%20awhile%20now%2C%20but%20yesterday%20I%20drove%20my%20Chevy%20to%20the" title="del.icio.us"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fblog.agoragames.com%2F2010%2F02%2F23%2Fexperimenting-with-redis%2F" title="Technorati"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.agoragames.com/2010/02/23/experimenting-with-redis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Scaling Ruby and Rails Part 1</title>
		<link>http://blog.agoragames.com/2010/01/04/scaling-ruby-and-rails-part-1/</link>
		<comments>http://blog.agoragames.com/2010/01/04/scaling-ruby-and-rails-part-1/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 23:34:21 +0000</pubDate>
		<dc:creator>David Czarnecki</dc:creator>
				<category><![CDATA[Bending Rails]]></category>
		<category><![CDATA[Engineering]]></category>
		<category><![CDATA[amqp]]></category>
		<category><![CDATA[deep dive]]></category>
		<category><![CDATA[rabbit]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[scaling]]></category>

		<guid isPermaLink="false">http://blog.agoragames.com/?p=421</guid>
		<description><![CDATA[I wish scaling applications and systems these days consisted solely of &#8220;Just Add Scaling!&#8220;. But you know what? It&#8217;s not. I also forget where I read it, but the quote went something like, &#8220;Programming languages don&#8217;t scale, architectures scale.&#8221; Scaling is driven by proper iterative design, implementation and testing.
In a series of blog posts I [...]]]></description>
			<content:encoded><![CDATA[<p>I wish scaling applications and systems these days consisted solely of &#8220;<a href="http://olabini.com/blog/2008/05/just-add-scaling/">Just Add Scaling!</a>&#8220;. But you know what? It&#8217;s not. I also forget where I read it, but the quote went something like, &#8220;Programming languages don&#8217;t scale, architectures scale.&#8221; Scaling is driven by proper iterative design, implementation and testing.</p>
<p>In a series of blog posts I want to cover how we have approached scaling out various parts of our Ruby and Rails infrastructure here at Agora Games using real-world examples on very high-traffic sites such as the Guitar Hero and Call of Duty community sites.</p>
<p>Here I&#8217;ll cover the &#8220;Deep Dive&#8221;. I originally came from BigCo. and there we used a concept called the &#8220;Deep Dive&#8221;, which involved taking a specific requirement in combination with an approach or technology and following a thread of execution that would take you through the entire technology stack, or a &#8220;<span>deep</span> <span>dive</span>&#8221; through the system. At the end you would either prove or disprove the technology or approach. But it was done in the context of a real set of requirements.</p>
<p>The following is the e-mail (project/features names changed to protect the innocent &#8230; the important concept here is the Deep Dive, not the project/features) I sent around to our engineering team in September of last year after doing a Deep Dive on a queue system.</p>
<p>_________________</p>
<p><span style="text-decoration: underline;"> </span></p>
<blockquote><p>From: David Czarnecki</p>
<p>To: Engineering</p>
<p><span style="text-decoration: underline;">Clearly Defined Requirement(s)</span></p>
<p>Ultimately, to do a deep dive correctly, you need clearly defined requirements to evaluate your technology or approach against. In the case of PROJECT X, with the use of a queue, we had the following:</p>
<p>Setup queue<br />
Decide event(s)<br />
Send to queue<br />
Aggregate from/to queue<br />
Put into message creation<br />
Send back to the app</p>
<p><span style="text-decoration: underline;">Narrowing the Field</span></p>
<p>I spent a day looking at various queue packages in Ruby and other languages to understand:</p>
<p>Features &#8211; What features do we get out of the package?<br />
API &#8211; How easy is it to setup/create/interact with the queue from actual code?<br />
Aliveness &#8211; Is this an ongoing effort or was it thrown on RubyForge and ultimately abandoned?<br />
Community &#8211; Where is this package being used? How many developers or contributors commit to the project?<br />
Language &#8211; Are we expanding our technology stack by introducing a queue written in one language with an interface in another language?</p>
<p><span style="text-decoration: underline;">Pork, aka The Other Other Requirements</span></p>
<p>And don&#8217;t forget about the other &#8220;unspoken&#8221; requirements.</p>
<p>Ease of setup<br />
Speed<br />
Failsafe<br />
Scaling</p>
<p>At the end of the day, whichever package is picked, you want some guarantee that the package you&#8217;ve chosen is &#8220;good&#8221; or at least &#8220;good enough&#8221;. But what if the Guarantee Fairy&#8217;s a crazy glue sniffer? Next thing you know there&#8217;s change missing from your dresser and your daughter&#8217;s knocked up. I&#8217;ve seen it a hundred times. Although you&#8217;ve got a set of requirements that define how you&#8217;re going to use a technology or approach operationally, there are still requirements that need to be addressed, even if there isn&#8217;t anything formally specified.</p>
<p><span style="text-decoration: underline;">Let&#8217;s Get Ready To Rumble</span></p>
<p>I chose Sparrow and Rabbit/AMQP since these passed the &#8220;ease of setup&#8221; requirements with flying colors.</p>
<p><a href="http://code.google.com/p/sparrow/">http://code.google.com/p/sparrow/</a><br />
- Pure Ruby<br />
<a href="http://hopper.squarespace.com/blog/2008/7/22/simple-amqp-library-for-ruby.html"> http://hopper.squarespace.com/blog/2008/7/22/simple-amqp-library-for-ruby.html</a><br />
- Erlang Queue Server/Ruby interface to Queue</p>
<p>Next up it was time to prove out the feasibility of the two technologies looking at the &#8220;soft&#8221; requirements in the context of the &#8220;hard&#8221; requirements. This meant setting up the two systems to:</p>
<p>Setup queue<br />
Send event(s) to queue<br />
Aggregate from/to queue</p>
<p>The other &#8220;hard&#8221; requirements would be addressed based on the outcome of this initial sanity check.</p>
<p><span style="text-decoration: underline;">2 Queues Enter, 1 Queue Leaves &#8230; Wait, what?</span></p>
<p>Although I wanted to use this to prove out &#8220;FEATURE X&#8221;, I also wanted to address its use in &#8220;FEATURE Y&#8221;. &#8220;FEATURE Y&#8221; involves converting a song file into an MP3. So I setup a test to evaluate the two systems which was:</p>
<pre class="brush: ruby">

1k, 8k, 16k, 32k, 64k messages do
25.times do
10000 messages do
publish message to queue
read message from queue
end
end
end
</pre>
<p>In other words, publish 10000 messages to the queue (in one process) and read those messages from the queue (in another process), noting how long it took to publish and read. Do this 25 times to get a min/max/average time for each of the different message sizes.</p>
<p>I have attached the spreadsheet of the results which show: the larger the message, the longer it takes to publish and read from the queue. However, it also shows that Sparrow could handle the 64k messages while Rabbit/AMQP could not. Sparrow got slower to process those 10000 64k items from the queue, but it never failed as with Rabbit/AMQP. Ultimately, the deep dive was not about fixing a broken AMQP adapter.</p>
<p><span style="text-decoration: underline;">The Devil is in the Details</span></p>
<p>One benefit of using Sparrow is that persistence is built into the server. If you take down Sparrow and there are messages on the queue, it will write those out to an SQLite3 database. Ultimately this lead me to look at the size of the field it was using for queue data which would need to be patched from its current 255 characters.</p>
<p><span style="text-decoration: underline;">Conclusion</span></p>
<p>So, I&#8217;ve now got a queue server that I feel comfortable setting up and using and that can probably handle the load of data we&#8217;re going to throw at it come launch. The queue server/queues were integrated into PROJECT X in the context of the &#8220;FEATURE X&#8221; to prove its feasibility in addressing that feature in a future sprint.</p>
<p><span style="text-decoration: underline;">And one more thing &#8230;</span></p>
<p>There are tests for the various bits that make up &#8220;FEATURE X&#8221;. I&#8217;m most happy with the integration test which fires up a Sparrow server, fires up a foo, creates a bar, runs the aggregator, and checks to see that a baz was created for the account (oh and then cleaning up the queue server and the subscriber). 14 LOC, but there&#8217;s a lot of code that it exercises behind the scenes. And yes, it passes :)</p></blockquote>
<p><span style="text-decoration: underline;"> </span></p>
<p>_________________</p>
<p>So, there you go. Hopefully you have enough information to do your own Deep Dive.</p>
<p>Ultimately for FEATURE X and FEATURE Y, Sparrow more than met our needs. Advances and changes to AMQP and its associated libraries have been made which I&#8217;m sure make it a more than viable candidate. At the time however, with just getting the system to work for a day to prove out the Deep Dive, it just didn&#8217;t meet our needs. Again, the point of this blog post is to talk about the Deep Dive in the larger context of its use in Scaling Ruby and Rails.</p>




	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F01%2F04%2Fscaling-ruby-and-rails-part-1%2F&amp;title=Scaling%20Ruby%20and%20Rails%20Part%201" title="Reddit"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F01%2F04%2Fscaling-ruby-and-rails-part-1%2F&amp;title=Scaling%20Ruby%20and%20Rails%20Part%201&amp;bodytext=I%20wish%20scaling%20applications%20and%20systems%20these%20days%20consisted%20solely%20of%20%22Just%20Add%20Scaling%21%22.%20But%20you%20know%20what%3F%20It%27s%20not.%20I%20also%20forget%20where%20I%20read%20it%2C%20but%20the%20quote%20went%20something%20like%2C%20%22Programming%20languages%20don%27t%20scale%2C%20architectures%20scale.%22%20Scali" title="Digg"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F01%2F04%2Fscaling-ruby-and-rails-part-1%2F&amp;title=Scaling%20Ruby%20and%20Rails%20Part%201&amp;notes=I%20wish%20scaling%20applications%20and%20systems%20these%20days%20consisted%20solely%20of%20%22Just%20Add%20Scaling%21%22.%20But%20you%20know%20what%3F%20It%27s%20not.%20I%20also%20forget%20where%20I%20read%20it%2C%20but%20the%20quote%20went%20something%20like%2C%20%22Programming%20languages%20don%27t%20scale%2C%20architectures%20scale.%22%20Scali" title="del.icio.us"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fblog.agoragames.com%2F2010%2F01%2F04%2Fscaling-ruby-and-rails-part-1%2F" title="Technorati"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.agoragames.com/2010/01/04/scaling-ruby-and-rails-part-1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Integrating Lighthouse and Instant Messenger in Ruby</title>
		<link>http://blog.agoragames.com/2009/10/07/integrating-lighthouse-and-instant-messenger-in-ruby/</link>
		<comments>http://blog.agoragames.com/2009/10/07/integrating-lighthouse-and-instant-messenger-in-ruby/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 20:45:06 +0000</pubDate>
		<dc:creator>David Czarnecki</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[aim]]></category>
		<category><![CDATA[instant messenger]]></category>
		<category><![CDATA[lighthouse]]></category>
		<category><![CDATA[lighthouseapp]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.agoragames.com/?p=376</guid>
		<description><![CDATA[The Introduction to the Lighthouse API mentions something you might do with the Lighthouse API is &#8220;Accessing and creating tickets through your Instant Messenger client.&#8221;. How easy is it to do this? Surprisingly easy.
You will need to download and install the Lighthouse API gem and the Net::TOC gem.
Run this in an irb session.


require &#039;net/toc&#039;
require &#039;lighthouse&#039;
require [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://lighthouseapp.com/api/introduction">Introduction to the Lighthouse API</a> mentions something you might do with the Lighthouse API is &#8220;Accessing and creating tickets through your Instant Messenger client.&#8221;. How easy is it to do this? Surprisingly easy.</p>
<p>You will need to download and install the <a href="http://github.com/Caged/lighthouse-api">Lighthouse API</a> gem and the <a href="http://net-toc.rubyforge.org/doc/classes/Net/TOC.html">Net::TOC</a> gem.</p>
<p>Run this in an irb session.</p>
<pre class="brush: ruby">

require &#039;net/toc&#039;
require &#039;lighthouse&#039;
require &#039;sanitize&#039;
include Lighthouse

Lighthouse.account = &#039;shaft&#039;
Lighthouse.token = &#039;hesonebadmotherfushutyourmouth&#039;

Net::TOC.new(&quot;someaimaccount&quot;, &quot;someaimpassword&quot;) do |msg, buddy|
project = Project.find(Sanitize.clean(msg).to_i)
buddy.send_im(&quot;Here is some information about your project: #{project.name}&quot;)
end
</pre>
<p>You should then be able to add &#8217;someaimaccount&#8217; to your AIM buddy list and send a project ID and have it return the project name.</p>
<p>And boom goes the dynamite!</p>
<p>You&#8217;ll of course need to change the Lighthouse account and token as appropriate (or use username and password for logging in). msg is a little weird and although it&#8217;s a string, it&#8217;s HTML, so you need to strip out any tags before doing anything. And of course you&#8217;d want to add in some way of parsing the input from the user into some DSL (Domain Specific Language) for interacting with your fancy new Lighthouse AIM bot.</p>
<p>Happy hacking!</p>




	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fblog.agoragames.com%2F2009%2F10%2F07%2Fintegrating-lighthouse-and-instant-messenger-in-ruby%2F&amp;title=Integrating%20Lighthouse%20and%20Instant%20Messenger%20in%20Ruby" title="Reddit"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.agoragames.com%2F2009%2F10%2F07%2Fintegrating-lighthouse-and-instant-messenger-in-ruby%2F&amp;title=Integrating%20Lighthouse%20and%20Instant%20Messenger%20in%20Ruby&amp;bodytext=The%20Introduction%20to%20the%20Lighthouse%20API%20mentions%20something%20you%20might%20do%20with%20the%20Lighthouse%20API%20is%20%22Accessing%20and%20creating%20tickets%20through%20your%20Instant%20Messenger%20client.%22.%20How%20easy%20is%20it%20to%20do%20this%3F%20Surprisingly%20easy.%0D%0A%0D%0AYou%20will%20need%20to%20download%20and%20" title="Digg"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fblog.agoragames.com%2F2009%2F10%2F07%2Fintegrating-lighthouse-and-instant-messenger-in-ruby%2F&amp;title=Integrating%20Lighthouse%20and%20Instant%20Messenger%20in%20Ruby&amp;notes=The%20Introduction%20to%20the%20Lighthouse%20API%20mentions%20something%20you%20might%20do%20with%20the%20Lighthouse%20API%20is%20%22Accessing%20and%20creating%20tickets%20through%20your%20Instant%20Messenger%20client.%22.%20How%20easy%20is%20it%20to%20do%20this%3F%20Surprisingly%20easy.%0D%0A%0D%0AYou%20will%20need%20to%20download%20and%20" title="del.icio.us"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fblog.agoragames.com%2F2009%2F10%2F07%2Fintegrating-lighthouse-and-instant-messenger-in-ruby%2F" title="Technorati"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.agoragames.com/2009/10/07/integrating-lighthouse-and-instant-messenger-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wiredump_dev = STDERR</title>
		<link>http://blog.agoragames.com/2009/08/11/wiredump_dev-stderr/</link>
		<comments>http://blog.agoragames.com/2009/08/11/wiredump_dev-stderr/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 15:12:35 +0000</pubDate>
		<dc:creator>David Czarnecki</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[soap4r]]></category>
		<category><![CDATA[wiredump_dev]]></category>

		<guid isPermaLink="false">http://blog.agoragames.com/?p=337</guid>
		<description><![CDATA[If you are ever debugging SOAP web services from Ruby and wondering what information is going across the wire to/from the web service, wiredump_dev = STDERR, may be your best friend.

def some_method_that_uses_a_soap_web_service
storage = SOAP::WSDLDriverFactory.new(STORAGE_WSDL).create_rpc_driver
...
storage.wiredump_dev = STDERR
response = storage.DoSomething(...)
end

When the DoSomething web service method is called, the Ruby SOAP library will print out the request and [...]]]></description>
			<content:encoded><![CDATA[<p>If you are ever debugging SOAP web services from Ruby and wondering what information is going across the wire to/from the web service, wiredump_dev = STDERR, may be your best friend.</p>
<pre class="brush: ruby">
def some_method_that_uses_a_soap_web_service
storage = SOAP::WSDLDriverFactory.new(STORAGE_WSDL).create_rpc_driver
...
storage.wiredump_dev = STDERR
response = storage.DoSomething(...)
end
</pre>
<p>When the DoSomething web service method is called, the Ruby SOAP library will print out the request and response to STDERR.</p>
<p>It is invaluable. Trust me!</p>
<p>Follow-up (8/13/2009): A friend pointed me at <a href="http://github.com/troelskn/handsoap/tree/master">Handsoap</a>, a library for creating SOAP clients in Ruby, which is an alternative to SOAP4R. It apparently does not suck. YMMV.</p>




	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fblog.agoragames.com%2F2009%2F08%2F11%2Fwiredump_dev-stderr%2F&amp;title=wiredump_dev%20%3D%20STDERR" title="Reddit"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.agoragames.com%2F2009%2F08%2F11%2Fwiredump_dev-stderr%2F&amp;title=wiredump_dev%20%3D%20STDERR&amp;bodytext=If%20you%20are%20ever%20debugging%20SOAP%20web%20services%20from%20Ruby%20and%20wondering%20what%20information%20is%20going%20across%20the%20wire%20to%2Ffrom%20the%20web%20service%2C%20wiredump_dev%20%3D%20STDERR%2C%20may%20be%20your%20best%20friend.%0D%0A%0D%0A%5Bsourcecode%20language%3D%27ruby%27%5D%0D%0Adef%20some_method_that_uses_a_soap_w" title="Digg"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fblog.agoragames.com%2F2009%2F08%2F11%2Fwiredump_dev-stderr%2F&amp;title=wiredump_dev%20%3D%20STDERR&amp;notes=If%20you%20are%20ever%20debugging%20SOAP%20web%20services%20from%20Ruby%20and%20wondering%20what%20information%20is%20going%20across%20the%20wire%20to%2Ffrom%20the%20web%20service%2C%20wiredump_dev%20%3D%20STDERR%2C%20may%20be%20your%20best%20friend.%0D%0A%0D%0A%5Bsourcecode%20language%3D%27ruby%27%5D%0D%0Adef%20some_method_that_uses_a_soap_w" title="del.icio.us"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fblog.agoragames.com%2F2009%2F08%2F11%2Fwiredump_dev-stderr%2F" title="Technorati"><img src="http://blog.agoragames.com/wp-content/plugins/var/www/waxer-blog/shared/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.agoragames.com/2009/08/11/wiredump_dev-stderr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->