<?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>JGW Maxwell</title>
	<atom:link href="http://jgwmaxwell.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jgwmaxwell.com</link>
	<description>Web Architect</description>
	<lastBuildDate>Tue, 25 Sep 2012 14:44:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Update &#8211; or, where I&#8217;ve been and what I&#8217;m doing!</title>
		<link>http://jgwmaxwell.com/update-or-where-ive-been-and-what-im-doing/</link>
		<comments>http://jgwmaxwell.com/update-or-where-ive-been-and-what-im-doing/#comments</comments>
		<pubDate>Sat, 18 Aug 2012 18:53:08 +0000</pubDate>
		<dc:creator>JGW Maxwell</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Book]]></category>
		<category><![CDATA[Golang]]></category>
		<category><![CDATA[Groovy Bananas]]></category>

		<guid isPermaLink="false">http://jgwmaxwell.com/?p=16065221175</guid>
		<description><![CDATA[<p><p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>I&#8217;m sorry there hasn&#8217;t been much action on here recently &#8211; it&#8217;s been a manic few weeks. I&#8217;m writing a book on Writing Performant Ruby (catchier title pending), which will be coming out in the new year, and &#8211; if anyone happens to be around the Worcester, UK region then I&#8217;m presenting at @WooWebUK on Google&#8217;s Go language next month (September 20th) &#8211; look it up and come along! There&#8217;ll be a couple of new blog posts out in the next couple of weeks, as well as a tutorial series on designing scalable apps &#8211; check back!</p></p><p><a href="http://jgwmaxwell.com/update-or-where-ive-been-and-what-im-doing/">Update &#8211; or, where I&#8217;ve been and what I&#8217;m doing!</a></p>]]></description>
				<content:encoded><![CDATA[<p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>I&#8217;m sorry there hasn&#8217;t been much action on here recently &#8211; it&#8217;s been a manic few weeks.</p>
<p>I&#8217;m writing a book on Writing Performant Ruby (catchier title pending), which will be coming out in the new year, and &#8211; if anyone happens to be around the Worcester, UK region then I&#8217;m presenting at <a title="WooWebUK" href="http://twitter.com/woowebuk" target="_blank">@WooWebUK</a> on Google&#8217;s Go language next month (September 20th) &#8211; look it up and come along!</p>
<p>There&#8217;ll be a couple of new blog posts out in the next couple of weeks, as well as a tutorial series on designing scalable apps &#8211; check back!</p>
<p><a href="http://jgwmaxwell.com/update-or-where-ive-been-and-what-im-doing/">Update &#8211; or, where I&#8217;ve been and what I&#8217;m doing!</a></p>]]></content:encoded>
			<wfw:commentRss>http://jgwmaxwell.com/update-or-where-ive-been-and-what-im-doing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Help improve RefineryCMS PgSearch!</title>
		<link>http://jgwmaxwell.com/help-improve-refinerycms-pgsearch/</link>
		<comments>http://jgwmaxwell.com/help-improve-refinerycms-pgsearch/#comments</comments>
		<pubDate>Mon, 23 Jul 2012 11:51:55 +0000</pubDate>
		<dc:creator>JGW Maxwell</dc:creator>
				<category><![CDATA[refinerycms-pgsearch]]></category>
		<category><![CDATA[Full Text Search]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[RefineryCMS]]></category>

		<guid isPermaLink="false">http://jgwmaxwell.com/?p=16065221170</guid>
		<description><![CDATA[<p><p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>If you wouldn&#8217;t mind taking a couple of minutes to fill in this quick questionnaire about the direction that RefineryCMS PgSearch should take, it would help the community massively! This relates to the gem I released a couple of days ago.</p></p><p><a href="http://jgwmaxwell.com/help-improve-refinerycms-pgsearch/">Help improve RefineryCMS PgSearch!</a></p>]]></description>
				<content:encoded><![CDATA[<p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>If you wouldn&#8217;t mind taking a couple of minutes to fill in this quick questionnaire about the direction that RefineryCMS PgSearch should take, it would help the community massively! This relates to the <pre class="crayon-plain-tag">refinerycms-pgsearch</pre> gem I released a couple of days ago.<span id="more-16065221170"></span></p>
<iframe src="https://docs.google.com/spreadsheet/embeddedform?formkey=dGEtODg5d0pVeG9reEVfdTEyc0MtNWc6MQ" width="760" height="2036" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>
<p><a href="http://jgwmaxwell.com/help-improve-refinerycms-pgsearch/">Help improve RefineryCMS PgSearch!</a></p>]]></content:encoded>
			<wfw:commentRss>http://jgwmaxwell.com/help-improve-refinerycms-pgsearch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Gem &#8211; RefineryCMS PgSearch</title>
		<link>http://jgwmaxwell.com/new-gem-refinerycms-pgsearch/</link>
		<comments>http://jgwmaxwell.com/new-gem-refinerycms-pgsearch/#comments</comments>
		<pubDate>Sat, 21 Jul 2012 02:29:58 +0000</pubDate>
		<dc:creator>JGW Maxwell</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://jgwmaxwell.com/?p=16065221167</guid>
		<description><![CDATA[<p><p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>I&#8217;ve just released an improved version of the Search gem for RefineryCMS by Resolve Digital. This version uses PostgreSQL&#8217;s inbuilt full-text search capabilities to offer performant search in a scalable manner on Postgres based sites. Check out http://jgwmaxwell.github.com/refinerycms-pgsearch for more information, or just add to your Gemfile, then run: And you are underway! Enjoy</p></p><p><a href="http://jgwmaxwell.com/new-gem-refinerycms-pgsearch/">New Gem &#8211; RefineryCMS PgSearch</a></p>]]></description>
				<content:encoded><![CDATA[<p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>I&#8217;ve just released an improved version of the Search gem for RefineryCMS by Resolve Digital. This version uses PostgreSQL&#8217;s inbuilt full-text search capabilities to offer performant search in a scalable manner on Postgres based sites.</p>
<p>Check out <a title="Github Site" href="http://jgwmaxwell.github.com/refinerycms-pgsearch">http://jgwmaxwell.github.com/refinerycms-pgsearch</a> for more information, or just add <pre class="crayon-plain-tag">gem 'refinerycms-pgsearch'</pre> to your Gemfile, then run:</p>
<p></p><pre class="crayon-plain-tag">rails g refinery:search

rake db:migrate

rake db:seed

rake refinery:search:rebuild</pre><p></p>
<p>And you are underway! Enjoy <img src='http://jgwmaxwell.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://jgwmaxwell.com/new-gem-refinerycms-pgsearch/">New Gem &#8211; RefineryCMS PgSearch</a></p>]]></content:encoded>
			<wfw:commentRss>http://jgwmaxwell.com/new-gem-refinerycms-pgsearch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mass Assignment Security with Mongoid</title>
		<link>http://jgwmaxwell.com/mass-assignment-security-with-mongoid/</link>
		<comments>http://jgwmaxwell.com/mass-assignment-security-with-mongoid/#comments</comments>
		<pubDate>Mon, 16 Jul 2012 12:06:29 +0000</pubDate>
		<dc:creator>JGW Maxwell</dc:creator>
				<category><![CDATA[Hints & Tips]]></category>
		<category><![CDATA[Mass Assignment]]></category>
		<category><![CDATA[Mongoid]]></category>
		<category><![CDATA[Rails 3.2]]></category>

		<guid isPermaLink="false">http://jgwmaxwell.com/?p=16065221156</guid>
		<description><![CDATA[<p><p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>EDIT &#8211; THIS POST WAS RETARDED, AND COMBINED TWO MUTUALLY EXCLUSIVE WAYS OF DEALING WITH THINGS. You only ever need one OR the other of these approaches &#8211; Strong Parameters does not work WITH attr_accessible &#8211; if you want to use it, you need to remove the mod below for attr_accessible by default, just like you set whitelist_attributes to false with ActiveRecord. This is a follow up to this post, which dealt with Mass Assignment Security in ActiveRecord. Mongoid doesn&#8217;t support setting to enable Mass Assignment Security, so we need a way around this. Essentially, all this switch does is add to your models, making you declare each field that you wish to be eligible for Mass Assignment. We can do this very simply with Mongoid by adding an Initializer. That&#8217;s all you need to do &#8211; remove the line altogether from your application.rb, and you are good to go.</p></p><p><a href="http://jgwmaxwell.com/mass-assignment-security-with-mongoid/">Mass Assignment Security with Mongoid</a></p>]]></description>
				<content:encoded><![CDATA[<p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p><strong>EDIT &#8211; THIS POST WAS RETARDED, AND COMBINED TWO MUTUALLY EXCLUSIVE WAYS OF DEALING WITH THINGS.</strong></p>
<p><strong>You only ever need one OR the other of these approaches &#8211; Strong Parameters does not work WITH attr_accessible &#8211; if you want to use it, you need to remove the mod below for attr_accessible by default, just like you set whitelist_attributes to false with ActiveRecord.</strong></p>
<p><em>This is a follow up to <a title="Stronger, Safer, More Secure Rails Mass Assignment" href="http://jgwmaxwell.com/stronger-safer-more-secure-rails-mass-assignment/">this post</a>, which dealt with Mass Assignment Security in ActiveRecord.</em></p>
<p>Mongoid doesn&#8217;t support setting <pre class="crayon-plain-tag">config.active_record.whitelist_attributes = true</pre> to enable Mass Assignment Security, so we need a way around this. Essentially, all this switch does is add <pre class="crayon-plain-tag">attr_accessible nil</pre> to your models, making you declare each field that you wish to be eligible for Mass Assignment. We can do this very simply with Mongoid by adding an Initializer.</p>
<p></p><pre class="crayon-plain-tag">module Mongoid
module WhitelistAttributes
extend ActiveSupport::Concern

included do
attr_accessible nil
end
end

module Document
include WhitelistAttributes
end
end</pre><p></p>
<p>That&#8217;s all you need to do &#8211; remove the line <pre class="crayon-plain-tag">config.active_record.whitelist_attributes = true</pre> altogether from your application.rb, and you are good to go.</p>
<p><a href="http://jgwmaxwell.com/mass-assignment-security-with-mongoid/">Mass Assignment Security with Mongoid</a></p>]]></content:encoded>
			<wfw:commentRss>http://jgwmaxwell.com/mass-assignment-security-with-mongoid/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Launching Cloudhaven Hosted e-Commerce</title>
		<link>http://jgwmaxwell.com/launching-cloudhaven-hosted-ecommerce/</link>
		<comments>http://jgwmaxwell.com/launching-cloudhaven-hosted-ecommerce/#comments</comments>
		<pubDate>Fri, 13 Jul 2012 10:47:23 +0000</pubDate>
		<dc:creator>JGW Maxwell</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Cloudhaven]]></category>
		<category><![CDATA[e-Commerce]]></category>
		<category><![CDATA[SaaS]]></category>

		<guid isPermaLink="false">http://jgwmaxwell.com/?p=16065221148</guid>
		<description><![CDATA[<p><p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>Firstly, many apologies for not having had the time to update this much recently, I&#8217;ve been flat out working on the final stages of Cloudhaven, the hosted e-Commerce platform that I&#8217;ve been working on for a long time. I have to say I&#8217;m delighted with what we&#8217;ve managed to produce &#8211; there are many innovative features that will make a difference to real-world stores selling online. I will be offering a full write up soon on what it does, along with releasing 2-3 gems that we&#8217;ve built for community release in the process of building it, but don&#8217;t worry &#8211; this site isn&#8217;t going to become propaganda! However, we are starting to send out some invites to people registered on our beta-testing mailing list, if anyone would like to sign up to become a tester, you&#8217;ll get a fully featured store free for the duration of testing and some great <a class="moretag" href="http://jgwmaxwell.com/launching-cloudhaven-hosted-ecommerce/">Read more...</a></p></p><p><a href="http://jgwmaxwell.com/launching-cloudhaven-hosted-ecommerce/">Launching Cloudhaven Hosted e-Commerce</a></p>]]></description>
				<content:encoded><![CDATA[<p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>Firstly, many apologies for not having had the time to update this much recently, I&#8217;ve been flat out working on the final stages of Cloudhaven, the hosted e-Commerce platform that I&#8217;ve been working on for a long time. I have to say I&#8217;m delighted with what we&#8217;ve managed to produce &#8211; there are many innovative features that will make a difference to real-world stores selling online. I will be offering a full write up soon on what it does, along with releasing 2-3 gems that we&#8217;ve built for community release in the process of building it, but don&#8217;t worry &#8211; this site isn&#8217;t going to become propaganda!</p>
<p><a href="http://cloudhaven.net"><img class="alignleft size-large wp-image-16065221149" title="Cloudhaven Beta Tester signup form" src="http://cdn.jgwmaxwell.com/wp-content/uploads/2012/07/cloudhaven-beta-1024x504.png" alt="" width="640" height="315" /></a></p>
<p>However, we are starting to send out some invites to people registered on our beta-testing mailing list, if anyone would like to sign up to become a tester, you&#8217;ll get a fully featured store free for the duration of testing and some great savings for life after the beta period comes to an end.</p>
<p>If anyone wants to register for more details and to try it out, go to <a title="Cloudhaven Signup" href="http://cloudhaven.net" target="_blank">http://cloudhaven.net</a> and sign-up. We&#8217;ll never spam you, nor let your details out of our clutches, so come and find out more!</p>
<p><a href="http://jgwmaxwell.com/launching-cloudhaven-hosted-ecommerce/">Launching Cloudhaven Hosted e-Commerce</a></p>]]></content:encoded>
			<wfw:commentRss>http://jgwmaxwell.com/launching-cloudhaven-hosted-ecommerce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stronger, Safer, More Secure Rails Mass Assignment</title>
		<link>http://jgwmaxwell.com/stronger-safer-more-secure-rails-mass-assignment/</link>
		<comments>http://jgwmaxwell.com/stronger-safer-more-secure-rails-mass-assignment/#comments</comments>
		<pubDate>Fri, 22 Jun 2012 19:40:50 +0000</pubDate>
		<dc:creator>JGW Maxwell</dc:creator>
				<category><![CDATA[Hints & Tips]]></category>
		<category><![CDATA[Mass Assignment]]></category>
		<category><![CDATA[Rails Security]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://jgwmaxwell.com/?p=16065221138</guid>
		<description><![CDATA[<p><p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>There has been a reasonable amount of focus on security recently, with a number of high profile websites succumbing to a variety of password hacks. I&#8217;m not going to discuss password security here, although please, please don&#8217;t be a mug and  store them in plain text or just as a simple hash, even with a salt. If you were planning on doing that, read up on the issues first, especially on BCrypt or a similar solution before you go live &#8211; you owe it to your users. Mass assignment is something which has often been the cause of security holes, but shouldn&#8217;t be. Best practice in Rails has been to use attr_accessible to declare mass assignable attributes, which works well, other than it puts the burden for authorization of which attributes are ok into the Model. This is a violation of MVC, where the Controller should be handling Authorization/Authentication. It <a class="moretag" href="http://jgwmaxwell.com/stronger-safer-more-secure-rails-mass-assignment/">Read more...</a></p></p><p><a href="http://jgwmaxwell.com/stronger-safer-more-secure-rails-mass-assignment/">Stronger, Safer, More Secure Rails Mass Assignment</a></p>]]></description>
				<content:encoded><![CDATA[<p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>There has been a reasonable amount of focus on security recently, with a number of high profile websites succumbing to a variety of password hacks. I&#8217;m not going to discuss password security here, although please, please don&#8217;t be a mug and  store them in plain text or just as a simple hash, even with a salt. If you were planning on doing that, read up on the issues first, especially on BCrypt or a similar solution before you go live &#8211; you owe it to your users.</p>
<p>Mass assignment is something which has often been the cause of security holes, but shouldn&#8217;t be. Best practice in Rails has been to use attr_accessible to declare mass assignable attributes, which works well, other than it puts the burden for authorization of which attributes are ok into the Model. This is a violation of MVC, where the Controller should be handling Authorization/Authentication. It also is limited, as different situations might require a different set of acceptable attributes for the same model. So, what can we do?</p>
<p>Enter <code>strong_parameters</code> &#8211; a gem which gives granular, situational control over acceptable attributes in the Controller. It is simple to use, and offers some great control at the cost of additional time and complexity when programming. Using it is a 3 step process:</p>
<p></p><pre class="crayon-plain-tag">gem 'strong_parameters'</pre><p></p>
<p></p><pre class="crayon-plain-tag">class Page &amp;lt; ActiveRecord::Base
include ActiveModel::ForbiddenAttributesProtection
end</pre><p></p>
<p></p><pre class="crayon-plain-tag">class PagesController &amp;lt; ApplicationController
....
private
def page_params
params.required(:page).permit(:title, :body)
end
end</pre><p></p>
<p>Then you simply use <code>page_params</code> instead of <code>params[:page]</code> whenever you are using mass assignment. If you do this, you must remember to set <code>whitelist_attributes = true</code> in your <code>config/application.rb</code> otherwise you won&#8217;t have the inbuilt protection working, and you have to include <code>ActiveModel::ForbiddenAttributesProtection</code> in each model which automatically protects its attributes for you.</p>
<p>It takes a couple of seconds extra per controller, but is definitely worth it in my opinion, and allows you to define multiple methods for multiple situations &#8211; making the use of mass assignment secure, and versatile. Check the official Rails blog for <a title="Strong Parameters on Rails Blog" href="http://weblog.rubyonrails.org/2012/3/21/strong-parameters/" target="_blank">more info</a>.</p>
<p>&nbsp;</p>
<p><a href="http://jgwmaxwell.com/stronger-safer-more-secure-rails-mass-assignment/">Stronger, Safer, More Secure Rails Mass Assignment</a></p>]]></content:encoded>
			<wfw:commentRss>http://jgwmaxwell.com/stronger-safer-more-secure-rails-mass-assignment/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Rails is definitely FOR beginners, whatever @DHH says</title>
		<link>http://jgwmaxwell.com/rails-definitely-for-beginners-whatever-dhh-says/</link>
		<comments>http://jgwmaxwell.com/rails-definitely-for-beginners-whatever-dhh-says/#comments</comments>
		<pubDate>Mon, 18 Jun 2012 07:19:17 +0000</pubDate>
		<dc:creator>JGW Maxwell</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Learning Rails]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://jgwmaxwell.com/?p=16065221107</guid>
		<description><![CDATA[<p><p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>There are few topics in programming more likely to cause dissent than the ideal way for beginners to learn a programming language1 or even to program at all, and whilst I&#8217;ve read some great posts on the subject &#8211; I think many of them are missing the point. A lot of the posts I&#8217;ve read are 6 months old now, but little has changed to frame their arguments differently &#8211; I apologise for rehashing the subject, but I wanted to offer my own take. Not for Beginners? There seems to be a reasonably broad consensus that Rails is &#8216;not for beginners&#8217;, with comments from the very top of the ecosystem down (see @dhh tweet below). @sryche Rails was never primarily about being friendly to beginners. We encourage improvement and for people to live up to the state-of-art. &#8212; DHH (@dhh) November 30, 2011 An oversimplification of many of the arguments <a class="moretag" href="http://jgwmaxwell.com/rails-definitely-for-beginners-whatever-dhh-says/">Read more...</a></p></p><p><a href="http://jgwmaxwell.com/rails-definitely-for-beginners-whatever-dhh-says/">Rails is definitely FOR beginners, whatever @DHH says</a></p>]]></description>
				<content:encoded><![CDATA[<p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><div class="wpz-sc-box normal   ">I&#8217;ve read a lot of posts recently talking about why Rails is not designed for, nor a good choice for beginners. I think they have all missed the fundamental point.</div>
<p>There are few topics in programming more likely to cause dissent than the ideal way for beginners to learn a programming language<sup class='footnote'><a href='http://jgwmaxwell.com/rails-definitely-for-beginners-whatever-dhh-says/#fn-16065221107-1' id='fnref-16065221107-1' onclick='return fdfootnote_show(16065221107)'>1</a></sup> or even to program at all, and whilst I&#8217;ve read some great posts on the subject &#8211; I think many of them are missing the point. A lot of the posts I&#8217;ve read are 6 months old now, but little has changed to frame their arguments differently &#8211; I apologise for rehashing the subject, but I wanted to offer my own take.</p>
<h3>Not for Beginners?</h3>
<p>There seems to be a reasonably broad consensus that Rails is &#8216;not for beginners&#8217;, with comments from the very top of the ecosystem down (see <a title="@dhh twitter" href="http://twitter,com/dhh" target="_blank">@dhh</a> tweet below).</p>
<blockquote class="twitter-tweet" width="550"><p>@<a href="https://twitter.com/sryche">sryche</a> Rails was never primarily about being friendly to beginners. We encourage improvement and for people to live up to the state-of-art.</p>
<p>&mdash; DHH (@dhh) <a href="https://twitter.com/dhh/status/141963768807694336">November 30, 2011</a></p></blockquote>
<p><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script></p>
<p>An oversimplification of many of the arguments (presented more eloquently by <a title="Rob Yurkowski - Rails is definitely not for beginners" href="http://rob.yurkowski.net/post/17610425880/rails-is-definitely-not-for-beginners" target="_blank">Rob Yurkowski</a>, <a title="Some horse called Oscar" href="http://www.horsesaysinternet.com/code/rails-is-not-for-beginners/" target="_blank">some horse called Oscar</a>, <a title="Richard Bucker" href="http://iam.richardbucker.com/2011/12/08/rails-is-not-for-beginners/" target="_blank">Richard Bucker</a>, <a title="Michael Bleigh on Intridea" href="http://intridea.com/posts/what-if-rails-isnt-for-beginners-anymore" target="_blank">Michael Bleigh</a>, <a title="Google, innit." href="https://www.google.com/search?q=rails+is+not+for+beginners" target="_blank">and more</a>) is that Rails&#8217; complexity means that it is too difficult for beginners to learn, and even that the interest in Rails of beginners in some way might harm the project itself.</p>
<p>Having read most of the prominent posts on the subject, it strikes me that the people writing fall into a broadly similar camp &#8211; having some prior programming experience, encountered Rails in some previous incarnation of  the framework, feel that the ongoing changes to the codebase make it increasingly difficult for beginners to programming to learn how to get started, and/or feel that the community has become hostile and unhelpful to requests for assistance from beginners.</p>
<h3>A beginner, what&#8217;s that again?</h3>
<p>I think the most important thing to stress, and the point that gets lost by lumping all &#8216;beginners&#8217; in together in some kind of Rails Programming Draft, is that there are many many different types of beginner, with many different goals. Rob Yurkowski touches on a couple of types &#8211; young and enthusiastic or refugee from PHP seeking redemption &#8211; but this only scratches the surface.</p>
<p>Dealing with difference creates complexity &#8211; this is a fundamental law of dealing with any system or network. Looking after Apache is simple, Apache + Passenger is quite simple, Apache + Passenger + MySQL is less simple, Apache + Passenger + MySQL + Memcached is less simple again. By the time you build up to a full application stack with reverse proxy caches, load balancers and the like &#8211; that ends up being a complex environment. In many cases, this is one of the main arguments against Rails for beginners &#8211; it is too complex, it has too many moving parts.</p>
<p>Certainly this can be an issue &#8211; if someone wants to learn Rails in order to put a one page static site on the Internet, then it is certain they have not understood why they might like to learn Rails, or indeed any web application framework. Within this kind of use subset, I certainly support the idea that Rails is not for beginners, but then again it is not for this kind of use either and thus is no co-incidence in the former being true as well. We, as programmers, only have ourselves to blame though for people believing that they need to learn more complex skills and frameworks for domain problems that are well and truly solved without them.</p>
<h4>We need to stop being snobby</h4>
<p><a href="http://cdn.jgwmaxwell.com/wp-content/uploads/2012/06/frontpage.jpg" rel="lightbox[16065221107]" title="Microsoft Frontpage box"><img class="alignleft size-medium wp-image-16065221114" title="Microsoft Frontpage box" src="http://cdn.jgwmaxwell.com/wp-content/uploads/2012/06/frontpage-240x300.jpg" alt="Microsoft Frontpage box" width="240" height="300" /></a>Much of the problem of these ill-advised beginners believing they need to explore Rails is in the general superior attitude and snobbery that we possess as a coding community. Possibly, it started with FrontPage and the identikit style that it produced. I&#8217;d feel smug if once again another problem could be placed at Redmond&#8217;s door<sup class='footnote'><a href='http://jgwmaxwell.com/rails-definitely-for-beginners-whatever-dhh-says/#fn-16065221107-2' id='fnref-16065221107-2' onclick='return fdfootnote_show(16065221107)'>2</a></sup>, their condoning and encouraging a lack of flair and original thought in FrontPage directly leading into those that knew better looking down on the work it produced. Certainly though, I have lost count of the times that I have heard (and sometimes made) disparaging comments about using Dreamweaver without understanding a thing of how the underlying technologies work. The general feeling amongst &#8216;serious&#8217; coders that if you aren&#8217;t developing with Emacs or Vim you aren&#8217;t really &#8216;getting it&#8217;<sup class='footnote'><a href='http://jgwmaxwell.com/rails-definitely-for-beginners-whatever-dhh-says/#fn-16065221107-3' id='fnref-16065221107-3' onclick='return fdfootnote_show(16065221107)'>3</a></sup> is another, smaller scale example.</p>
<p>In the case of those people who really just need a small, static site and some encouragement, this snobbery is not helpful. Telling a man who needs a manual on how to saw wood he needs to be using the latest industrial scale automatic logging device would be ridiculous, and in most industries and walks of life there is a grudging respect for those who do things the hard way. I am sure that anyone cutting down a tree with nothing but sweat, wheatabix and an axe will get respect &#8211; not someone laughing at them for hand-coding CSS rather than writing SASS or LESS.</p>
<p>It is our responsibility as a community to encourage those who have no need of the complexity of going deeper, and are likely to suffer for doing so, that they can achieve what they want with simple tools. Learning Rails won&#8217;t suddenly make a website look any good, nor find visitors and pageviews. If people shouldn&#8217;t be beginners, we should ensure that they feel valued and proud of the level they need to be at.</p>
<h4>The other fish in the Sea</h4>
<p>Having ruled out those who shouldn&#8217;t be here, we get left with the rest. At this point, realism starts to bite as there are broadly three classes who remain &#8211; those that can&#8217;t, those that won&#8217;t and those that might. I&#8217;ll discuss each of these in turn.</p>
<h4>Those that can&#8217;t</h4>
<p>Unfortunately, not all of us are equal &#8211; it&#8217;d be lovely if we were, but it&#8217;s not true<sup class='footnote'><a href='http://jgwmaxwell.com/rails-definitely-for-beginners-whatever-dhh-says/#fn-16065221107-4' id='fnref-16065221107-4' onclick='return fdfootnote_show(16065221107)'>4</a></sup>. Some people are not born to be web application developers &#8211; either through ability or available time &#8211; and that&#8217;s ok &#8211; it doesn&#8217;t even mean they can&#8217;t come to the party. There are some fantastic tools such as <a title="SquareSpace website" href="http://www.squarespace.com" target="_blank">SquareSpace</a> which lower the boundary to having a reasonably custom web presence, and for some people this is the kind of developing that they should be doing &#8211; it&#8217;s enjoyable, productive, and can end up with phenomenal results. It takes a level of intellect to get to grips with the <em>enormity</em> of the task of building a web application &#8211; from choosing the underlying technologies (RDBMS vs NoSQL), live web technologies (Goliath, Faye, learn Node, or pay a company like Pusher?) to considering caching patterns to ensure responsiveness for users &#8211; there is a lot you need to know, regardless of which language you choose, and unfortunately you need to understand it too. Using a tool, like SquareSpace or iWeb shouldn&#8217;t be derided &#8211; they are viable options for many many people who want to be part of the Internet, but don&#8217;t have either the intellect, or even the time to get to grips with the technologies needed to code your own. Here, yeah &#8211; Rails is not for these beginners, but no Framework is &#8211; the responsible approach is to guide them into a more suitable channel.</p>
<h4>Those that won&#8217;t</h4>
<p>Some people have enough intellect, have enough time, and even have enough inclination to learn how to use Rails &#8211; normally with some dream of writing a new social networking site that will make them rich. And that&#8217;s where it stops with these beginners for Rails as they will never learn &#8211; they aren&#8217;t trying to learn to use Rails, they are trying to reach some end result without caring how they get there. These beginners are the problem ones, and the ones that really most of the people who say that Rails isn&#8217;t for beginners are seeing and railing<sup class='footnote'><a href='http://jgwmaxwell.com/rails-definitely-for-beginners-whatever-dhh-says/#fn-16065221107-5' id='fnref-16065221107-5' onclick='return fdfootnote_show(16065221107)'>5</a></sup> against. Nobody who builds houses only knows which bits go where &#8211; no brickie can only tell you which shape brick he will use. To become accomplished in a trade or skill, you have to have a desire to understand &#8220;why&#8221; rather than &#8220;what&#8221;, and fixating on the &#8220;what&#8221; with Rails will bite you in the arse very quickly.</p>
<p>There are thousands of Stack Overflow posts, or Rails forum posts, or IRC messages that just want solutions to relatively basic Rails problems, without the posters wanting to take the time to understand why they are in trouble. Ultimately, I could categorise <em>those that won&#8217;t</em> very simply &#8211; do they google for their problem before asking for help? If they don&#8217;t then yeah, sure,  Rails isn&#8217;t for them.</p>
<h4>Those that might</h4>
<p>Here, this is the crux of it though &#8211; those that might. People with enough intellect, time, energy and a <em>desire to learn</em>. For those beginners, who genuinely want to master a new technology, then it is imperative that they are encouraged to adopt the best techniques and most cutting-edge practices; this industry moves too fast not to. This is where Rails, more than any other framework, is the right choice for beginners &#8211; by being, to quote @DHH again:</p>
<blockquote class="twitter-tweet" width="550"><p>@<a href="https://twitter.com/sryche">sryche</a> Rails was never primarily about being friendly to beginners. We encourage improvement and for people to live up to the state-of-art.</p>
<p>&mdash; DHH (@dhh) <a href="https://twitter.com/dhh/status/141963768807694336">November 30, 2011</a></p></blockquote>
<p><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script></p>
<p>Rails sets itself as the gold medal target for learning &#8211; learn Rails, and you&#8217;ll be ahead of 95%<sup class='footnote'><a href='http://jgwmaxwell.com/rails-definitely-for-beginners-whatever-dhh-says/#fn-16065221107-6' id='fnref-16065221107-6' onclick='return fdfootnote_show(16065221107)'>6</a></sup> of developers in your outlook, and preparedness for the approaching trends of the Internet. I came to Ruby web development from PHP, and when flicking back every now and then I am amazed by how backward it seems. I don&#8217;t want to TROLL the PHP community &#8211; it&#8217;s a very capable language, and achieves lots of good things, but it hasn&#8217;t moved with the times, probably through its fragmentation into the 35million different frameworks on offer. Things such as the asset pipeline have no match in PHP-land, or even in the rest of Ruby web development, but they are the future &#8211; for example consolidated, efficient asset handling promotes quality, robust front-end code.</p>
<p>If you are going to learn, learn the best &#8211; as anything else is a false economy, and a waste of your time.</p>
<h3>It will be hard</h3>
<p>Don&#8217;t get me wrong &#8211; I agree with many people who say that Rails is very hard for a beginner to learn and understand. In fact I gave up learning it, the very first time I tried (back in early 1.x), due to it not making much sense coming from spaghetticode PHP. I can totally agree with people saying that the newest functions and features further increase the learning curve too. Well, what do beginners expect? It to be a walk in the park? With a decent grounding in Ruby, such as following Why&#8217;s guide, and blitzing through the Ruby Koans, you could expect to be in a position to grapple with Rails as a complete beginner to Ruby web development. Yes, Sinatra possibly might seem more approachable and easier to &#8220;learn&#8221;, but what do you really learn by doing this?</p>
<p></p><pre class="crayon-plain-tag">require 'rubygems'
require 'sinatra'

get '/' do
&quot;#{Time.now}&quot;
end</pre><p></p>
<p>And then running <code>ruby yourfile.rb</code>? Yes, it is essentially a dynamic web application, yes it is awesomely simple &#8211; but learning how to make Sinatra run a blog application with several resources (Posts, Categories, Tags, Authors, etc) and an Admin area &#8211; that&#8217;s really rather harder &#8211; in fact it&#8217;s a lot harder to write a Sinatra CRUD application and tie it all together than it is to learn how to do the same in Rails.</p>
<h4>Maybe it&#8217;s not all that hard</h4>
<p>A lot of this comes down to snobbery again &#8211; &#8216;scaffolding is evil&#8217; is a normal refrain amongst experienced developers, and in many ways it can be, and certainly can lead to bad habits, but really &#8211; for a beginner &#8211; is it?</p>
<p><code>rails g scaffold post title byline body:text</code> gets you an awfully long way, and more importantly writes some decent code to learn from as a beginner &#8211; what better way to learn how to respond to request types than to actually see a respond_to block? Yes, ultimately hand crafting controllers and models is preferable, but when talking about beginners, it&#8217;s really important to remember that there can be steps to wisdom.</p>
<h3>Finally</h3>
<p>Ultimately, the question of whether Rails is for beginners or not comes down to this: do we want new developers pushing old techniques and slowing the adoption of new practices, or do we want the next developers to believe in best practices and are agents for change? Rails may have reached widespread adoption and acceptance, but it still disrupts. Surely we need to encourage beginners to buy in to this, not the old ways?</p>
<p>Actually, it turns out I was wrong &#8211; @dhh is actually explaining why Rails is the <em>only</em> choice for beginners when he said Rails sets out to &#8220;encourage improvement and for people to live up to the state-of-art&#8221;. After all, these should be the only criteria when choosing an ideal framework for beginners.</p>
<hr />
<p>&nbsp;</p>
<p><a href="http://jgwmaxwell.com/rails-definitely-for-beginners-whatever-dhh-says/">Rails is definitely FOR beginners, whatever @DHH says</a></p>]]></content:encoded>
			<wfw:commentRss>http://jgwmaxwell.com/rails-definitely-for-beginners-whatever-dhh-says/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You know a language is Object Oriented when&#8230;</title>
		<link>http://jgwmaxwell.com/you-know-language-object-oriented-when/</link>
		<comments>http://jgwmaxwell.com/you-know-language-object-oriented-when/#comments</comments>
		<pubDate>Thu, 14 Jun 2012 00:04:55 +0000</pubDate>
		<dc:creator>JGW Maxwell</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[OO]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ruby Koans]]></category>
		<category><![CDATA[SpaghettiCode]]></category>

		<guid isPermaLink="false">http://jgwmaxwell.com/?p=16065221096</guid>
		<description><![CDATA[<p><p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>I was just browsing the Ruby Koans project, considering whether to recommend it to a friend who ia interested in learning to how to programme, and two things struck me. Firstly &#8211; it&#8217;s a fantastic way for beginners to learn some of the inner workings of the language &#8211; check it out if you haven&#8217;t already. Secondly, it&#8217;s a brilliant reminder of how pure and deep the Object Oriented nature of Ruby is. I&#8217;ve been writing some PHP code recently, and the PHP adoption of OO principles has improved a lot of late, but it still feels like a sticking plaster over a broken leg &#8211; some visual cues of attention and improvement, but can&#8217;t really walk on it. Coming back to Ruby, even simple Ruby like this, is always a delight and a joy. I wish that more programmers would give it a go &#8211; both Object Oriented code <a class="moretag" href="http://jgwmaxwell.com/you-know-language-object-oriented-when/">Read more...</a></p></p><p><a href="http://jgwmaxwell.com/you-know-language-object-oriented-when/">You know a language is Object Oriented when&#8230;</a></p>]]></description>
				<content:encoded><![CDATA[<p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>I was just browsing the Ruby Koans project, considering whether to recommend it to a friend who ia interested in learning to how to programme, and two things struck me. Firstly &#8211; it&#8217;s a fantastic way for beginners to learn some of the inner workings of the language &#8211; <a title="Ruby Koans project" href="http://rubykoans.com" target="_blank">check it out if you haven&#8217;t already</a>. Secondly, it&#8217;s a brilliant reminder of how pure and deep the Object Oriented nature of Ruby is. I&#8217;ve been writing some PHP code recently, and the PHP adoption of OO principles has improved a lot of late, but it still feels like a sticking plaster over a broken leg &#8211; some visual cues of attention and improvement, but can&#8217;t really walk on it. Coming back to Ruby, even simple Ruby like this, is always a delight and a joy.</p>
<p>I wish that more programmers would give it a go &#8211; both Object Oriented code in general, and Ruby in particular &#8211; it is such an enlightening experience. I started out nearly a decade ago by weaving bits of SpaghettiCode PHP and attempting to make it continue to comply to my will as the programmes got larger and larger. I think that my development and learning curve was significantly slowed due to the frustration of attempting to manage these monsters. It took quite some time (and cursing at <a title="CodeIgniter PHP Framework" href="http://codeigniter.com" target="_blank">CodeIgniter</a>), before I was prepared to start buying into the advantages of OO code. I think every smart developer has a certain tendency to rail against the machine &#8211; feeling that they don&#8217;t need the help and can do it just fine, until they discover writing Object Oriented code actually makes you better, rather than holding you back. I&#8217;ve read some interesting posts recent on why Rails isn&#8217;t for beginners, and I couldn&#8217;t disagree more, but I&#8217;ll save that for another post and leave you with this sample from the Ruby Koans project, which got me started thinking about this:</p>
<p></p><pre class="crayon-plain-tag">class AboutObjects &amp;lt; EdgeCase::Koan
def test_everything_is_an_object
assert_equal true, 1.is_a?(Object)
assert_equal true, 1.5.is_a?(Object)
assert_equal true, &quot;string&quot;.is_a?(Object)
assert_equal true, nil.is_a?(Object)
assert_equal true, Object.is_a?(Object)
end
end</pre><p></p>
<p><a href="http://jgwmaxwell.com/you-know-language-object-oriented-when/">You know a language is Object Oriented when&#8230;</a></p>]]></content:encoded>
			<wfw:commentRss>http://jgwmaxwell.com/you-know-language-object-oriented-when/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make a Ruby Gem and enter the Gemsphere</title>
		<link>http://jgwmaxwell.com/build-ruby-gem-enter-gemsphere/</link>
		<comments>http://jgwmaxwell.com/build-ruby-gem-enter-gemsphere/#comments</comments>
		<pubDate>Fri, 08 Jun 2012 09:31:10 +0000</pubDate>
		<dc:creator>JGW Maxwell</dc:creator>
				<category><![CDATA[Making a Gem]]></category>
		<category><![CDATA[bundler]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[rubygem]]></category>

		<guid isPermaLink="false">http://jgwmaxwell.com/?p=16065221039</guid>
		<description><![CDATA[<p><p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>Introduction Getting Started Building Features Making it work Introduction At some point in every Ruby developer&#8217;s career there comes a stage where there is a need to reuse code on a large scale. Certainly using a good snippet system in your code editor can go a long way &#8211; inserting bits here and there. After 3, 5, 10 projects this becomes a nightmare to maintain &#8211; remembering which ones you haven&#8217;t updated1. The best way to recycle code is to make a ruby gem, and then include it in your applications in your to get the functionality. It is amazingly easy to get started building a gem, and there are many reasons apart from code management why you might like to do so. Arguably the biggest reason for this is that doing so, and opening your gem up through github (or one of the other options such as bitbucket or <a class="moretag" href="http://jgwmaxwell.com/build-ruby-gem-enter-gemsphere/">Read more...</a></p></p><p><a href="http://jgwmaxwell.com/build-ruby-gem-enter-gemsphere/">Make a Ruby Gem and enter the Gemsphere</a></p>]]></description>
				<content:encoded><![CDATA[<p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><ol>
<li><a class="anchor" title="Introduction" data-anchor="introduction">Introduction</a></li>
<li><a class="anchor" title="Getting Started" data-anchor="getting-started">Getting Started</a></li>
<li><a class="anchor" title="Building features" data-anchor="building-features">Building Features</a></li>
<li><a class="anchor" title="Making it work" data-anchor="making-it-work">Making it work</a></li>
</ol>
<h3><a name="introduction"></a>Introduction</h3>
<p>At some point in every Ruby developer&#8217;s career there comes a stage where there is a need to reuse code on a large scale. Certainly using a good snippet system in your code editor can go a long way &#8211; inserting bits here and there. After 3, 5, 10 projects this becomes a nightmare to maintain &#8211; remembering which ones you haven&#8217;t updated<sup class='footnote'><a href='http://jgwmaxwell.com/build-ruby-gem-enter-gemsphere/#fn-16065221039-1' id='fnref-16065221039-1' onclick='return fdfootnote_show(16065221039)'>1</a></sup>. The best way to recycle code is to make a ruby gem, and then include it in your applications in your <pre class="crayon-plain-tag">Gemfile</pre> to get the functionality.</p>
<p>It is amazingly easy to get started building a gem, and there are many reasons apart from code management why you might like to do so. Arguably the biggest reason for this is that doing so, and opening your gem up through <a title="Github - Hosted Git Repositories" href="https://github.com" target="_blank">github</a> (or one of the other options such as <a title="BitBucket" href="http://bitbucket.org" target="_blank">bitbucket</a> or <a title="Beanstalk App" href="http://beanstalkapp.com/" target="_blank">beanstalk</a>) brings the possibility of collaboration with others. This can lead to contributions to your code, helping people &#8216;scratch an itch&#8217;, and possibly your small piece of code could develop into a major tool for the whole Ruby community. Every great project starts somewhere, so, interested? Let&#8217;s begin.</p>
<h3><a name="getting-started"></a>Getting Started</h3>
<p>There are a few tools you can use to ease the creation and maintenance of a gem, but inarguably<sup class='footnote'><a href='http://jgwmaxwell.com/build-ruby-gem-enter-gemsphere/#fn-16065221039-2' id='fnref-16065221039-2' onclick='return fdfootnote_show(16065221039)'>2</a></sup> the best choice is to use Bundler. Bundler does so many things more than just running <pre class="crayon-plain-tag">bundle install</pre>, and that often comes as a surprise. So, lets get all the things that we need together:</p>
<ul>
<li>Ruby installed (obviously), and right now there shouldn&#8217;t be any reason not to be running on 1.9.3 if you are on MRI ruby &#8211; it&#8217;s battle ready, and massively speeds up development.</li>
<li>Bundler installed. This happens by default if you use RVM to manage your Rubies, or just run <em>gem install bundler</em> if it isn&#8217;t there already.</li>
<li>Somewhere to put the gem &#8211; I use <pre class="crayon-plain-tag">~/ruby/gems/GEMNAME</pre> to store my gems, so if want to create a new directory, do so now.</li>
</ul>
<p>Ok, now we&#8217;ve got everything ready, we can start building a gem. you&#8217;re going to need a cool, catchy, original name for you gem, one that has a certain air of distinction, that sounds superior. It is worth <a title="Naming Patterns on Rubygems.org" href="http://guides.rubygems.org/patterns/#consistent-naming" target="_blank">reading this article</a> for more information on this. So we are going to use the fantastic name &#8220;dostuff&#8221; for this article &#8211; obviously you&#8217;ll need to choose your own and use that instead! Creating a gem with Bundler will create the new gem in a directory of the same name as you&#8217;ll choose for the gem, so if you get into the folder you want to create the gem inside, we&#8217;ll begin.<br />
<span id="more-16065221039"></span></p><pre class="crayon-plain-tag">~/ruby/gems$ bundle gem dostuff &amp;amp;&amp;amp; cd dostuff
~/ruby/gems/dostuff$ tree
.
├── dostuff.gemspec
├── Gemfile
├── lib
│&nbsp;&nbsp; ├── dostuff
│&nbsp;&nbsp; │&nbsp;&nbsp; └── version.rb
│&nbsp;&nbsp; └── dostuff.rb
├── LICENSE
├── Rakefile
└── README.md</pre><p></p>
<p>If you don&#8217;t have <pre class="crayon-plain-tag">tree</pre> installed on your system, don&#8217;t worry<sup class='footnote'><a href='http://jgwmaxwell.com/build-ruby-gem-enter-gemsphere/#fn-16065221039-3' id='fnref-16065221039-3' onclick='return fdfootnote_show(16065221039)'>3</a></sup> &#8211; it is only used here so you can see what files the command produces. Running <pre class="crayon-plain-tag">bundle gem xxx</pre> does a number of things:</p>
<ul>
<li>Generates the basic file structure for the gem</li>
<li>Creates an empty git repository in the gem directory</li>
<li>Writes an initial <em>gemspec</em> file</li>
<li>Sets up some brilliantly useful rake tasks (&#8220;rake release&#8221; is bliss, but more on that later)</li>
</ul>
<p>The most important file that has been created for us is the <em>dostuff.gemspec</em> file, which holds all of the configuration information for the gem. We can see what initial setup we&#8217;ve been given by Bundler:</p>
<p></p><pre class="crayon-plain-tag">~/ruby/gems/dostuff$ cat dostuff.gemspec
# -*- encoding: utf-8 -*-
require File.expand_path('../lib/dostuff/version', __FILE__)

Gem::Specification.new do |gem|
	gem.authors = [&quot;JGW Maxwell&quot;]
	gem.email = [&quot;jgwmaxwell@gmail.com&quot;]
	gem.description = %q{TODO: Write a gem description}
	gem.summary = %q{TODO: Write a gem summary}
	gem.homepage = &quot;&quot;

	gem.files = `git ls-files`.split($)
	gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
	gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
	gem.name = &quot;dostuff&quot;
	gem.require_paths = [&quot;lib&quot;]
	gem.version = Dostuff::VERSION
end</pre><p></p>
<p>This configuration file contains the information required by Rubygems and Bundler to make your gem work, and to attribute ownership and authorship. One of the benefits of using Bundler to manage and create the gem is that it comes with a great set of defaults that do make building the gem much simpler, but there are some caveats. The biggest of which is actually a git issue, but remember that if you delete a file which has been previously committed to the repo, you have to <em>git rm FILENAME</em> to get rid of the file from the repo as well. This is because the gem knows which files it includes by running a <em>git ls-files</em> in this line: <pre class="crayon-plain-tag">gem.files = `git ls-files`.split($)</pre></p>
<p>Ok so, we have the skeleton of the gem, now we need to configure it and make it do things. You are welcome to follow the basic code below, to end up with a gem that does nothing of any use whatsoever, or add some of your own code instead.</p>
<h3><a name="building-features"></a>Building features</h3>
<p>So, for the purpose of this guide, we are going to give the gem a function that translates any string to Pirate speak (&#8220;Arrrrrr&#8221;). There is a basic web API for Pirate speak online at <a title="isithackday.com Pirate API" href="http://isithackday.com/arrpi.php" target="_blank">http://isithackday.com/arrpi.php</a>. The API takes a string and returns a Pirate speak string, so it seems ideal that we should mixin this functionality to <a title="Ruby API Docs - String Class" href="http://ruby-doc.org/core-1.9.3/String.html" target="_blank">Ruby&#8217;s String class</a> so we can just call <pre class="crayon-plain-tag">#to_pirate</pre> on things we need to make, well, Pirate-y. Before we do this, we should probably fill out the TODO sections in the <em>gemspec</em> as we will get error messages later if they aren&#8217;t updated.</p>
<p>To add features, the basic hierarchy is that the <em>gemspec</em> adds the <em>lib/</em> directory to the require path, and when you require the gem, it will pick up the file in that directory named after the gem &#8211; in my case <em>dostuff.rb</em>. In most gems, these base level files serve as little more than vessels for requiring other functionality, stored deeper within the gem. So, we will add a new file to hold the function that we need, making the structure look like this: </p><pre class="crayon-plain-tag">lib
├── dostuff
│&nbsp;&nbsp; ├── pirate.rb
│&nbsp;&nbsp; └── version.rb
└── dostuff.rb</pre><p></p>
<p>In <em>pirate.rb</em> we will add the functionality for translating strings to Pirate  speak. This only needs to be a single method:</p>
<p></p><pre class="crayon-plain-tag">require 'net/http'
require 'uri'

module Dostuff
	module Pirate
		def to_pirate
			uri = URI.parse(&quot;http://isithackday.com/arrpi.php?text=&quot;+URI.escape(self))
			return Net::HTTP.get_print(uri)
		end
	end
end</pre><p></p>
<p>This is dead simple, just a <pre class="crayon-plain-tag">#to_pirate</pre> method call which calls <pre class="crayon-plain-tag">URI#parse</pre> on the string, then gets back the response from the API and returns it. In order to get this to work now, we have to add it to String &#8211; the global class that each and every string is an instance of. This concept of retroactively fitting functionality outside of the initial domain to an application is often known as <em>Monkey patching</em>, and is normally regarded as a bad thing &#8211; it is introduces another level of brittleness in an application, as all changes to the underlying technology (be it Ruby, Rails, Sinatra or something altogether different) potentially can break the monkeypatch. It is generally accepted that where an alternative approach isn&#8217;t feasible then it&#8217;s ok to do it &#8211; and that should be the guiding principle.</p>
<p>So, we can test this now by firing up an IRB session and checking on our process. Instead of just running <em>irb</em>, we are going to use Bundler to fire up the console &#8211; this makes it easier to check the functionality within our gem. So, from a command line in the root of your gem folder, run the following commands:</p><pre class="crayon-plain-tag">~/ruby/gems/dostuff$ bundle console
1.9.3p194 :001 &amp;gt; String.class_eval(&quot;include Dostuff::Pirate&quot;)
=&amp;gt; String
1.9.3p194 :002 &amp;gt; &quot;yes, this is indeed pirate talk&quot;.to_pirate
yarr, this be indeed pirate talk =&amp;gt; nil</pre><p></p>
<h3><a name="making-it-work"></a>Making it work</h3>
<p>Ok, so we have a working way of talking to Pirates, but what happened in that first line of code? <code>String.class_eval("include Dostuff::Pirate")</code> This is a simple way of including functionality within another class that we don&#8217;t have direct access to &#8211; obviously we don&#8217;t want to open up the entire of the Ruby codebase just to add an <em>include</em> statement. The way around this is metaprogramming, code programmatically changing the functionality of other code to achieve a desired effect. Ruby is arguably the ultimate metaprogramming language, classes never are closed, multiple ways of including, extending and requiring things, but that is beyond the scope of this article.</p>
<p>Obviously we don&#8217;t want to have to issue that <pre class="crayon-plain-tag">#class_eval</pre> line every time that we want to talk like a Pirate, so we are going to need to have a way to automatically run that code for us. Fortunately, Ruby comes to the rescue here again, and doing so is as simple as changing the main <pre class="crayon-plain-tag">lib/dostuff.rb</pre> file to the following:</p>
<p></p><pre class="crayon-plain-tag">require &quot;dostuff/version&quot;
require &quot;dostuff/pirate&quot;
module Dostuff
  # Public: Includes Dostuff::Pirate into String to enable String#to_pirate
  String.class_eval(&quot;include Dostuff::Pirate&quot;)
end</pre><p></p>
<p>Because the this file is parsed whenever the gem is required anywhere, the same metaprogramming technique we used just before works beautifully here again. If you want to check it, you can fire up an IRB session again:</p>
<p></p><pre class="crayon-plain-tag">~/ruby/gems/dostuff$ bundle console
1.9.3p194 :001 &gt; &quot;hello my friend&quot;.to_pirate
ahoy my mate =&gt; nil</pre><p></p>
<p>Success! The final thing to do is to bundle it up as a gem and release it so it is easy to use in future. At this point it is important to remind people that if you follow the next steps, your code will be out in public, and anybody could install it. If you need to keep code private, only follow the first part of this.</p>
<p>Firstly, we need to top our git repo up with the latest code. Doing so (if you aren&#8217;t familiar with git) is as simple as doing </p><pre class="crayon-plain-tag">~/ruby/gems/dostuff$ git add .
~/ruby/gems/dostuff$ git commit -m &quot;initial commit - make String talk #to_pirate&quot;
[master (root-commit) 2f48a37] initial commit - make String talk #to_pirate
 9 files changed, 111 insertions(+), 0 deletions(-)
 create mode 100644 .gitignore
 create mode 100644 Gemfile
 create mode 100644 LICENSE
 create mode 100644 README.md
 create mode 100644 Rakefile
 create mode 100644 dostuff.gemspec
 create mode 100644 lib/dostuff.rb
 create mode 100644 lib/dostuff/pirate.rb
 create mode 100644 lib/dostuff/version.rb</pre><p></p>
<p>Then, you can just run <pre class="crayon-plain-tag">rake install</pre> to install your gem locally. This will build the gem package from the files, and install it wherever your gems are kept on your machine. If this happens</p>
<p></p><pre class="crayon-plain-tag">~/ruby/gems/dostuff$ rake install
rake aborted!
ERROR:  While executing gem ... (Gem::InvalidSpecificationException)
    &quot;FIXME&quot; or &quot;TODO&quot; is not a description

Tasks: TOP =&gt; install
(See full trace by running task with --trace)</pre><p></p>
<p>Then fortunately there is a really helpful explanation &#8211; telling us that we haven&#8217;t updated the <pre class="crayon-plain-tag">dostuff.gemspec</pre> file yet. Naughty &#8211; I told you to do that&#8230; After updating the file, remember to run the git commands again (<pre class="crayon-plain-tag">git add . &amp;&amp; git commit -m &quot;I made a silly&quot;</pre>) before you try to <pre class="crayon-plain-tag">rake install</pre>. If you&#8217;ve got it right, then you should see:</p>
<p></p><pre class="crayon-plain-tag">~/ruby/gems/dostuff$ rake install
dostuff 0.0.1 built to pkg/dostuff-0.0.1.gem
dostuff (0.0.1) installed</pre><p></p>
<p>Perfect, we can now use this gem in all kinds of different applications &#8211; wherever you want something to talk like a Pirate really! You can check this by trying a normal IRB session:</p>
<p></p><pre class="crayon-plain-tag">~/ruby/gems/dostuff$ irb
1.9.3p194 :001 &gt; &quot;hello my friend&quot;.to_pirate
NoMethodError: undefined method `to_pirate' for &quot;hello my friend&quot;:String
...
1.9.3p194 :002 &gt; require 'dostuff'
 =&gt; true 
1.9.3p194 :003 &gt; &quot;hello my friend&quot;.to_pirate
ahoy my mate =&gt; nil</pre><p></p>
<h3><a name="publishing-to-rubygems"></a>Entering the Gemsphere (or publishing it on Rubygems if you want to be prosaic)</h3>
<p>Ok, so if you don&#8217;t want your code to be &#8220;out there&#8221;, then you need to stop following now &#8211; congratulations, you&#8217;ve got a working gem! For those who want to be part of the community, take your next steps now&#8230;</p>
<p>You&#8217;re going to need two (free) accounts to finish the rest of this. One is for a public, web accessable git repository (such as github, others exist) to host the source code, the second is an account at <a href="http://rubygems.org" title="Rubygems.org" target="_blank">Rubygems.org</a> which will actually host the gem itself and make it available through <pre class="crayon-plain-tag">gem install dostuff</pre>. Ignore the next bit if you are already set up properly with github (or equivalent) and Rubygems.org!</p>
<p><a rel="nofollow"  href="http://cdn.jgwmaxwell.com/wp-content/uploads/2012/06/github_signup.png" title="Github signup form"><img src="http://cdn.jgwmaxwell.com/wp-content/uploads/2012/06/github_signup.png" alt="Github signup form" title="Github signup form" width="400" height="322" class="alignleft size-full wp-image-16065221075" /></a> Signing up for Github is easy, free if you don&#8217;t want any private repos to keep your code from prying eyes, and almost certainly a good thing to do for any developer. Head to <a rel="nofollow"  href="https://github.com/signup/free" title="github signup link" target="_blank">github.com/signup/free</a> to get an account, and then follow <a rel="nofollow"  href="https://help.github.com/articles/generating-ssh-keys" title="Github Instructions for setting up SSH" target="_blank">their instructions here</a> to get your computer setup with SSH keys properly &#8211; it will make your life a lot easier in the long run than trying to use HTTPS connections with git. At this point in time you need to create a new git repo on github, I&#8217;d strongly advise calling it the name of your gem. Once that is set up, you can follow the instructions on the new repository page that github provides, which for us essentially boils down to running <pre class="crayon-plain-tag">git remote add origin git@github.com:YOURUSERNAME/GEMNAME.git</pre> to link your local repo to the github one. Finally, we need to run <pre class="crayon-plain-tag">git push origin master</pre> which will link our rake task to the master branch of the repo.</p>
<p>Next step is to make sure you are registered at <a rel="nofollow"  href="http://rubygems.org/users/new" title="Rubygems.org">Rubygems.org</a>, <a rel="nofollow"  href="http://cdn.jgwmaxwell.com/wp-content/uploads/2012/06/rubygems-signup.png" title="Rubygems.org signup form"><img src="http://cdn.jgwmaxwell.com/wp-content/uploads/2012/06/rubygems-signup.png" alt="Rubygems.org signup form" title="Rubygems.org signup form" width="300" height="312" class="alignright size-full wp-image-16065221078" /></a> and then login on your local machine by running <pre class="crayon-plain-tag">gem push</pre> from a command prompt and following the instructions. This is likely to throw some kind of &#8216;there isn&#8217;t a real gem here&#8217; kind of error message, don&#8217;t worry &#8211; we can now push the gem to the net. </p>
<p>This is, I always feel, a great anticlimax as part of the process of developing gems. There should be more pomp and circumstance involved in publishing a gem than simply issuing a two word command, but I suppose we can leave that for Java programmers and get on with being Rubyists. To send your gem out to the world, just run <pre class="crayon-plain-tag">rake release</pre>. That&#8217;s it. That will build your gem again, push the code to the github repo, and then send your gem to rubygems. You can test this by running <pre class="crayon-plain-tag">gem uninstall dostuff</pre> to remove the local copy we just installed, and then installing it normally like any other gem &#8211; <pre class="crayon-plain-tag">gem install dostuff</pre> &#8211; after all, it now is just like any other gem.</p>
<p>Congratulations, you&#8217;ve just launched your first gem. One slight gotcha to avoid though &#8211; if you want to tweak the features, you&#8217;ll need to run <pre class="crayon-plain-tag">git add . &amp;&amp; git commit -m &quot;a message&quot; &amp;&amp; rake release</pre> to push it back to Rubygems. You have to edit <pre class="crayon-plain-tag">lib/dostuff/version.rb</pre> and tweak the version number up a notch before you do this, or you&#8217;ll get an error about already having pushed this tag.</p>
<p>There&#8217;ll be another post in this series soon looking at building a much more advanced gem, but I hope this gets you started nicely. Before I finish that though, you could have a think about tasks that need doing. Writing documentation &#8211; both inside the code for rdoc or ri and in the README file is essential for any Gem or coding project, this would be a good next step.</p>
<p><a href="http://jgwmaxwell.com/build-ruby-gem-enter-gemsphere/">Make a Ruby Gem and enter the Gemsphere</a></p>]]></content:encoded>
			<wfw:commentRss>http://jgwmaxwell.com/build-ruby-gem-enter-gemsphere/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sextant shows Rails Routes in browser, and Puma gets a snarly performance upgrade</title>
		<link>http://jgwmaxwell.com/sextant-rails-routes-browser-puma-performance-upgrade/</link>
		<comments>http://jgwmaxwell.com/sextant-rails-routes-browser-puma-performance-upgrade/#comments</comments>
		<pubDate>Thu, 07 Jun 2012 17:41:38 +0000</pubDate>
		<dc:creator>JGW Maxwell</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Puma]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Sextant]]></category>

		<guid isPermaLink="false">http://jgwmaxwell.com/?p=16065221011</guid>
		<description><![CDATA[<p><p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>Sextant I noticed Sextant first on the Changelog a couple of weeks back, and thought it might be useful &#8211; a gem to give you your routes in the browser. After all, waiting for Rake to fire up Rails just to spew out its routes is painful. Then it gets doubly painful when you realise that your tiny shell window has mangled the text into an unreadable state (yes, even with 2&#215;24&#8243; screens you still never have enough screen area), so you resize, fire rake routes off again, wait&#8230; etc &#8211; it is one of the things I hate most about developing in Rails. Instead, you can use Sextant &#8211; it gives you a simple display of all your Rails routes (just like running rake routes) in the web browser, instantly (or as fast as your Puma can carry you). In large applications this can offer a ridiculous performance increase <a class="moretag" href="http://jgwmaxwell.com/sextant-rails-routes-browser-puma-performance-upgrade/">Read more...</a></p></p><p><a href="http://jgwmaxwell.com/sextant-rails-routes-browser-puma-performance-upgrade/">Sextant shows Rails Routes in browser, and Puma gets a snarly performance upgrade</a></p>]]></description>
				<content:encoded><![CDATA[<p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><h3>Sextant</h3>
<p>I noticed <a title="Sextant - github link" href="https://github.com/schneems/sextant" target="_blank">Sextant</a> first on <a title="Sextant - View your Rails Routes without waiting on Rake" href="http://thechangelog.com/post/23545302399/sextant-view-your-rails-routes-without-waiting-on-rake" target="_blank">the Changelog</a> a couple of weeks back, and thought it might be useful &#8211; a gem to give you your routes in the browser. After all, waiting for Rake to fire up Rails just to spew out its routes is painful. Then it gets doubly painful when you realise that your tiny shell window has mangled the text into an unreadable state (yes, even with 2&#215;24&#8243; screens you still never have enough screen area), so you resize, fire <em>rake routes</em> off again, wait&#8230; etc &#8211; it is one of the things I hate most about developing in Rails.</p>
<p><a rel="nofollow"  href="http://cdn.jgwmaxwell.com/wp-content/uploads/2012/06/sextant-ruby-gem-for-rails-routes2.png" title="Sextant - Rubygem for Rails routes"><img class="alignleft size-full wp-image-16065221017" title="Sextant - Rubygem for Rails routes" src="http://cdn.jgwmaxwell.com/wp-content/uploads/2012/06/sextant-ruby-gem-for-rails-routes2.png" alt="Sextant - Rubygem for Rails routes" width="412" height="365" /></a>Instead, you can use Sextant &#8211; it gives you a simple display of all your Rails routes (just like running <em>rake routes</em>) in the web browser, instantly (or as fast as your <a class="anchor" data-anchor="puma">Puma</a> can carry you). In large applications this can offer a ridiculous performance increase for developers, as it can take a huge amount of time for Rails to initialise all of the required classes (4+ minutes on MRI 1.9.3p194 for one of my Applications).</p>
<p>If someone would adapt a similar approach for Rails generators that would be truly fantastic, as again running <em>rails g</em> takes a lot of time in a big application. Maybe this could all be bundled together behind a nice Sinatra front end for development mode? If anyone beats me to writing that then please let me know, I&#8217;d love to use it!</p>
<p>Anyway, I&#8217;m sure you are wondering how to use this gem. Turns out it is deeply complicated, using one whole line of code to achieve. In your <em>Gemfile</em> (preferably in a :development group, as below &#8211; you don&#8217;t want this out there live in production!) just add </p><pre class="crayon-plain-tag">gem 'sextant'</pre><p> and run <em>bundle install</em> to get it all sorted. Reboot your server and go to <strong>/rails/routes</strong> to see all your roots laid out.</p>
<p>Hats off to <a title="Richard Schneeman Twitter" href="http://twitter.com/schneems" target="_blank">Richard Schneeman</a> for a great gem, and if anyone knows of any other similarly useful tools then let me know.</p>
<h3><a name="puma"></a>Puma</h3>
<p>I tested Puma as part of a large benchmark of different Ruby application servers a few months ago, and was underwhelmed with the results back then. It seemed like it had a lot of potential, but was wildly inconsistent <a rel="nofollow"  href="http://cdn.jgwmaxwell.com/wp-content/uploads/2012/06/puma.jpg" title="Puma - a modern, high speed Ruby web server"><img class="size-full wp-image-16065221020 alignright" title="Puma - a modern, high speed Ruby web server" src="http://cdn.jgwmaxwell.com/wp-content/uploads/2012/06/puma.jpg" alt="Puma - a modern, high speed Ruby web server" width="500" height="196" /></a>about when it showed. That was 0.9.8, but things have changed, the version is now 1.3.1 and the story has been rewritten.</p>
<p>There are some massive claims made on the <a title="Puma Website" href="http://puma.io" target="_blank">Puma website</a> and I&#8217;m not going to attempt to verify their benchmarks now (although there&#8217;s going to be news on that front soon), but given the calibre of people behind the project it is only going to be a matter of time until they have it smoking fast. Even from last time, the difference is noticeable and immediate, even in development mode on Rails 3.2.x &#8211; everything just feels a little snappier than it did under Unicorn. Probably most importantly though is the memory overhead they are advertising &#8211; it&#8217;s astonishingly low. On the app I&#8217;m developing at the moment it&#8217;s consistently 30meg less than Thin, which if you are running on a service like Heroku is really useful (as each dyno<sup class='footnote'><a href='http://jgwmaxwell.com/sextant-rails-routes-browser-puma-performance-upgrade/#fn-16065221011-1' id='fnref-16065221011-1' onclick='return fdfootnote_show(16065221011)'>1</a></sup> is capped to 512mb).</p>
<p>I&#8217;d encourage anyone and everyone to give Puma a good shot at the moment &#8211; it works well on MRI 1.9.3, but it&#8217;s really designed for Rubinius or JRuby &#8211; as then it can utilise its strong support for concurrency to much better effect<sup class='footnote'><a href='http://jgwmaxwell.com/sextant-rails-routes-browser-puma-performance-upgrade/#fn-16065221011-2' id='fnref-16065221011-2' onclick='return fdfootnote_show(16065221011)'>2</a></sup>. Using it is as simple as whacking <em>gem &#8216;puma&#8217;</em> in the Gemfile, and then running </p><pre class="crayon-plain-tag">$ puma</pre><p> on the command line to fire up Rails/Sinatra/whatever-rack-based-framework-you-fancy.</p>
<hr />
<p><a href="http://jgwmaxwell.com/sextant-rails-routes-browser-puma-performance-upgrade/">Sextant shows Rails Routes in browser, and Puma gets a snarly performance upgrade</a></p>]]></content:encoded>
			<wfw:commentRss>http://jgwmaxwell.com/sextant-rails-routes-browser-puma-performance-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reloading Grape::API applications in development</title>
		<link>http://jgwmaxwell.com/reloading-grape-api-development/</link>
		<comments>http://jgwmaxwell.com/reloading-grape-api-development/#comments</comments>
		<pubDate>Sun, 03 Jun 2012 00:21:51 +0000</pubDate>
		<dc:creator>JGW Maxwell</dc:creator>
				<category><![CDATA[Hints & Tips]]></category>
		<category><![CDATA[Grape::API]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://jgwmaxwell.com/?p=16065220986</guid>
		<description><![CDATA[<p><p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>Grape::API1 is an awesome tool for building APIs in Ruby &#8211; it&#8217;s quick 2 and has a nice DSL with some lovely features. One major issue with it comes whilst developing the application &#8211; there is no built in reloading of classes, and whilst there are a couple of threads about implementing reloading3, there&#8217;s no progress as yet. Fortunately, Grape is Rack-based, which allows us to use Shotgun4 as a development server, which handles reloading for us. Simply add a to your Gemfile to give yourself a copy of Shotgun in development mode, run and then you&#8217;ll be able to start your app by running Visit http://localhost:9393/[your path here], make some changes and refresh to see your changes working, and a major headache gone!</p></p><p><a href="http://jgwmaxwell.com/reloading-grape-api-development/">Reloading Grape::API applications in development</a></p>]]></description>
				<content:encoded><![CDATA[<p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>Grape::API<sup class='footnote'><a href='http://jgwmaxwell.com/reloading-grape-api-development/#fn-16065220986-1' id='fnref-16065220986-1' onclick='return fdfootnote_show(16065220986)'>1</a></sup> is an awesome tool for building APIs in Ruby &#8211; it&#8217;s quick <sup class='footnote'><a href='http://jgwmaxwell.com/reloading-grape-api-development/#fn-16065220986-2' id='fnref-16065220986-2' onclick='return fdfootnote_show(16065220986)'>2</a></sup> and has a nice DSL with some lovely features. One major issue with it comes whilst developing the application &#8211; there is no built in reloading of classes, and whilst there are a couple of threads about implementing reloading<sup class='footnote'><a href='http://jgwmaxwell.com/reloading-grape-api-development/#fn-16065220986-3' id='fnref-16065220986-3' onclick='return fdfootnote_show(16065220986)'>3</a></sup>, there&#8217;s no progress as yet.</p>
<p>Fortunately, Grape is Rack-based, which allows us to use Shotgun<sup class='footnote'><a href='http://jgwmaxwell.com/reloading-grape-api-development/#fn-16065220986-4' id='fnref-16065220986-4' onclick='return fdfootnote_show(16065220986)'>4</a></sup> as a development server, which handles reloading for us. Simply add a </p><pre class="crayon-plain-tag">group :development do
gem 'shotgun'
end</pre><p> to your <em>Gemfile</em> to give yourself a copy of Shotgun in development mode, run </p><pre class="crayon-plain-tag">$ bundle install</pre><p> and then you&#8217;ll be able to start your app by running </p><pre class="crayon-plain-tag">$ shotgun</pre><p>Visit http://localhost:9393/[your path here], make some changes and refresh to see your changes working, and a major headache gone!</p>
<p><a href="http://jgwmaxwell.com/reloading-grape-api-development/">Reloading Grape::API applications in development</a></p>]]></content:encoded>
			<wfw:commentRss>http://jgwmaxwell.com/reloading-grape-api-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leaving Tumblr, Writing Again</title>
		<link>http://jgwmaxwell.com/leaving-tumblr-writing-again/</link>
		<comments>http://jgwmaxwell.com/leaving-tumblr-writing-again/#comments</comments>
		<pubDate>Thu, 31 May 2012 15:29:12 +0000</pubDate>
		<dc:creator>JGW Maxwell</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://jgwmaxwell.com/?p=16065220936</guid>
		<description><![CDATA[<p><p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>Well, after a couple of months away from writing, I&#8217;ve managed to find time to start again. Since the last post, a huge amount has gone on &#8211; both in terms of consulting and with my own Startup, and I&#8217;ll be sharing many of the lessons I&#8217;ve learned over that period of time. Additionally, it was long past time to abandon Tumblr as a hosting platform and move to something a little more serious, with a proper webhost. So, This is now running on WordPress &#8211; a platform I have been critical of in the past, but increasingly impressed by as a blogging engine of late. The Tumblr to WordPress migration is particularly simple, making me wonder why I didn&#8217;t do it a long time ago, although the import tool could be better at allocating posts to categories, and it could import pages as well, but I can&#8217;t complain too <a class="moretag" href="http://jgwmaxwell.com/leaving-tumblr-writing-again/">Read more...</a></p></p><p><a href="http://jgwmaxwell.com/leaving-tumblr-writing-again/">Leaving Tumblr, Writing Again</a></p>]]></description>
				<content:encoded><![CDATA[<p>From <a href="http://jgwmaxwell.com">JGW Maxwell</a></p><p>Well, after a couple of months away from writing, I&#8217;ve managed to find time to start again. Since the last post, a huge amount has gone on &#8211; both in terms of consulting and with my own Startup, and I&#8217;ll be sharing many of the lessons I&#8217;ve learned over that period of time. Additionally, it was long past time to abandon Tumblr as a hosting platform and move to something a little more serious, with a proper webhost. So, This is now running on WordPress &#8211; a platform I have been critical of in the past, but increasingly impressed by as a blogging engine of late.</p>
<p>The Tumblr to WordPress migration is particularly simple, making me wonder why I didn&#8217;t do it a long time ago, although the import tool could be better at allocating posts to categories, and it could import pages as well, but I can&#8217;t complain too much.</p>
<p>Cloudflare are still providing the distribution for the site, but now it&#8217;s running on <a title="MediaLayer" href="http://www.medialayer.com/" target="_blank">MediaLayer&#8217;s servers</a> (not an affiliate link!). I have to say I&#8217;ve been blown away by their customer support so far, as well as the responsiveness of their platform. I&#8217;d thoroughly recommend them from my dealings with them so far.</p>
<p>I wish that WordPress would break the bond to MySQL and look at using MongoDB instead &#8211; blogging a natural candidate for document databases, and the idea of only having to hit a couple of queries instead of the 50+ that WordPress can need must be worth it. Admittedly, WordPress isn&#8217;t as dreadful as Magento, but that is another story for another time&#8230;</p>
<p>Anyway, I&#8217;m looking forward to sharing some useful code with you all, but for now, so long.</p>
<p><a href="http://jgwmaxwell.com/leaving-tumblr-writing-again/">Leaving Tumblr, Writing Again</a></p>]]></content:encoded>
			<wfw:commentRss>http://jgwmaxwell.com/leaving-tumblr-writing-again/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
