<?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>Hank Beaver &#187; sinatra</title>
	<atom:link href="http://www.hankbeaver.com/index.php/tag/sinatra/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hankbeaver.com</link>
	<description>Ruby, open-source, Internet technologist located in Atlanta, GA, USA</description>
	<lastBuildDate>Tue, 29 Jun 2010 05:34:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using Rails for custom applications and avoiding the CMS trap.</title>
		<link>http://www.hankbeaver.com/index.php/2009/09/03/using-rails-for-custom-applications-and-avoiding-the-cms-trap/</link>
		<comments>http://www.hankbeaver.com/index.php/2009/09/03/using-rails-for-custom-applications-and-avoiding-the-cms-trap/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 17:38:23 +0000</pubDate>
		<dc:creator>hbeaver</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[esi]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[sinatra]]></category>

		<guid isPermaLink="false">http://www.rubyslacker.com/?p=102</guid>
		<description><![CDATA[I&#8217;m am still captivated by the perfect, simple CMS solution in Ruby/Rails (I&#8217;ll take another framework too).  There are some fantastic projects out there, browsercms.org for example. But posts like  THIS , really drive home the point. If Wordpress is so well suited for a simple site and/or blog, why not just use [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m am still captivated by the perfect, simple CMS solution in Ruby/Rails (I&#8217;ll take another framework too).  There are some fantastic projects out there, <a href="http://www.rubyslacker.com/wp-admin/browsercms.org">browsercms.org</a> for example. But posts like <a href="http://aaronlongwell.com/2009/06/the-ruby-on-rails-cms-dilemma.html"> THIS </a>, really drive home the point. If Wordpress is so well suited for a simple site and/or blog, why not just use it? <a href="http://www.igvita.com/2007/07/04/integrating-wordpress-and-rails/">Igvita</a> demonstrates easy Rails integration with <a href="http://www.apache.org">Apache</a> rewrite rules.</p>
<p>There are others out there stating the same thing: while Rails can be used to create a CMS, a developer&#8217;s time is better spent solving business rather than reinventing the wheel in Ruby to keep the whole project/code under one umbrella. And at my current gig, we are starting to retool for this paradigm. Rails and <a href="http://www.sinatrarb.org">Sinatra</a> apps are purely business focuses and super light weight. These service applications can them be glued together via <a href="http://www.w3.org/TR/esi-lang">ESI</a>, rewrites, or Wordpress for consumption. In effect, your complex web app is assembled at request time from a set of simple web services. Here is some mock code to demonstrate:</p>
<pre>
wordpress_template.php
//some more wonder wordpress stuff
&lt;?= include_rails_service('http://service.app/user/profile',ESI_INCLUDE) ?&gt;
//some more wonder wordpress stuff
&lt;?= include_rails_service('http://service.app2/events/weeks/2',SERVICE) ?&gt;
//end of wordpress.php
...
//function included elsewhere
function include_rails_service(service_url,type){
//could return any of following for the resource url
 switch (type) {
  case ESI_INCLUDE:
   return "&lt;esi include ='" + service_url + "'&gt;";
   break;
  case SERVICE:
   include service_url;
   break;
  case AJAX:
//javascript include with service js, doing doc.write
}
}
</pre>
<p>The point is Wordpress doesn&#8217;t know about Rails and Rails doesn&#8217;t know about Wordpress. Keep them seperate, keep them simple and make life better.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hankbeaver.com/index.php/2009/09/03/using-rails-for-custom-applications-and-avoiding-the-cms-trap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql::Error: MySQL server has gone away with Sinatra + ActiveRecord</title>
		<link>http://www.hankbeaver.com/index.php/2009/08/10/mysqlerror-mysql-server-has-gone-away-with-sinatra-activerecord/</link>
		<comments>http://www.hankbeaver.com/index.php/2009/08/10/mysqlerror-mysql-server-has-gone-away-with-sinatra-activerecord/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 17:17:12 +0000</pubDate>
		<dc:creator>hbeaver</dc:creator>
				<category><![CDATA[activerecord]]></category>
		<category><![CDATA[sinatra]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[thin]]></category>

		<guid isPermaLink="false">http://www.rubyslacker.com/?p=98</guid>
		<description><![CDATA[When working with Sinatra + ActiveRecord + MySQL running on the venerable Thin server, you are probably going to see the error after 8 hours(MySQL default connection timeout):  &#8220;Mysql::Error: MySQL server has gone away&#8221; message. The resolution is pretty simple: 

class NewApp < Sinatra::Default   

  before do
    ActiveRecord::Base.connection.verify!
 [...]]]></description>
			<content:encoded><![CDATA[<p>When working with Sinatra + ActiveRecord + MySQL running on the venerable <a href="http://code.macournoyer.com/thin/">Thin</a> server, you are probably going to see the error after 8 hours(MySQL default connection timeout):  &#8220;Mysql::Error: MySQL server has gone away&#8221; message. The resolution is pretty simple: </p>
<pre>
class NewApp < Sinatra::Default   

  before do
    ActiveRecord::Base.connection.verify!
  end
...
end #end of Sinatra class
</pre>
<p>I created a Lighthouse ticket before I discovered the resolution. There are also more technical details here: <a href="https://thin.lighthouseapp.com/projects/7212-thin/tickets/101-activerecord-connection-does-not-reconnect-when-using-thinsinatra-but-works-fine-with-just-sinatra#ticket-101-4">https://thin.lighthouseapp.com/projects/7212-thin/tickets/101-activerecord-connection-does-not-reconnect-when-using-thinsinatra-but-works-fine-with-just-sinatra#ticket-101-4</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hankbeaver.com/index.php/2009/08/10/mysqlerror-mysql-server-has-gone-away-with-sinatra-activerecord/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
