<?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>Mindtonic</title>
	<atom:link href="http://blog.mindtonic.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mindtonic.net</link>
	<description>Thoughts on Music and Application Development</description>
	<lastBuildDate>Fri, 30 Jul 2010 18:08:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Using Authlogic with Cucumber</title>
		<link>http://blog.mindtonic.net/using_authlogic_with_cucumber/</link>
		<comments>http://blog.mindtonic.net/using_authlogic_with_cucumber/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 21:37:40 +0000</pubDate>
		<dc:creator>mindtonic</dc:creator>
				<category><![CDATA[Cucumber]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Shoulda]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Authlogic]]></category>
		<category><![CDATA[RSpec]]></category>
		<category><![CDATA[Test::Unit]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://blog.mindtonic.net/?p=146</guid>
		<description><![CDATA[I have created a set of Authlogic behavior steps to use in my Cucumber tests.  These steps cover most of your basic functionality and provide some helper functions that you can use in your other step definitions.  The Cucumber feature definitions cover the major elements of authentication: logging in, logging out and the presence of a UserSession. http://github.com/mindtonic/AuthLogic-Cucumber-Steps]]></description>
			<content:encoded><![CDATA[<p>I have been working with <a title="Cucumber BDD" href="http://cukes.info/">Cucumber</a> lately and have been retrofitting one of my main projects <a title="sumuv.com" href="http://sumuv.com">Sumuv.com</a> with appropriate behavioral tests.  We have a fully functional test suite written with <a href="http://github.com/thoughtbot/shoulda">Shoulda</a> and Test::Unit, so I am not particularly interested in translating the unit and functional tests to RSpec.</p>
<div style="float: right; padding: 10px; margin: 5px; border: groove 1px #000;text-align:center;"><img src="http://maggiesfarm.anotherdotcom.com/uploads/cucumber.jpg" alt="" /><br />
<strong>This is the vegetable you are looking for.</strong></div>
<p>I figured that since the Cucumber BDD tests are completely different than the Shoulda unit and functional tests, I could just slip my Cucumber steps right on in.  It does seem a little strange to be writing the functional tests in Test::Unit and the behavioral steps in RSpec.  In the future I will probably follow <a href="http://robots.thoughtbot.com/post/701863189/shoulda-rails3-and-beyond">the Shoulda train</a> and move to RSpec exclusively, but I am enjoying the differences in the two platforms on this particular retrofit.</p>
<p>While I am mentioning the Shoulda train, I really enjoyed <a href="http://robots.thoughtbot.com/">Thoughtbot&#8217;s</a> post &#8220;<a title="This should_change Your Mind" href="http://robots.thoughtbot.com/post/731871832/this-should-change-your-mind">This should_change Your Mind</a>&#8220;.  Their very simple explanations of the difference between behavioral testing and functional testing created a clear distinction in my mind.  It was the golden nugget of wisdom I had been looking for.</p>
<p>I have been a big fan of <a href="http://www.binarylogic.com/">Binary Logic&#8217;s</a> <a href="http://github.com/binarylogic/authlogic">Authlogic</a> gem for handling site authentication and user sessions.  I love the clean interface and versatility.  A lot of forethought went in to make this an elegant interface on top of some pretty robust and secure code.</p>
<p>As a result of this work, I have created a set of Authlogic behavior steps to use in my Cucumber tests.  These steps cover most of your basic functionality and provide some helper functions that you can use in your other step definitions.  The Cucumber feature definitions cover the major elements of authentication: logging in, logging out and the presence of a UserSession.</p>
<p>I will continue to improve the quality and coverage of these features.  I plan to include a set of features to cover user registration.  I offer this here because I find it useful for my other projects.  If you find it helpful too, please let me know!</p>
<p><strong><a title="AuthLogic Cucumber Steps" href="http://github.com/mindtonic/AuthLogic-Cucumber-Steps">http://github.com/mindtonic/AuthLogic-Cucumber-Steps</a></strong></p>
<textarea cols="40" rows="10" name="code" class="Ruby"># Authlogic ~ Cucumber Authentication Steps

Before do
	include Authlogic::TestCase
	activate_authlogic
end

#
# Helper Methods available to other steps
#

def create_user(login)
  @current_user = User.create!(
    :login => login,
    :password => 'generic',
    :password_confirmation => 'generic',
    :email => "#{login}@example.com"
  )
end

def login_user
  visit "/login" 
  fill_in("login", :with => @current_user.login) 
  fill_in("password", :with => 'generic') 
  click_button("Login")
end

def logout_user
  session = UserSession.find
  session.destroy if session
end

def user_session
  @session ||= UserSession.find
end

#
# Cucumber Assertions
#

Given /^I am the user "(.*)"$/ do |login|
  create_user login
end

Given /^I am logged in as "(.*)"$/ do |login|
  create_user login
  login_user
end

Given /^I am not logged in$/ do
  logout_user
end

When /^I Log In$/ do
  login_user
end

When /^I logout$/ do
  logout_user
end

Then /^there should be a session$/ do
  user_session
  @session.should_not be nil
end

Then /^there should not be a session$/ do
  user_session
  @session.should be nil
end

Then /^the user should be "([^"]*)"$/ do |login| #"
  user_session
  @session.user.login.should be == login
end
</textarea>
	<!-- WordPress Code Snippet -->
	<script type="text/javascript" src="http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/js/shCore.js"></script><script type="text/javascript" src="http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/js/shBrushRuby.js"></script>
	<link type="text/css" rel="stylesheet" href="http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/css/SyntaxHighlighter.css"/>
	
	<script language="javascript">
	dp.SyntaxHighlighter.ClipboardSwf = 'http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/js/clipboard.swf';
	dp.SyntaxHighlighter.HighlightAll('code');
	</script>
	<!-- End WordPress Code Snippet -->
	]]></content:encoded>
			<wfw:commentRss>http://blog.mindtonic.net/using_authlogic_with_cucumber/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>git_remote_branch For Easy Git Remote Branches</title>
		<link>http://blog.mindtonic.net/git_remote_branch-for-easy-git-remote-branches/</link>
		<comments>http://blog.mindtonic.net/git_remote_branch-for-easy-git-remote-branches/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 20:34:25 +0000</pubDate>
		<dc:creator>mindtonic</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[remote branches]]></category>

		<guid isPermaLink="false">http://blog.mindtonic.net/?p=143</guid>
		<description><![CDATA[I was looking for a way to track a local branch to a remote repository.  I came across this great plugin: http://github.com/webmat/git_remote_branch]]></description>
			<content:encoded><![CDATA[<p>I was looking for a way to track a local branch to a remote repository.  I came across this great plugin: <a href="http://github.com/webmat/git_remote_branch">http://github.com/webmat/git_remote_branch</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mindtonic.net/git_remote_branch-for-easy-git-remote-branches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the global Git Username and Email</title>
		<link>http://blog.mindtonic.net/setting-the-global-git-username-and-email/</link>
		<comments>http://blog.mindtonic.net/setting-the-global-git-username-and-email/#comments</comments>
		<pubDate>Fri, 28 May 2010 13:58:50 +0000</pubDate>
		<dc:creator>mindtonic</dc:creator>
				<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://blog.mindtonic.net/?p=140</guid>
		<description><![CDATA[This information is readily available from Github after you create a new repository, but I have been bouncing around a lot of different computers lately, so I needed a refresher course. Running these statements at the command line will set the global Username and Email for all of your repositories. git config --global user.name "Jay [...]]]></description>
			<content:encoded><![CDATA[<p>This information is readily available from <a href="http://github.com">Github</a> after you create a new repository, but I have been bouncing around a lot of different computers lately, so I needed a refresher course.  Running these statements at the command line will set the global Username and Email for all of your repositories.<br />
<code><br />
git config --global user.name "Jay Sanders"<br />
git config --global user.email my-cool-email@spam.com<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mindtonic.net/setting-the-global-git-username-and-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Github and Heroku Together</title>
		<link>http://blog.mindtonic.net/using-github-and-heroku-together/</link>
		<comments>http://blog.mindtonic.net/using-github-and-heroku-together/#comments</comments>
		<pubDate>Fri, 28 May 2010 13:37:41 +0000</pubDate>
		<dc:creator>mindtonic</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[Heroku]]></category>

		<guid isPermaLink="false">http://blog.mindtonic.net/?p=133</guid>
		<description><![CDATA[From: http://www.mail-archive.com/heroku@googlegroups.com/msg00350.html Can I get suggestions on how to move my app from GitHub to Heroku and back? You can do this if you&#8217;re using git locally. The magic of decentralized revision control makes it possible, since every checkout is a full repository in its own right. What I suggest is adding two different remotes [...]]]></description>
			<content:encoded><![CDATA[<p>From: <a href="http://www.mail-archive.com/heroku@googlegroups.com/msg00350.html">http://www.mail-archive.com/heroku@googlegroups.com/msg00350.html</a></p>
<p style="padding-left: 30px;">Can I get suggestions on how to move my app from <a href="http://github.com">GitHub</a> to <a href="http://heroku.com/">Heroku</a> and back?</p>
<p style="padding-left: 30px;">You can do this if you&#8217;re using git locally.  The magic of<br />
decentralized revision control makes it possible, since every checkout<br />
is a full repository in its own right.  What I suggest is adding two<br />
different remotes to your local checkout, and then you can push to<br />
both.  Something like this:<br />
<code><br />
git remote add github [EMAIL PROTECTED]:myaccount/myapp.git<br />
git remote add heroku [EMAIL PROTECTED]:myapp.git<br />
</code></p>
<p style="padding-left: 30px;">Then you can do &#8220;git push heroku&#8221; and &#8220;git push github&#8221;, or pull, or<br />
diff, or whatever.  You could also name one origin, which will make it<br />
the default, but it would probably lead to less confusion if you had<br />
to explicitly name where you wanted to push or pull from each time.</p>
<p>In my specific case, I am already hosting my codebase on Github.  I want to keep the main repository there because I like all of the available features.  I also want to be able to work with collaborators and allow them to make commits to the master Github repository.</p>
<p>Heroku is amazing, but when you push to the Heroku repository it automatically restarts the application.  Using these methods, I can maintain a situation where one person is able to manage what actually goes &#8220;live&#8221; to Heroku, while everyone else can work away on Github using the normal collaboration procedures.</p>
<p>Result, the best of both worlds!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mindtonic.net/using-github-and-heroku-together/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing MySQL Gem after Installing MySQL From MacPorts</title>
		<link>http://blog.mindtonic.net/installing-mysql-gem-after-installing-mysql-from-macports/</link>
		<comments>http://blog.mindtonic.net/installing-mysql-gem-after-installing-mysql-from-macports/#comments</comments>
		<pubDate>Tue, 25 May 2010 20:25:54 +0000</pubDate>
		<dc:creator>mindtonic</dc:creator>
				<category><![CDATA[Gems]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MacPorts]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.mindtonic.net/?p=130</guid>
		<description><![CDATA[MacPorts is a fantastic resource for installing and managing libraries on OSX. When working with Ruby on Rails, I installed MySQL (and Postgresql) using MacPorts, but had trouble getting the MySQL gem to install and connect. The error message I received was: Error: uninitialized constant MysqlCompat::MysqlRes Here is the magic formula: sudo gem install -v [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://macports.org">MacPorts</a> is a fantastic resource for installing and managing libraries on OSX.  When working with Ruby on Rails, I installed MySQL (and Postgresql) using MacPorts, but had trouble getting the MySQL gem to install and connect.  The error message I received was:</p>
<p><code>Error: uninitialized constant MysqlCompat::MysqlRes</code></p>
<p>Here is the magic formula:<br />
<code><br />
sudo gem install -v 2.7 --no-rdoc --no-ri mysql --<br />
--with-mysql-dir=/opt/local/lib/mysql5<br />
--with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config;<br />
</code></p>
<p>Source: <a href="http://www.ruby-forum.com/topic/192550">http://www.ruby-forum.com/topic/192550</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mindtonic.net/installing-mysql-gem-after-installing-mysql-from-macports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Better State Machine</title>
		<link>http://blog.mindtonic.net/a-better-state-machine/</link>
		<comments>http://blog.mindtonic.net/a-better-state-machine/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 13:33:35 +0000</pubDate>
		<dc:creator>mindtonic</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Rails Plugins]]></category>
		<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[observers]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[state_machine]]></category>

		<guid isPermaLink="false">http://blog.mindtonic.net/?p=128</guid>
		<description><![CDATA[I have been using AASM as my default State Machine Rails plugin for quite some time. It has always worked great, but now there is a better, more thorough State Machine I recommend. state_machine 0.9 has just been released, and as you can read in this blog post, they are rapidly moving towards the finalization [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using AASM as my default State Machine Rails plugin for quite some time.  It has always worked great, but now there is a better, more thorough State Machine I recommend.  state_machine 0.9 has just been released, and as you can read in this blog post, they are rapidly moving towards the finalization of the 1.0 version.  <a href="http://www.pluginaweek.org/2010/04/19/state_machine-0-9-0-locked-and-loaded">http://www.pluginaweek.org/2010/04/19/state_machine-0-9-0-locked-and-loaded</a>!</p>
<p>What lead me to discover this fantastic plugin was the need to be able to call ActiveRecord observers in relation to the State of an object.  With AASM, I had to incorporate my lib class calls in a method that was referenced in a state definition.  I didn&#8217;t like this because it required my Model to have too much knowledge of the outside world.  I think it is a best practice to encapsulate this type of functionality into an observer, leaving the model to be happy in it&#8217;s own little world.  state_machine accomplishes this by allowing the placement of observer calls using a DSL provided by the plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mindtonic.net/a-better-state-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git Philosophy And Practice References</title>
		<link>http://blog.mindtonic.net/git-philosophy-and-practice-references/</link>
		<comments>http://blog.mindtonic.net/git-philosophy-and-practice-references/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 21:08:14 +0000</pubDate>
		<dc:creator>mindtonic</dc:creator>
				<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://blog.mindtonic.net/?p=126</guid>
		<description><![CDATA[http://www.eecs.harvard.edu/~cduan/technical/git/ http://ariejan.net/2009/06/08/best-practice-the-git-development-cycle/]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.eecs.harvard.edu/~cduan/technical/git/">http://www.eecs.harvard.edu/~cduan/technical/git/</a></p>
<p><a href="http://ariejan.net/2009/06/08/best-practice-the-git-development-cycle/">http://ariejan.net/2009/06/08/best-practice-the-git-development-cycle/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mindtonic.net/git-philosophy-and-practice-references/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting attachment_fu to Paperclip</title>
		<link>http://blog.mindtonic.net/converting-attachment_fu-to-paperclip/</link>
		<comments>http://blog.mindtonic.net/converting-attachment_fu-to-paperclip/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 15:37:56 +0000</pubDate>
		<dc:creator>mindtonic</dc:creator>
				<category><![CDATA[Gems]]></category>
		<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[Paperclip]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.mindtonic.net/?p=118</guid>
		<description><![CDATA[I am making the transition from attachment_fu to paperclip on a very large project of mine. I wrote the following method, inside of my old attachment_fu model ItemImage to do the work. I wrote it to run from inside the rails console. It gives handy messages out letting you know what happened. Reference: http://thewebfellas.com/blog/2008/11/2/goodbye-attachment_fu-hello-paperclip def [...]]]></description>
			<content:encoded><![CDATA[<p>I am making the transition from attachment_fu to <a href="http://github.com/thoughtbot/paperclip">paperclip</a> on a very large project of mine.  I wrote the following method, inside of my old attachment_fu model ItemImage to do the work.  I wrote it to run from inside the rails console.  It gives handy messages out letting you know what happened.</p>
<p>Reference: <a href="http://thewebfellas.com/blog/2008/11/2/goodbye-attachment_fu-hello-paperclip">http://thewebfellas.com/blog/2008/11/2/goodbye-attachment_fu-hello-paperclip</a></p>
<textarea cols="40" rows="10" name="code" class="Ruby">def self.convert_fu
  for item in Item.all
    # has an image
    if item.item_image
      # the image exists
      filename = "public" + item.item_image.public_filename
      if File::exists?(filename)
        image = File.open(filename)
        item.image = image
        item.save
        puts "#{item.name} Image Converted"
      else
        puts "====&gt; #{item.name} Image could not be found"
      end
    else
      puts "#{item.name} has no image"
    end
  end
end</textarea>
	<!-- WordPress Code Snippet -->
	<script type="text/javascript" src="http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/js/shCore.js"></script><script type="text/javascript" src="http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/js/shBrushRuby.js"></script>
	<link type="text/css" rel="stylesheet" href="http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/css/SyntaxHighlighter.css"/>
	
	<script language="javascript">
	dp.SyntaxHighlighter.ClipboardSwf = 'http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/js/clipboard.swf';
	dp.SyntaxHighlighter.HighlightAll('code');
	</script>
	<!-- End WordPress Code Snippet -->
	]]></content:encoded>
			<wfw:commentRss>http://blog.mindtonic.net/converting-attachment_fu-to-paperclip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculating The Number Of Months Between Two Dates In Ruby</title>
		<link>http://blog.mindtonic.net/calculating-the-number-of-months-between-two-dates-in-ruby/</link>
		<comments>http://blog.mindtonic.net/calculating-the-number-of-months-between-two-dates-in-ruby/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 18:08:44 +0000</pubDate>
		<dc:creator>mindtonic</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.mindtonic.net/?p=114</guid>
		<description><![CDATA[My research led me here: http://www.francisfish.com/getting_the_number_of_months_between_two_dates_in_rubyrails.htm def months_between( startdate = Time.now, enddate = Time.now ) (enddate.month - startdate.month) + 12 * (enddate.year - startdate.year) end dp.SyntaxHighlighter.ClipboardSwf = 'http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/js/clipboard.swf'; dp.SyntaxHighlighter.HighlightAll('code');]]></description>
			<content:encoded><![CDATA[<p>My research led me here: <a href="http://www.francisfish.com/getting_the_number_of_months_between_two_dates_in_rubyrails.htm">http://www.francisfish.com/getting_the_number_of_months_between_two_dates_in_rubyrails.htm</a></p>
<textarea cols="40" rows="10" name="code" class="Ruby">def months_between( startdate = Time.now, enddate = Time.now )
  (enddate.month - startdate.month) + 12 * (enddate.year - startdate.year) 
end</textarea>
	<!-- WordPress Code Snippet -->
	<script type="text/javascript" src="http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/js/shCore.js"></script><script type="text/javascript" src="http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/js/shBrushRuby.js"></script>
	<link type="text/css" rel="stylesheet" href="http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/css/SyntaxHighlighter.css"/>
	
	<script language="javascript">
	dp.SyntaxHighlighter.ClipboardSwf = 'http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/js/clipboard.swf';
	dp.SyntaxHighlighter.HighlightAll('code');
	</script>
	<!-- End WordPress Code Snippet -->
	]]></content:encoded>
			<wfw:commentRss>http://blog.mindtonic.net/calculating-the-number-of-months-between-two-dates-in-ruby/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Indexing Ultrasphinx with Rufus Scheduler</title>
		<link>http://blog.mindtonic.net/indexing-ultrasphinx-with-rufus-scheduler/</link>
		<comments>http://blog.mindtonic.net/indexing-ultrasphinx-with-rufus-scheduler/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 20:01:57 +0000</pubDate>
		<dc:creator>mindtonic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mindtonic.net/?p=110</guid>
		<description><![CDATA[I&#8217;m using Sphinx and Ultrasphinx for the search engine on one of my projects. I have been struggling with ways to automated the indexing of the database as the commands are rake commands on the command line. Turns out that rufus-scheduler is an excellent solution to this issue. If you allow the scheduler access to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using Sphinx and Ultrasphinx for the search engine on one of my projects.  I have been struggling with ways to automated the indexing of the database as the commands are rake commands on the command line.  Turns out that rufus-scheduler is an excellent solution to this issue.  If you allow the scheduler access to the rake file, it is as simple as this schedule below &#8211; it is designed to reindex every 90 minutes.  I have chose to use the ultrasphinx:bootstrap command because it also has the God like quality of making sure the search server is running at all times.</p>
<textarea cols="40" rows="10" name="code" class="Ruby">config/initializers/task_schedule.rb 

require 'rake'
require 'rufus/scheduler'
load File.join( RAILS_ROOT, 'Rakefile')

scheduler = Rufus::Scheduler.start_new  

scheduler.every("90m") do
  Rake::Task["ultrasphinx:bootstrap"].invoke
end</textarea>
	<!-- WordPress Code Snippet -->
	<script type="text/javascript" src="http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/js/shCore.js"></script><script type="text/javascript" src="http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/js/shBrushRuby.js"></script>
	<link type="text/css" rel="stylesheet" href="http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/css/SyntaxHighlighter.css"/>
	
	<script language="javascript">
	dp.SyntaxHighlighter.ClipboardSwf = 'http://blog.mindtonic.net/wp-content/plugins/wordpress-code-snippet/js/clipboard.swf';
	dp.SyntaxHighlighter.HighlightAll('code');
	</script>
	<!-- End WordPress Code Snippet -->
	]]></content:encoded>
			<wfw:commentRss>http://blog.mindtonic.net/indexing-ultrasphinx-with-rufus-scheduler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
