<?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>Two Minute Spates</title>
	<atom:link href="http://blog.jonathanrwallace.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jonathanrwallace.com</link>
	<description>Ruby, rails, iPhone, git, entrepreneurship, what else is the hot newness?</description>
	<lastBuildDate>Tue, 29 Jun 2010 02:33:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Accessing Facebook’s Open Graph from within Ruby on&#160;Rails</title>
		<link>http://blog.jonathanrwallace.com/2010/06/accessing-facebook%e2%80%99s-open-graph-from-within-ruby-on-rails/</link>
		<comments>http://blog.jonathanrwallace.com/2010/06/accessing-facebook%e2%80%99s-open-graph-from-within-ruby-on-rails/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 02:33:47 +0000</pubDate>
		<dc:creator>Jonathan Wallace</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebooker2]]></category>
		<category><![CDATA[mogli]]></category>
		<category><![CDATA[opengraph]]></category>

		<guid isPermaLink="false">http://blog.jonathanrwallace.com/?p=86</guid>
		<description><![CDATA[&#60;meta-post&#62; &#60;riveting introduction drawing you into the blog followed by useless facts about facebook&#8217;s growth and reach that you won&#8217;t remember five minutes after leaving this page&#62; &#60;mild segue discussing the power of facebook&#8217;s new open graph API&#62; &#60;well balanced discussion indicating target audience of rails developers and all the power derived therein&#62; &#60;short intro [...]]]></description>
			<content:encoded><![CDATA[<p>&lt;meta-post&gt;</p>
<p>&lt;riveting introduction drawing you into the blog followed by useless facts about facebook&#8217;s growth and reach that you won&#8217;t remember five minutes after leaving this page&gt;</p>
<p>&lt;mild segue discussing the power of facebook&#8217;s new open graph API&gt;</p>
<p>&lt;well balanced discussion indicating target audience of rails developers and all the power derived therein&gt;</p>
<p>&lt;short intro to facebooker2 and mogli&gt;</p>
<p>&lt;link to my facebooker2 fork on github.. oh wait.   you really need that.&gt;</p>
<p>http://github.com/wallace/facebooker2<a href="http://github.com/wallace/facebooker2"></p>
<p>Just check out the README.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jonathanrwallace.com/2010/06/accessing-facebook%e2%80%99s-open-graph-from-within-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Roseanne &#8211; in browser comparison between two&#160;files</title>
		<link>http://blog.jonathanrwallace.com/2010/02/roseanne-in-browser-comparison-between-two-files/</link>
		<comments>http://blog.jonathanrwallace.com/2010/02/roseanne-in-browser-comparison-between-two-files/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 21:00:29 +0000</pubDate>
		<dc:creator>Jonathan Wallace</dc:creator>
				<category><![CDATA[couchdb]]></category>
		<category><![CDATA[heroku]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[diff]]></category>

		<guid isPermaLink="false">http://blog.jonathanrwallace.com/?p=46</guid>
		<description><![CDATA[I telecommute 100% of the time at my current company. We make use of git and skype to communicate. If we need to share a bunch of code, we use remote branches (grb makes this super easy). But when its only one file, the overhead is too much. &#8220;Wait, wait. Let me create a remote [...]]]></description>
			<content:encoded><![CDATA[<p> I telecommute 100% of the time at my current <a href="http://intellum.com">company</a>.  We make use of git and skype to communicate.  If we need to share a bunch of code, we use remote branches (<a href="http://grb.rubyforge.org/">grb</a> makes this super easy).  </p>
<p>But when its only one file, the overhead is too much.  </p>
<blockquote><p>&#8220;Wait, wait.  Let me create a remote branch &#8211; now I&#8217;m committing, now I&#8217;m pushing to the origin &#8211; there you go!  Go ahead and pull.&#8221;</p></blockquote>
<p>  This can really break up the work flow.  </p>
<p>To highlight what&#8217;s changed in the file and share it with my coworker, is this too much to ask?  Now, of course, we could just pipe the diff into a file but then how do we transfer it?  Use email?  Ugh.</p>
<p>Definitely not.</p>
<p>Instead, let&#8217;s use a nice web service and paste two files.  (On mac os x, check out <code>cat some_file_name | pbcopy</code>.  very nifty).  With one url, we can both insure we&#8217;re looking at the exact same diff.</p>
<p>Enter <a href="http://github.com/wallace/roseanne">roseanne</a>.  If you&#8217;re a solo user, roseanne allows you to run a pure javascript diff (thanks to <a href="http://snowtide.com/jsdifflib">Chas Emrick</a>.  I &#8220;ported&#8221; it to use prototype).  Or, you can submit the diff to the server.</p>
<p>Since Chas based his js diff lib off of Python&#8217;s sequence matcher and Test::Unit::Diff::SequenceMatcher is based off the same for the server side, I generate the JSON and store it in a couchdb at <a href="http://cloudant.com/">cloudant</a> to save the view for later and share with others.</p>
<p>The app is hosted at <a href="http://heroku.com/">heroku</a> and is a rails app.  <a href="http://diff.jonathanrwallace.com">Try it</a> yourself.  </p>
<p>Since the app is basically a simple proxy, I&#8217;m thinking of replacing it with a <a href="http://www.sinatrarb.com/">Sinatra</a> app.  Any thoughts?  Is there something I could do to make it better?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jonathanrwallace.com/2010/02/roseanne-in-browser-comparison-between-two-files/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Updating to Rails&#160;2-3-stable</title>
		<link>http://blog.jonathanrwallace.com/2009/05/updating-to-rails-2-3-stable/</link>
		<comments>http://blog.jonathanrwallace.com/2009/05/updating-to-rails-2-3-stable/#comments</comments>
		<pubDate>Tue, 19 May 2009 14:08:29 +0000</pubDate>
		<dc:creator>Jonathan Wallace</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.jonathanrwallace.com/?p=18</guid>
		<description><![CDATA[Here are the steps I followed to upgrade our flagship product. Steps I had to take on the git repos: verify that rake version is 0.8.4 and rubygems is 1.3.1 rm -rf vendor/rails gem update rails rack cd vendor &#38;&#38; git clone git://github.com/rails/rails.git cd rails &#38;&#38; grb track 2-3-stable git checkout 2-3-stable rm -rf .git [...]]]></description>
			<content:encoded><![CDATA[<p>Here are the steps I followed to upgrade <a href="http://intellum.com">our</a> <a href="http://www.rollbook.com">flagship product</a>.</p>
<p>Steps I had to take on the git repos:</p>
<pre>
verify that rake version is 0.8.4 and rubygems is 1.3.1
rm -rf vendor/rails
gem update rails rack
cd vendor &amp;&amp; git clone git://github.com/rails/rails.git
cd rails &amp;&amp; grb track 2-3-stable
git checkout 2-3-stable
rm -rf .git
cd ~/
modify environment.rb to user rails 2.3.2
rake rails:update
git add -A
</pre>
<p>Upgrade issues I ran into:</p>
<pre>
# check plugins/gems that need to be updated
# mocha
5076 rollbook:master+! % rake test:units
rake aborted!
can't activate mocha (= 0.9.4, runtime), already activated mocha-0.9.5
# move "require 'mocha'" from test/test_helper.rb into config/environments/test.rb
# http://gist.github.com/111060 -- solution: remove "require 'ar-extensions" from config/initializers/<file>.rb
# remove all references to Test::Unit http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/f90ecdba834c2ef8/f204e834e5e0303c?lnk=raot in test dir
# replace Test::Unit w/ActiveRecord or ActionController as appropriate
# replace CGI::Session.generate_unique_id w/ActiveSupport::SecureRandom.hex(16)
# updated hoptoad and shoulda
# add xmlsimple to be required
# updated new_relic agent
# install country_select plugin
</pre>
<p>Steps to be take on the production server:</p>
<pre>
# update passenger 2.2.2
# gem update rails rack
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.jonathanrwallace.com/2009/05/updating-to-rails-2-3-stable/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Monitoring BackgrounDRb workers with&#160;God</title>
		<link>http://blog.jonathanrwallace.com/2008/08/monitoring-backgroundrb-workers-with-god/</link>
		<comments>http://blog.jonathanrwallace.com/2008/08/monitoring-backgroundrb-workers-with-god/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 17:04:00 +0000</pubDate>
		<dc:creator>Jonathan Wallace</dc:creator>
				<category><![CDATA[backgroundrb]]></category>
		<category><![CDATA[god]]></category>
		<category><![CDATA[intellum]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.jonathanrwallace.com/?p=4</guid>
		<description><![CDATA[Updated 2008/09/24 for latest version of backgroundrb 1.0.4 The other day on our staging server, I noticed that the BackgrounDRb queue worker had died. As it turned out, the queue worker had died over 3 months ago!! There was no cause for alarm as the staging server isn&#8217;t critical but this did start me to [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-style:italic;">Updated 2008/09/24 for latest version of backgroundrb 1.0.4</span></p>
<p>The other day on our staging server, I noticed that the <a href="http://backgroundrb.rubyforge.org/">BackgrounDRb</a> queue worker had died.  As it turned out, the queue worker had died over 3 months ago!!</p>
<p>There was no cause for alarm as the staging server isn&#8217;t critical but this did start me to worrying.  We needed to implement a monitoring solution which not only verified that BackgrounDRb was running but also that particular workers were running.</p>
<p>As we had just implemented <a href="http://god.rubyforge.org/">god</a> monitoring with a custom condition for another issue, its a slam dunk to do the same again.  (Thanks to <a href="http://jnewland.com/">Jesse Newland</a> and his <a href="http://atlrug.org/jnewland/posts/45-God-Process-and-Task-Monitoring-Done-Right-Slides">god tutorial</a> at <a href="http://atlrug.org/">AtlRUG</a>.)</p>
<p>Here&#8217;s the configuration file that got it done for us.</p>
<pre lang="ruby" line="1">
#run on command line with 'god -c backgroundrb.god -D'
RAILS_ROOT = '/var/www/rails/rollbook/current'

#load required rails and backgroundrb files
require File.dirname(__FILE__) + '/../boot'
require File.dirname(__FILE__) + '/../environment'
require 'erb'
$LOAD_PATH << "#{RAILS_ROOT}/vendor/plugins/backgroundrb/lib"
require "#{RAILS_ROOT}/vendor/plugins/backgroundrb/lib/backgroundrb.rb"

#create custom condition for checking that QueryProcessingWorker is running
MiddleMan = BackgrounDRb::ClusterConnection.new
module God
  module Conditions
    class Backgroundrb < PollCondition
      def initialize; super; end
      def valid?; true; end 

      def test
        begin
          queue_worker = MiddleMan.all_worker_info.values.flatten.select { |w| :queue_processing_worker == w[:worker] }
          queue_worker.empty?
        rescue #if all_worker_info raises exception, then bdrb isn't running and we were unable to connect
          true
        end
      end
    end
  end
end

God.watch do |w|
  w.name      = 'backgroundrb'
  w.interval  = 1.minute
  w.restart   = "cd #{RAILS_ROOT} &#038;&#038; #{RAILS_ROOT}/script/backgroundrb -e production stop &#038;&#038; #{RAILS_ROOT}/script/backgroundrb -e production start"
  w.stop      = "cd #{RAILS_ROOT} &#038;&#038; #{RAILS_ROOT}/script/backgroundrb -e production stop"
  w.start     = "cd #{RAILS_ROOT} &#038;&#038; #{RAILS_ROOT}/script/backgroundrb -e production start"
  w.grace     = 1.minute
  w.pid_file  = "#{RAILS_ROOT}/tmp/pids/backgroundrb_11000.pid"

  w.start_if do |start|
    start.condition(:process_running) do |c|
      c.running  = false
    end
  end 

  w.restart_if do |restart|
    restart.condition(:backgroundrb) do |c|
      #just restart it
    end
  end
end </pre>
<p>In the select call on line 21, you can modify the condition to access :job_key or :status as well.  Obviously, you need to modify RAILS_ROOT for your situation.</p>
<p>If you have suggestions for improvement or questions, hit me up in the comments.  Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jonathanrwallace.com/2008/08/monitoring-backgroundrb-workers-with-god/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Ack, a better grep for coders in 3 easy&#160;steps</title>
		<link>http://blog.jonathanrwallace.com/2007/12/ack-a-better-grep-for-coders-in-3-easy-steps/</link>
		<comments>http://blog.jonathanrwallace.com/2007/12/ack-a-better-grep-for-coders-in-3-easy-steps/#comments</comments>
		<pubDate>Fri, 28 Dec 2007 20:58:00 +0000</pubDate>
		<dc:creator>Jonathan Wallace</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.jonathanrwallace.com/?p=3</guid>
		<description><![CDATA[Ack has this nice colorized output when searching code files. Some may say that grep can do the same thing (it can), but there&#8217;s no need for arg&#8217;ing it up with ack. There&#8217;s a similar ruby version, rak, but I&#8217;ve heard it isn&#8217;t quite as fast as ack. Ack works well enough for me and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://petdance.com/ack/">Ack</a> has this nice colorized output when searching code files.  Some may say that grep can do the same thing (it can), but there&#8217;s no need for arg&#8217;ing it up with ack.  There&#8217;s a similar ruby version, <a href="http://rak.rubyforge.org/">rak</a>, but I&#8217;ve heard it isn&#8217;t quite as fast as ack.  Ack works well enough for me and the install process isn&#8217;t that painful.</p>
<p>There&#8217;s two ways to install listed over at <a href="http://petdance.com/ack/">ack</a>; I chose the CPAN route (since I never know when I&#8217;ll need to install some more perl goodies).</p>
<p>How to install ack on Mac OS X leopard in 3 easy steps.
<ol>
<li>install <a href="http://www.macports.org/">mac ports</a></li>
<li>sudo port install perl5.8</li>
<li>sudo cpan -i App::Ack</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.jonathanrwallace.com/2007/12/ack-a-better-grep-for-coders-in-3-easy-steps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
