<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Good Robot!</title>
 <link href="http://goodrobot.net/atom.xml" rel="self"/>
 <link href="http://goodrobot.net/"/>
 <updated>2012-01-14T08:07:09+00:00</updated>
 <id>http://goodrobot.net/</id>
 <author>
   <name>JD Cantrell</name>
   <email>jdcantrell@gmail.com</email>
 </author>

 
 <entry>
   <title>Camping with Ruby</title>
   <link href="http://goodrobot.net/2012/01/camping-with-ruby"/>
   <updated>2012-01-13T00:00:00+00:00</updated>
   <id>http://goodrobot.net/2012/01/camping-with-ruby</id>
   <content type="html">&lt;p&gt;I mentioned in my previous post, that I built my first Ruby project
using the Camping framework. I wanted to give some follow up information
about that because I think there are somethings about Camping
specifically that people new to Ruby or Camping would greatly benefit
from.&lt;/p&gt;

&lt;p&gt;Here is how to get up to speed with Camping:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Read the &lt;a href=&quot;https://github.com/camping/camping/blob/master/examples/blog.rb&quot;&gt;examples&lt;/a&gt; included with Camping&lt;/li&gt;
  &lt;li&gt;Don’t be afraid to read the &lt;a href=&quot;https://github.com/camping/camping/blob/master/lib/camping-unabridged.rb&quot;&gt;source&lt;/a&gt; to Camping. It’s quite friendly,
and the best resource for how things are accomplished.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://markaby.github.com/&quot;&gt;Markaby&lt;/a&gt; is the templating library&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://ar.rubyonrails.com/&quot;&gt;ActiveRecord&lt;/a&gt; is your ORM&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Camping is an amazingly brief amount code. In fact from what I can tell,
this is a main source of pride for the Camping devs. The uncommented
version is only 55 lines of code long. And even the commented version is
only 764 lines of code. There are two important points to draw from
this. First, if you want to know something about Camping the best
reference is the &lt;a href=&quot;https://github.com/camping/camping/blob/master/lib/camping-unabridged.rb&quot;&gt;unabridged
source&lt;/a&gt;.
The comments are extensive, and the code is very easy to follow.&lt;/p&gt;

&lt;p&gt;Secondly, Camping lets some other Ruby gems do the heavy lifting, which
means the documentation about templating(markaby) or ORM(ActiveRecord)
is very thin on the Camping site, but each have their own sites with
more useful documentation.  ActiveRecord is great because it is used in
many other Ruby frameworks.  Markaby is less used but once you get the
hang of overall idea, it is pretty much dead easy to use. Both of these
gems are popular enough that it is easy finding information on them if
you search for them specifically.&lt;/p&gt;

&lt;p&gt;Finally, now that I’ve had some time to think about this a bit. I really
like this framework. I will definitely consider using it again. There
were times in this project I thought I had made a bad choice on
frameworks due to popularity and ease of finding answers for other ones,
but this forced me to rely more on reading the Camping source code.
Which in turn, was a great thing to be forced into since I was using
&lt;a href=&quot;github.com/jdcantrell/luggage&quot;&gt;Luggage&lt;/a&gt; as a way to learn Ruby.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Bonus Round:&lt;/em&gt; Camping apps work great with Unicorn. Just remove the
ActiveRecord dis/connection in the before_fork and after_fork
functions from the example file and you’re good to go!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Luggage, a simple way to share files</title>
   <link href="http://goodrobot.net/2012/01/luggage-a-simple-way-share-files"/>
   <updated>2012-01-01T00:00:00+00:00</updated>
   <id>http://goodrobot.net/2012/01/luggage-a-simple-way-share-files</id>
   <content type="html">&lt;p&gt;A while ago I got pointed to &lt;a href=&quot;http://getcloudapp.com/&quot;&gt;CloudApp&lt;/a&gt;. It
is a pretty cool service that makes it easy to share files in the cloud.
They have a large number of handlers for different types of files so
that when you post images it looks good or if you post a source file it
gets syntax highlighted. It even renders markdown. The free service is
somewhat limited, but for my low usage it was more than adequate.&lt;/p&gt;

&lt;p&gt;As much as I like CloudApp, I wanted something I could put on my own domain.
CloudApp does have a paid service that lets you use your own domain, but
the more I thought about it, this seemed like a perfect chance to learn
something new and create my own thing. So enter
&lt;a href=&quot;http://github.com/jdcantrell/luggage&quot;&gt;Luggage&lt;/a&gt;. It is a small ruby
script that lets you drag and drop files on to the page which then can
be shared with anyone. Right now it has custom viewers for source code
and images, everything else will get a download page (I’m sure I’ll add
more as needed). &lt;/p&gt;

&lt;p&gt;For this project I went with &lt;a href=&quot;http://www.ruby-lang.org/&quot;&gt;Ruby&lt;/a&gt; using the
&lt;a href=&quot;http://camping.rubyforge.org/&quot;&gt;Camping&lt;/a&gt; framework. It’s small, simple,
and more or less does the trick. One of the great things about CloudApp
is how easy it is to share files. You just drag and drop files to the
icon in your menu bar, or if you take a screenshot it will automatically
upload it for you. While I wasn’t able to go that far with Luggage, I do
use the &lt;a href=&quot;https://developer.mozilla.org/en/Using_files_from_web_applications&quot;&gt;File
API&lt;/a&gt;
in browsers that support it. This means you can drag files from Explorer
or Finder (or w/e you linux kids use) and have them uploaded right away
(with a progress bar and everything!). &lt;/p&gt;

&lt;p&gt;The other things I used in Luggage were jQuery and Twitter Bootstrap
(for this project I didn’t want to spend time styling it, at least not
initially). I also added in google-code-prettify after fidling around
with Albino/pygments for too long.&lt;/p&gt;

&lt;p&gt;The name, by the way, comes from a character in Discworld: &lt;a href=&quot;http://wiki.lspace.org/wiki/The_Luggage&quot;&gt;The
Luggage&lt;/a&gt;, and I wrote this app
so I could more easily share &lt;a href=&quot;http://goodrobot.net/luggage/open/bro&quot;&gt;this&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 
</feed>
