<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>CitrusByte - Home</title>
  <id>tag:blog.citrusbyte.com,2008:mephisto/</id>
  <generator version="0.7.3" uri="http://mephistoblog.com">Mephisto Noh-Varr</generator>
  <link href="http://blog.citrusbyte.com/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://blog.citrusbyte.com/" rel="alternate" type="text/html"/>
  <updated>2008-04-18T21:20:33Z</updated>
  <entry xml:base="http://blog.citrusbyte.com">
    <author>
      <name>daniel</name>
    </author>
    <id>tag:blog.citrusbyte.com,2008-04-18:115</id>
    <published>2008-04-18T21:19:00Z</published>
    <updated>2008-04-18T21:20:33Z</updated>
    <link href="http://blog.citrusbyte.com/2008/4/18/bnet-interview-building-successful-web-companies" rel="alternate" type="text/html"/>
    <title>BNet Interview: Building Successful Web Companies</title>
<content type="html">
            &amp;lt;object type=&quot;application/x-shockwave-flash&quot; height=&quot;350&quot; width=&quot;400&quot; data=&quot;http://i.zdnet.com/flash/cnb_video.swf&quot;&gt;&amp;lt;param name=&quot;FlashVars&quot; value=&quot;vidFile=dap264_will_jessup_fix.flv&#38;connectUrl=rtmp://v.zdnet.com/video/dap264_will_jessup_fix.flv&#38;br=2&#38;si=23&#38;autoplay=false&#38;still=http://i.zdnet.com/gallery/197624-400-300.jpg&quot; /&gt;&amp;lt;param name=&quot;movie&quot; value=&quot;http://i.zdnet.com/flash/cnb_video.swf&quot; /&gt;&amp;lt;/object&gt;

	&lt;blockquote&gt;
		&lt;p&gt;Will Jessup is a founder and Managing Member of CitrusByte, a forward-thinking web application development business. Jessup talks about his company structure and how it attracts the best unique talent for his clients.&lt;/p&gt;
	&lt;/blockquote&gt;
          </content>  </entry>
  <entry xml:base="http://blog.citrusbyte.com">
    <author>
      <name>daniel</name>
    </author>
    <id>tag:blog.citrusbyte.com,2008-04-11:102</id>
    <published>2008-04-11T23:42:00Z</published>
    <updated>2008-04-11T23:42:47Z</updated>
    <link href="http://blog.citrusbyte.com/2008/4/11/april-meetup-aol-announced-april-22nd" rel="alternate" type="text/html"/>
    <title>April Meetup AOL Announced: April 22nd</title>
<content type="html">
            &lt;p&gt;We will have the next &lt;a href=&quot;http://web.meetup.com/34/&quot;&gt;Los Angeles Web Application Developers Meetup&lt;/a&gt; at &lt;span class=&quot;caps&quot;&gt;AOL&lt;/span&gt; this month. &lt;strong&gt;We are only letting in 75 guests&lt;/strong&gt; this time. &lt;em&gt;&lt;span class=&quot;caps&quot;&gt;RSVP&lt;/span&gt; asap to reserve your spot.&lt;/em&gt;&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;AOL&lt;/span&gt; is the sponsor of this months meetup on April 22nd at 8pm. We&#8217;ll get between 50-75 developers together and go over some quick presentations about new cool stuff , eat some pizza and chat. The presentation format is 5-10 minutes on something that web application developers should know, followed by 5 minutes Q&#38;A. There are four open slots right now, so please send me your proposals for a presentation!&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;&lt;strong&gt;When?&lt;/strong&gt;: Tuesday, Apr 22, 2008, 8:00 PM&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Where?&lt;/strong&gt;: &lt;span class=&quot;caps&quot;&gt;AOL&lt;/span&gt;, 331 N Maple Dr, Beverly Hills, &lt;span class=&quot;caps&quot;&gt;CA 90210&lt;/span&gt;&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;Join us at Los Angeles&#8217;s biggest meetup for web application developers. Find out what&#8217;s new in development for the web. Presenters will allow you to pick up a few tips and tricks and find out about new tools. After our presentations enjoy refreshments (and beer) and network with other local developers.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;&lt;a href=&quot;http://web.meetup.com/34/&quot;&gt;http://web.meetup.com/34/&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.citrusbyte.com">
    <author>
      <name>ben</name>
    </author>
    <id>tag:blog.citrusbyte.com,2008-04-05:90</id>
    <published>2008-04-05T16:00:00Z</published>
    <updated>2008-04-03T23:45:53Z</updated>
    <category term="Rails"/>
    <link href="http://blog.citrusbyte.com/2008/4/5/kill-your-fixtures-and-spec-happily" rel="alternate" type="text/html"/>
    <title>Kill your fixtures and spec happily</title>
<content type="html">
            &lt;h2&gt;The trouble w/ fixtures&lt;/h2&gt;

&lt;p&gt;I don't use fixtures in my specs. At all. The fundamental issue with fixtures is that they setup a state for your database as a whole (or at least the tables you loaded). So when you use fixtures all your specs are running against essentially the same state. As you build your application and things get more complex your fixtures become more complex and your state grows and grows. The needs of your specs, however, should pretty much stay the same. So when you go back and track down an issue causing some spec to blow up you have to deal with  that spec running in a state that's way beyond it's needs.&lt;/p&gt;

&lt;h2&gt;Brittle specs&lt;/h2&gt;

&lt;p&gt;For example, lets stay I'm writing a spec to ensure that &lt;code class=&quot;citrus&quot;&gt;book.&lt;span class=&quot;Entity&quot;&gt;authors&lt;/span&gt;.living
&lt;/code&gt; does not return any deceased authors. The state that I need to spec this is very simple: 1 Book with 1 living Author and 1 dead Author. Then I just need to make sure that when I run &lt;code class=&quot;citrus&quot;&gt;book.&lt;span class=&quot;Entity&quot;&gt;authors&lt;/span&gt;.living
&lt;/code&gt; I don't get the dead Author back. It might look something like this:

&lt;pre&gt;&lt;code class=&quot;citrus&quot;&gt;describe &lt;span class=&quot;Variable&quot;&gt;Book&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
  describe &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;with authors&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
    fixtures &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;books&lt;/span&gt;, &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;authors&lt;/span&gt;

    it &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;should only find living authors&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;Support&quot;&gt;Book&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;find_by_title&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Foo's Diary&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).&lt;span class=&quot;Entity&quot;&gt;authors&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;living&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;should&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;==&lt;/span&gt; [&lt;span class=&quot;Support&quot;&gt;Author&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;find_by_name&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;Jim&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)]
    &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Assuming I know that Jim is alive this would be a good spec. The problem is as I write specs I'm going to add more and more authors and this spec will quickly blow up. It's not blowing up because the &lt;code&gt;.living&lt;/code&gt; method broke though, it's just blowing up because it's no longer running in the state it expected.&lt;/p&gt;

&lt;h2&gt;Kill your fixtures&lt;/h2&gt;

&lt;p&gt;Without fixtures I would do something like:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;citrus&quot;&gt;describe &lt;span class=&quot;Variable&quot;&gt;Book&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
  describe &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;with authors&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
    before &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;each&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
       &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;book&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Book&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;create!&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;title&lt;/span&gt; =&amp;gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Foo's Diary&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
       &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;book&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;authors&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; (&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;jim&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Author&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;new&lt;/span&gt;(&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;name&lt;/span&gt; =&amp;gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;Jim&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;dead&lt;/span&gt; =&amp;gt; &lt;span class=&quot;Constant&quot;&gt;false&lt;/span&gt;))
       &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;book&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;authors&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; (&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;jeff&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Author&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;new&lt;/span&gt;(&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;name&lt;/span&gt; =&amp;gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;Jeff&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;dead&lt;/span&gt; =&amp;gt; &lt;span class=&quot;Constant&quot;&gt;true&lt;/span&gt;))
    &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;

    it &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;should only find living authors&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;book&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;reload&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;authors&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;living&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;should&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;==&lt;/span&gt; [&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;jim&lt;/span&gt;]
    &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now my spec will always run in the state I gave it. So the things I setup for my other specs won't come back and blow this spec up. Furthermore, the state isn't buried in multiple fixture files. It's defined plainly right above the spec(s) which use it.&lt;/p&gt;

&lt;h2&gt;Simplify your life even more&lt;/h2&gt;

&lt;p&gt;Once you ditch your fixtures you'll find a new love for writing specs. There's a couple handy tools to simplify your life further though:&lt;/p&gt;

&lt;h3&gt;Factories&lt;/h3&gt;
&lt;p&gt;Dan Manges &lt;a href=&quot;http://www.dcmanges.com/blog/38&quot;&gt;blogged about using factories&lt;/a&gt; to simplify creation of classes and to provide defaults. Since then there's been a few plugins developed for quick and easy factories. We've been using Scott Taylor's &lt;a href=&quot;http://replacefixtures.rubyforge.org/&quot;&gt;Fixture Replacement&lt;/a&gt;.

&lt;h3&gt;&lt;a href=&quot;http://blog.citrusbyte.com/2008/4/3/clean-up-your-code-a-little-with-add&quot;&gt;add!&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;add&lt;/code&gt; is similar to the &lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt; method of &lt;code&gt;has_many&lt;/code&gt; associations except it sacrifices chainability in order to return the concatenated object. &lt;code&gt;add!&lt;/code&gt; goes a step further and throws an exception if the concatenation failed. This is useful in specs because the exception (probably due to a validation error) will occur in your state setup and you will see the error message in your output when you run your specs. So the reason your spec just blew up is displayed for you.&lt;/p&gt;

&lt;p&gt;With Fixture Replacement and add! the example above would look something like:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;citrus&quot;&gt;describe &lt;span class=&quot;Variable&quot;&gt;Book&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
  describe &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;with authors&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
    before &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;each&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
       &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;book&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; create_book &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;title&lt;/span&gt; =&amp;gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Foo's Diary&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
       &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;jim&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;book&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;authors&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;add!&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;new_author&lt;/span&gt;(&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;name&lt;/span&gt; =&amp;gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;Jim&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
       &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;jeff&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;book&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;authors&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;add!&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;new_author&lt;/span&gt;(&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;name&lt;/span&gt; =&amp;gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;Jeff&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;dead&lt;/span&gt; =&amp;gt; &lt;span class=&quot;Constant&quot;&gt;true&lt;/span&gt;)
    &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;

    it &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;should only find living authors&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;book&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;reload&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;authors&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;living&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;should&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;==&lt;/span&gt; [&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;jim&lt;/span&gt;]
    &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://blog.citrusbyte.com">
    <author>
      <name>ben</name>
    </author>
    <id>tag:blog.citrusbyte.com,2008-04-03:89</id>
    <published>2008-04-03T15:08:00Z</published>
    <updated>2008-04-03T23:08:26Z</updated>
    <category term="Rails"/>
    <link href="http://blog.citrusbyte.com/2008/4/3/clean-up-your-code-a-little-with-add" rel="alternate" type="text/html"/>
    <title>Clean up your code a little with add!</title>
<content type="html">
            &lt;p&gt;Here's a little chunk of code I've been using recently. It gives you &lt;code&gt;.add&lt;/code&gt;
 and &lt;code&gt;.add!&lt;/code&gt;
 methods on your &lt;code&gt;has_many&lt;/code&gt; relationships that work similar to the &lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt; method. The difference is that &lt;code&gt;.add&lt;/code&gt; sacrifices chainability in order to return the object being added to the collection.&lt;/p&gt;

&lt;h2&gt;Adding instead of concatenating&lt;/h2&gt;

&lt;p&gt;Using &lt;code class=&quot;citrus&quot;&gt;book.&lt;span class=&quot;Entity&quot;&gt;authors&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Author&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;new&lt;/span&gt;(&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;name&lt;/span&gt; =&amp;gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;Geoff&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
&lt;/code&gt; returns true or false forcing you to do something like &lt;code class=&quot;citrus&quot;&gt;book.&lt;span class=&quot;Entity&quot;&gt;authors&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; (geoff &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Author&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;new&lt;/span&gt;(&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;name&lt;/span&gt; =&amp;gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;Geoff&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;))
&lt;/code&gt; to maintain a reference to the new object. Using &lt;code&gt;.add&lt;/code&gt; you can do  &lt;code class=&quot;citrus&quot;&gt;geoff &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; book.&lt;span class=&quot;Entity&quot;&gt;authors&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;add&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Author&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;new&lt;/span&gt;(&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;name&lt;/span&gt; =&amp;gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;Geoff&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;No really...add!ing&lt;/h2&gt;

&lt;p&gt;Perhaps even more helpful (especially in specs) is the &lt;code&gt;add!&lt;/code&gt; method. &lt;code&gt;add!&lt;/code&gt; acts just like &lt;code&gt;add&lt;/code&gt; except it raises a &lt;code&gt;RecordInvalid&lt;/code&gt; exception on failure. So you can do &lt;code class=&quot;citrus&quot;&gt;geoff &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; book.&lt;span class=&quot;Entity&quot;&gt;authors&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;add!&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Author&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;new&lt;/span&gt;(&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;name&lt;/span&gt; =&amp;gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;Geoff&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
&lt;/code&gt; and have your execution (or your transaction) halt if Geoff messed up and wasn't valid.&lt;/p&gt;

&lt;h2&gt;Blowing up your specs&lt;/h2&gt;

&lt;p&gt;This comes in handy a lot in your specs as exceptions will be displayed as the reason for failure. So if you were to add a validation to your &lt;code&gt;Author&lt;/code&gt; class that caused all the &lt;code&gt;Author&lt;/code&gt;'s you were adding to &lt;code&gt;Book&lt;/code&gt;'s all over your specs to be invalid, you would see it (along with your validation's helpful error message) when you ran your specs.&lt;/p&gt;

&lt;h2&gt;The goods&lt;/h2&gt;
&lt;p&gt;Just drop this in a file in your &lt;code&gt;/lib&lt;/code&gt; folder and require it in an initializer.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;citrus&quot;&gt;&lt;span class=&quot;Keyword&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;ActiveRecord&lt;/span&gt;
  &lt;span class=&quot;Keyword&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;Associations&lt;/span&gt;
    &lt;span class=&quot;Keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;AssociationCollection&lt;span class=&quot;Superclass&quot;&gt; &lt;span class=&quot;Superclass&quot;&gt;&amp;lt;&lt;/span&gt; AssociationProxy&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Comment&quot;&gt;&lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt;:nodoc:&lt;/span&gt;
&lt;span class=&quot;Comment&quot;&gt;      &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; works just like &amp;lt;&amp;lt; except returns the added records instead of self, so&lt;/span&gt;
&lt;span class=&quot;Comment&quot;&gt;      &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; it's not chainable but allows you to do something like:&lt;/span&gt;
&lt;span class=&quot;Comment&quot;&gt;      &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt;   @jim = Book.authors.add Author.new(:name =&amp;gt; 'jim')&lt;/span&gt;
&lt;span class=&quot;Comment&quot;&gt;      &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; (often saving a whole line of code!)&lt;/span&gt;
      &lt;span class=&quot;Keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;add&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Keyword&quot;&gt;*&lt;/span&gt;records&lt;/span&gt;)
        &lt;span class=&quot;Variable&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;Keyword&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;(&lt;span class=&quot;Keyword&quot;&gt;*&lt;/span&gt;records)
        &lt;span class=&quot;Entity&quot;&gt;unarray_if_lonely&lt;/span&gt;(records)
      &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
      
&lt;span class=&quot;Comment&quot;&gt;      &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; works just like add except raises an exception on error&lt;/span&gt;
      &lt;span class=&quot;Keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;add!&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Keyword&quot;&gt;*&lt;/span&gt;records&lt;/span&gt;)
        &lt;span class=&quot;Keyword&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;RecordInvalid&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;new&lt;/span&gt;(&lt;span class=&quot;Keyword&quot;&gt;*&lt;/span&gt;records) &lt;span class=&quot;Keyword&quot;&gt;unless&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;Keyword&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;(&lt;span class=&quot;Keyword&quot;&gt;*&lt;/span&gt;records)
        &lt;span class=&quot;Entity&quot;&gt;unarray_if_lonely&lt;/span&gt;(records)
      &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
      
&lt;span class=&quot;Comment&quot;&gt;      &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; if the given object is an array of size 1 then it returns the only&lt;/span&gt;
&lt;span class=&quot;Comment&quot;&gt;      &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; element itself (w/ no array), otherwise it just gives back object&lt;/span&gt;
      &lt;span class=&quot;Keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;unarray_if_lonely&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;object&lt;/span&gt;)
        (object.&lt;span class=&quot;Entity&quot;&gt;is_a?&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;Array&lt;/span&gt;) &lt;span class=&quot;Keyword&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; object.&lt;span class=&quot;Entity&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;1&lt;/span&gt;) &lt;span class=&quot;Keyword&quot;&gt;?&lt;/span&gt; object.&lt;span class=&quot;Entity&quot;&gt;first&lt;/span&gt; : object
      &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://blog.citrusbyte.com">
    <author>
      <name>nicolas</name>
    </author>
    <id>tag:blog.citrusbyte.com,2008-03-24:67</id>
    <published>2008-03-24T19:26:00Z</published>
    <updated>2008-03-24T19:27:22Z</updated>
    <category term="Code"/>
    <category term="Rails"/>
    <link href="http://blog.citrusbyte.com/2008/3/24/creating-a-new-rails-app-shouldnt-be-boring" rel="alternate" type="text/html"/>
    <title>Creating a new rails app shouldn't be boring</title>
<content type="html">
            &lt;p&gt;&lt;strong&gt;For the impatient: &lt;a href=&quot;http://github.com/foca/utility_scripts/tree/master/railify&quot;&gt;grab the script here&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You know, rails rocks for quickly prototyping an idea. And I like to think in code, so I tend to start a lot of apps to see if they lead somewhere (which they usually don&#8217;t, but that&#8217;s not why we are here). The problem with rails is that, even if it makes great points about don&#8217;t repeating yourself, and code generation, starting a new app is a tedious and boring process.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Update my rails svn checkout&lt;/li&gt;
&lt;li&gt;Create the app from rails edge&lt;/li&gt;
&lt;li&gt;Check it into source control&lt;/li&gt;
&lt;li&gt;Emptying our routes file to get rid of the ugly defaults&lt;/li&gt;
&lt;li&gt;Apply Dr. Nic&#8217;s &lt;a href=&quot;http://drnicwilliams.com/2007/02/09/railsrally-2007-and-gemsonrails/&quot;&gt;GemsOnRails&lt;/a&gt; to freeze gems into the app.&lt;/li&gt;
&lt;li&gt;Install &lt;a href=&quot;http://rspec.info&quot;&gt;rspec&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Install &lt;a href=&quot;http://haml.hamptoncatlin.com&quot;&gt;haml&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Any other gems or plugins you tend to use always (&lt;a href=&quot;http://mr.hamptoncatlin.com&quot;&gt;make-resourceful&lt;/a&gt;, &lt;a href=&quot;http://github.com/dfischer/sexy_scaffold&quot;&gt;sexy-scaffolds&lt;/a&gt;, etc)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, a long while ago I hacked a quick shell script to do some of this for me, using svn and whatnot. I was, &lt;a href=&quot;http://webonrails.com/2007/01/10/bash-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/&quot;&gt;of&lt;/a&gt; &lt;a href=&quot;http://morebs.com/2008/02/24/automating-rails-app-creation-and-svn-repository-setup/&quot;&gt;course&lt;/a&gt;, &lt;a href=&quot;http://blog.teksol.info/2006/3/9/subversion-primer-for-rails-projects&quot;&gt;not&lt;/a&gt; &lt;a href=&quot;http://randomutterings.com/articles/2007/09/19/subversion-script-for-rails-developers&quot;&gt;alone&lt;/a&gt;. We programmers are a bunch of lazy bastards, for sure :)&lt;/p&gt;

&lt;p&gt;Yet times have changed. My script was getting old (I didn&#8217;t use haml or make_resourceful back in those days), and &lt;a href=&quot;http://github.com/foca&quot;&gt;I&#8217;m using git now&lt;/a&gt;. So it was time for a rewrite.&lt;/p&gt;

&lt;h1&gt;Enter &lt;a href=&quot;http://github.com/foca/utility_scripts/tree/master/railify&quot;&gt;railify&lt;/a&gt;&lt;/h1&gt;

&lt;p&gt;It basically looks like this:&lt;/p&gt;

&lt;pre class=&quot;blackboard&quot;&gt; announcing &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Fetching EDGE rails&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
   &lt;span class=&quot;Support&quot;&gt;Dir&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;chdir&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;RAILS_SVN_CHECKOUT&lt;/span&gt;) { silent &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;svn update&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; }
 &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;

 announcing &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Creating application layout&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
   silent &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;ruby &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;Variable&quot;&gt;RAILS_SVN_CHECKOUT&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;}&lt;/span&gt;&lt;/span&gt;/railties/bin/rails &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;#{&lt;/span&gt;app_name&lt;span class=&quot;String&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
 &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;

 &lt;span class=&quot;Support&quot;&gt;Dir&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;chdir&lt;/span&gt;(app_name) &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
   announcing &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Setting up rails app&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
     silent &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;rm README&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
     silent &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;rm public/index.html&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
     silent &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;rm log/*.log&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
     silent &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;rm public/images/rails.png&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
     silent &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;cp config/database.{,sample.}yml&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
     silent &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;rm -r test&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
     &lt;span class=&quot;Support&quot;&gt;File&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;open&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;config/routes.rb&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;w&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;) {|&lt;span class=&quot;Variable&quot;&gt;f&lt;/span&gt;| f &lt;span class=&quot;Keyword&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; templates[&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;routes&lt;/span&gt;] }
   &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;

   announcing &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Creating databases&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
     rake &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;db:create&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
     rake &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;db:create&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;rails_env&lt;/span&gt; =&amp;gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;test&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;

   announcing &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Configuring git repo&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
     silent &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;git init&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
     &lt;span class=&quot;Support&quot;&gt;File&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;open&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;.gitignore&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;w&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;) {|&lt;span class=&quot;Variable&quot;&gt;f&lt;/span&gt;| f &lt;span class=&quot;Keyword&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; templates[&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;gitignore&lt;/span&gt;] }
     silent &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;touch {tmp,log}/.gitignore&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
     git &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Basic rails app structure&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;

   announcing &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Freezing rails&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
     braid &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;http://dev.rubyonrails.org/svn/rails/trunk&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;vendor/rails&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;

   announcing &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Installing GemsOnrails&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
     silent &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;gemsonrails&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
     git &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Froze GemsOnRails plugin&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;

   announcing &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Installing haml&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
     silent &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;haml --rails .&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
     rake &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;gems:freeze&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;gem&lt;/span&gt; =&amp;gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;haml&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
     git &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Froze haml gem and plugin&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;

   announcing &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Installing RSpec&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
     braid &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;http://rspec.rubyforge.org/svn/trunk/rspec&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;vendor/plugins/rspec&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
     braid &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;http://rspec.rubyforge.org/svn/trunk/rspec_on_rails&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;vendor/plugins/rspec_on_rails&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;

   announcing &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Generating RSpec base files&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
     silent &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;script/generate rspec&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
     git &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Added RSpec base files&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;

   announcing &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Installing make_resourceful&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
     braid &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;http://svn.hamptoncatlin.com/make_resourceful/trunk&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;vendor/plugins/make_resourceful&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
 &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;Doesn&#8217;t it look pretty? :) You can &lt;a href=&quot;http://github.com/foca/utility_scripts/tree/master/railify&quot;&gt;check the full source at github&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;So how do I make it work?&lt;/h2&gt;

&lt;p&gt;You need a few things in order for &lt;code&gt;railify&lt;/code&gt; to run:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First and foremost, &lt;strong&gt;&lt;a href=&quot;http://git.or.cz/&quot;&gt;git&lt;/a&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;a href=&quot;http://subversion.tigris.org/&quot;&gt;subversion&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;A checkout of the rails svn trunk (or a stable branch / tag, if you don&#8217;t want to run on the edge). The script&#8217;ll update this
and generate the app from there.&lt;/li&gt;
&lt;li&gt;The rails stack working (ruby, rubygems, a database of choice &#8211; I&#8217;m using sqlite) &lt;strong&gt;DUH!&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Dr Nic&#8217;s &lt;a href=&quot;http://drnicwilliams.com/2007/02/09/railsrally-2007-and-gemsonrails/&quot;&gt;GemsOnRails&lt;/a&gt; (&lt;code&gt;sudo gem install gemsonrails&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://haml.hamptoncatlin.com&quot;&gt;haml&lt;/a&gt; (&lt;code&gt;sudo gem install haml&lt;/code&gt;) *&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://evil.che.lu/projects/braid&quot;&gt;braid&lt;/a&gt;&lt;/strong&gt;, which is like piston for git, but much much more. There&#8217;re instructions on 
&lt;a href=&quot;http://ropiku.wordpress.com/2008/02/04/installing-rspec-with-braid/&quot;&gt;how to get it working here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;An operating system with a real user interface (aka, terminal). Linux, Mac or even CygWin should do, normal Win won&#8217;t.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It sounds like a lot, but probably you already have most of that working already.&lt;/p&gt;

&lt;h2&gt;But it doesn&#8217;t do&#8230;&lt;/h2&gt;

&lt;p&gt;The script is pretty simple to hack, so please do it! &lt;strong&gt;If there&#8217;s this other plugin you absolutely need to install&lt;/strong&gt;, just add a block at the bottom and use the &lt;code&gt;braid&lt;/code&gt; method to install it. &lt;/p&gt;

&lt;p&gt;If you don&#8217;t want to update a local rails repo and instead just use the &lt;code&gt;rails&lt;/code&gt; command, then you can just delete the &#8220;Fetching EDGE rails&#8221; block, change the next one to run &#8220;rails #{app_name}&#8221;, and then use &lt;code&gt;rake rails:freeze:gems&lt;/code&gt; in the &#8220;Freezing rails&#8221; block.&lt;/p&gt;

&lt;p&gt;Etc. You can fork the project at github and do whatever you want with it.&lt;/p&gt;

&lt;h2&gt;There&#8217;s still room for improvement&lt;/h2&gt;

&lt;p&gt;I have a few things in mind, like adding a reset.css and a barebones application.sass. A little error handling won&#8217;t hurt, either (for now it&#8217;s &lt;code&gt;rm -rf !$ &amp;amp;&amp;amp; !!&lt;/code&gt;). Any ideas?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Oh, and last, but not least, the script is released under a &lt;a href=&quot;http://sam.zoy.org/wtfpl/&quot;&gt;WTFP license&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;a href=&quot;http://nicolassanguinetti.info&quot;&gt;Nicolás&lt;/a&gt; works at CitrusByte, lives in Montevideo, Uruguay, uses &lt;code&gt;vim&lt;/code&gt; and &lt;code&gt;mate&lt;/code&gt; randomly and drinks too much caffeine. The stuff he does in mate usually ends up filled with &lt;code&gt;:w&lt;/code&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.citrusbyte.com">
    <author>
      <name>tim</name>
    </author>
    <id>tag:blog.citrusbyte.com,2008-03-22:49</id>
    <published>2008-03-22T00:55:00Z</published>
    <updated>2008-03-23T21:15:00Z</updated>
    <link href="http://blog.citrusbyte.com/2008/3/22/why-rails-will-not-reign-supreme-and-why-you-shouldn-t-want-it-to" rel="alternate" type="text/html"/>
    <title>Why Rails Will Not Reign Supreme (and why you shouldn't want it to) </title>
<content type="html">
            &lt;p&gt;A while ago, Christian Sepulveda wrote an interesting post &lt;a href=&quot;http://pivots.pivotallabs.com/users/chris/blog/articles/417-why-rails-will-reign-supreme&quot;&gt;Why Rails will Reign Supreme&lt;/a&gt;.  This is the latest variation on a theme that&#8217;s beginning to resound in the Rails community, and I can&#8217;t help but to disagree.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;EDIT&lt;/span&gt;&lt;/strong&gt; : Christian also has a follow-up post, &lt;a href=&quot;http://pivots.pivotallabs.com/users/chris/blog/articles/422-why-rails-will-reign-supreme-revisited&quot;&gt;Why Rails will Reign Supreme, revisited&lt;/a&gt; .&lt;/p&gt;


	&lt;p&gt;For the record, I am a big fan of both Ruby and Rails, and use them both in my daily work and personal projects.  However, I cannot see them going mainstream anytime soon, or in Christian&#8217;s words, &#8220;Ruby/Rails can and will replace Java as the language and platform of choice for software development in the enterprise&#8221;.&lt;/p&gt;


	&lt;h3&gt;Other worthy contenders have tried and failed&lt;sup&gt;&lt;a href=&quot;#fn1&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/h3&gt;


	&lt;p&gt;Python has had &lt;a href=&quot;http://www.pythonology.com/success&quot;&gt;a reasonable foray&lt;/a&gt; into the enterprise with Zope/Plone&lt;sup&gt;&lt;a href=&quot;#fn2&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;, Twisted, and now Django and Turbogears.  Heck, it&#8217;s one of Google&#8217;s &#8220;big four&#8221; languages for crying out loud.  What better endorsement than that?  But Python job numbers aren&#8217;t &lt;a href=&quot;http://www.indeed.com/jobtrends?q=ruby%2C+java%2C+python&quot;&gt;even close&lt;/a&gt; .  Hmm what&#8217;s this?  Rubyists haven&#8217;t even overtaken Pythonistas yet?  What&#8217;s with all the hyperbole then?  I know the &lt;a href=&quot;http://www.indeed.com/jobtrends?q=ruby%2C+java%2C+python&#38;relative=1&quot;&gt;growth chart&lt;/a&gt; shows Ruby growing at a phenomenal rate, but even then how many years before it can Eclipse Java?&lt;/p&gt;


	&lt;h3&gt;Enterprise.  Powerful language.  Does not want.&lt;/h3&gt;


	&lt;p&gt;So now Ruby, with funky belligerent offspring Rails in tow, is the next challenger.  But it is too similar to Python.  Simply put, Ruby the language is much too powerful for the mainstream&#8212;the same way Python is too powerful, the same way Lisp is too powerful. (This is using Paul Graham&#8217;s &lt;a href=&quot;http://www.paulgraham.com/power.html&quot;&gt;definition of power&lt;/a&gt; of course.)&lt;/p&gt;


	&lt;p&gt;The reason powerful languages fail is simple.  Big enterprise does not want them.  Remember, big enterprisey non-tech companies don&#8217;t like to hire superstar programmers (who typically prefer powerful languages).  They prefer to have developers as low-cost interchangeable parts.  It doesn&#8217;t matter if they have to hire 50 of them.  Google around for some combination of the words &#8216;average java team size&#8217; and see for yourself.&lt;/p&gt;


	&lt;p&gt;Java with design patterns&lt;sup&gt;&lt;a href=&quot;#fn3&quot;&gt;3&lt;/a&gt;&lt;/sup&gt; scales a lot better for average programmers.  Bear in mind I&#8217;m talking scalability with regards to team size, not with regards to deployment.&lt;/p&gt;


	&lt;p&gt;With Java, you lack a convenient way to use &lt;a href=&quot;http://www.joelonsoftware.com/items/2006/08/01.html&quot;&gt;functions as first-class data&lt;/a&gt; .  You can&#8217;t just open up a class and change default behavior like you can in Ruby.  There is limited, if any, meta-programming.  Roadblocks and safety nets abound.  All these are reasons why many coders spurn Java, but they are the exact same reasons why it is so useful in big teams of mediocre coders.  (You&#8217;re going to see me using terms like &#8216;mediocre coders&#8217;, &#8216;average programmers&#8217;, etc a lot.  No slight against the top Java developers, but there are millions of Java developers and by definition most of them are average.)&lt;/p&gt;


	&lt;p&gt;Anyway, all this leads to senior developers being able to dump each programmer into a nice little cubbyhole coding a Facade/Adaptor/Observer where he isn&#8217;t likely to break anything.  Half the naughty things generic programmer &lt;span class=&quot;caps&quot;&gt;ID81732&lt;/span&gt; can do should be caught during compile, and the rest that might get through, well there&#8217;s &lt;a href=&quot;http://www.ibm.com/developerworks/library/j-jtp06206.html?ca=dgr-lnxw01BugDetectors&quot;&gt;static analysis tools&lt;/a&gt; .  With dynamic languages, there aren&#8217;t those safety nets&lt;sup&gt;&lt;a href=&quot;#fn4&quot;&gt;4&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;


	&lt;p&gt;You can mention the wonderful Ruby/Rails ecosystem.  Yes I know we have plug-ins and gems out the wazoo.  The huge missing piece here is schools.  Java has a veritable JavaCoderFactory of vocational schools and colleges churning out graduates year after year with students who know nothing but Java.  In most schools, Ruby has to be learned outside of class, ie &lt;em&gt;not&lt;/em&gt; mainstream.  The battle has already been lost there, let alone 4 years later when those students are looking for jobs.&lt;/p&gt;


	&lt;p&gt;Christian concludes with &#8220;economics will dictate the needs of software and will establish the supremacy of Ruby and Rails&#8221;.  I agree with the former.  As for the latter, one of the chief concepts of economics is scarcity.  And right now, good Ruby coders are scarce compared to their Java brethren.  The scarcity of Rails coders compared to Java coders will raise the costs of developing with Rails (since with a limited supply Rails developers can charge more) to an equilibrium point with the cost of a Java team powered by a horde of mediocre code churners.&lt;/p&gt;


	&lt;p&gt;Another way of looking at this.  Suppose one night &lt;span class=&quot;caps&quot;&gt;DHH&lt;/span&gt; appeared to every &lt;span class=&quot;caps&quot;&gt;CTO&lt;/span&gt; in the world in a vision and said &#8220;Tomorrow thou shalt start using Ruby and Rails&#8221;, and they all wake up and start looking for Ruby coders.  What then?  The sheer lack of programmers who know Ruby to fill that demand will mean other languages will have to be used.  Mainstream?  Pshhh.&lt;/p&gt;


	&lt;p&gt;I understand &lt;a href=&quot;http://blog.obiefernandez.com/content/2008/03/big-name-compan.html&quot;&gt;from Obie&lt;/a&gt; that a lot of big companies are starting to use Rails.  That&#8217;s great news.  But to truly go mainstream goes far beyond that.  The companies listed all have (and need to have) a huge online presence.  But going mainstream also means winning the hearts of non-tech companies who need bespoke applications.  The kind of applications you never see or hear about.  They don&#8217;t come with fancy gradients, social networking, or RESTful APIs.  Yet million-dollar contracts are flying around to get them coded.  In Java.&lt;/p&gt;


	&lt;h3&gt;So what&#8217;s the big deal?&lt;/h3&gt;


	&lt;p&gt;Why would Ruby/Rails developers want it to be mainstream anyway?  There&#8217;s another term for becoming commonplace, and it&#8217;s called &lt;strong&gt;commoditization&lt;/strong&gt;.  Sure if Ruby becomes the new Java, then the early adopters suddenly have 5 years experience when everyone else has 2.  That&#8217;s why this scenario is so appealing.  However, mainstream also means hiring decisions will to be influenced more by non-tech people who don&#8217;t understand that 1 senior developer at 120k a year is more cost-productive than 3 junior developers at 30k per annum.&lt;/p&gt;


	&lt;p&gt;Paul Graham&#8217;s RailsConf 2006 Keynote Address, &lt;a href=&quot;http://www.paulgraham.com/marginal.html&quot;&gt;Power of the Marginal&lt;/a&gt;, was only two years ago.  What&#8217;s happened since then?  Why the obsession with being mainstream, when we&#8217;re having so much &lt;em&gt;fun&lt;/em&gt; being on the outside?&lt;/p&gt;


	&lt;p&gt;Part of the &lt;em&gt;appeal&lt;/em&gt; Ruby and Rails have is that they&#8217;re on the cutting edge.  The moment there&#8217;s an &#8220;R2EE&#8221; out there will probably mark the beginning of the end for many.  Time to look for a new language and framework.  Scala on Sails.  Javascript in Jail.  &lt;em&gt;Erlang with Extra-terrestrials&lt;/em&gt;.  Whatever floats your boat.&lt;/p&gt;


	&lt;p&gt;PS: Once again, nothing personal against Christian Sepulveda &#8211; this essay is directed at anyone who thinks Ruby/Rails is taking over programming as we know it anytime soon &#8211; his just happens to be the most recent such post I have come across.&lt;/p&gt;


&lt;hr /&gt;


	&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; By &#8216;failed&#8217; I mean that it still plays second fiddle to Java and C# in market adoption.&lt;/p&gt;


	&lt;p&gt;&lt;sup&gt;2&lt;/sup&gt; Yes I don&#8217;t think Zope/Plone then comes close to Rails now, but you have to consider the state of software frameworks available across all languages at that time.&lt;/p&gt;


	&lt;p&gt;&lt;sup&gt;3&lt;/sup&gt; For a hilarious look at Java, check out Steve Yegge&#8217;s &lt;a href=&quot;http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html&quot;&gt;Execution in the Kingdom of Nouns&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;&lt;sup&gt;4&lt;/sup&gt; Yes I know dynamic languages espouse testing, but good Java shops use tests too.  Static analysis is something Ruby/Python et al cannot do.&lt;/p&gt;


&lt;hr /&gt;


	&lt;p&gt;CitrusByte developer Tim Goh aka &lt;a href=&quot;http://www.progprog.com&quot;&gt;ProgProg&lt;/a&gt; was previously a Python/Django hacker but is now a Ruby/Rails convert.  He has been charged multiple times with method_missing abuse.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.citrusbyte.com">
    <author>
      <name>ari</name>
    </author>
    <id>tag:blog.citrusbyte.com,2008-03-20:37</id>
    <published>2008-03-20T07:30:00Z</published>
    <updated>2008-03-20T07:54:07Z</updated>
    <link href="http://blog.citrusbyte.com/2008/3/20/sass-production-woes-rails" rel="alternate" type="text/html"/>
    <title>Sass production woes in Rails</title>
<content type="html">
            &lt;p&gt;Rails 2.0+ introduced our team at CitrusByte to a Sass woe: our sass file would not regenerate. We would be able to regenerate it when ssh&#8217;ing into the site and starting the server in an environment other than production. Obviously not an ideal solution. So, what&#8217;s the fix?&lt;/p&gt;


	&lt;p&gt;Place the following in any ruby file in your &lt;em&gt;rails_root/config/initializers/some_file.rb&lt;/em&gt;:&lt;/p&gt;


&lt;pre class=&quot;blackboard&quot;&gt;p &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;** Ensuring the Sass::RAILS_LOADED is undefined for regeneration&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;defined?&lt;/span&gt;(&lt;span class=&quot;Support&quot;&gt;Sass&lt;/span&gt;::&lt;span class=&quot;Entity&quot;&gt;RAILS_LOADED&lt;/span&gt;)
  &lt;span class=&quot;Keyword&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;Sass&lt;/span&gt;
    &lt;span class=&quot;Entity&quot;&gt;remove_const&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;RAILS_LOADED&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;)
  &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
&lt;/pre&gt;

	&lt;p&gt;Here&#8217;s a technical description of the problem:&lt;/p&gt;


	&lt;p&gt;In Rails, Sass runs through the &lt;strong&gt;ActionController::Base.process&lt;/strong&gt; command with an &lt;strong&gt;alias_method&lt;/strong&gt;. The &lt;strong&gt;update_stylesheets&lt;/strong&gt; method is never surfaced outside of there in the Rails environment; this makes it difficult to run it in a Capistrano task.&lt;/p&gt;


	&lt;p&gt;Also, the Sass file needs to be regenerated after the plugins load. It&#8217;s not ideal to place this in the environment.rb, because most of this runs before other configuration parameters. The &lt;em&gt;initializers load after&lt;/em&gt; the plugins load and is the &lt;strong&gt;final block of code&lt;/strong&gt; that is run on the init block. That makes an &lt;strong&gt;initializer&lt;/strong&gt; a perfect place to put our fix.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.citrusbyte.com">
    <author>
      <name>daniel</name>
    </author>
    <id>tag:blog.citrusbyte.com,2008-03-11:22</id>
    <published>2008-03-11T19:48:00Z</published>
    <updated>2008-03-11T21:55:14Z</updated>
    <link href="http://blog.citrusbyte.com/2008/3/11/what-s-that-rspec-haml-scaffolds-yes-it-is" rel="alternate" type="text/html"/>
    <title>What's that? RSpec Haml Scaffolds? Yes, it is!</title>
<content type="html">
            &lt;p&gt;Some people use scaffolds, some people don&#8217;t. To those who do and happen to have their project taking advantage of Haml, probably understand the pain it is to go through all those lame rhtml files and convert them to Haml. Thus, a quick and dirty solution has arrived. Meet your master: &#8220;RSpec Haml Scaffolds&#8221;.&lt;/p&gt;


	&lt;p&gt;It&#8217;s hosted at github over here:
&lt;a href=&quot;http://github.com/dfischer/rspec-haml-scaffold-generator&quot;&gt;http://github.com/dfischer/rspec-haml-scaffold-generator&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;To install the git way (until Rails&#8217; script/install supports git) do this in your rails_root/vendor/plugins directory:&lt;/p&gt;


&lt;pre class=&quot;blackboard&quot;&gt;  git clone git&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;Keyword&quot;&gt;/&lt;/span&gt;github.&lt;span class=&quot;Entity&quot;&gt;com&lt;/span&gt;&lt;span class=&quot;Keyword&quot;&gt;/&lt;/span&gt;dfischer&lt;span class=&quot;Keyword&quot;&gt;/&lt;/span&gt;rspec&lt;span class=&quot;Keyword&quot;&gt;-&lt;/span&gt;haml&lt;span class=&quot;Keyword&quot;&gt;-&lt;/span&gt;scaffold&lt;span class=&quot;Keyword&quot;&gt;-&lt;/span&gt;generator.git
&lt;/pre&gt;

	&lt;p&gt;Bam, you&#8217;re done. You should have a rspec-haml-scaffold folder in your vendor/plugins directory and when you fire up the following command:&lt;/p&gt;


&lt;pre class=&quot;blackboard&quot;&gt;  script&lt;span class=&quot;Keyword&quot;&gt;/&lt;/span&gt;generate
&lt;/pre&gt;

	&lt;p&gt;You should see &#8220;rspec_haml_scaffold&#8221; in the &#8220;installed generators&#8230;plugins&#8221; section.&lt;/p&gt;


	&lt;p&gt;Remember this is a quick and dirty version of the plugin. There may be a couple quirks with it, if so feel free to fork the repository on github and submit a patch!&lt;/p&gt;


	&lt;p&gt;p.s If anyone needs a github invite I have three left. All you need to do is request one in the comments, be sure to leave a way to contact you.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.citrusbyte.com">
    <author>
      <name>ari</name>
    </author>
    <id>tag:blog.citrusbyte.com,2008-02-20:11</id>
    <published>2008-02-20T20:10:00Z</published>
    <updated>2008-02-21T20:41:47Z</updated>
    <category term="Code"/>
    <category term="Free Stuff"/>
    <category term="Rails"/>
    <category term="Ruby"/>
    <link href="http://blog.citrusbyte.com/2008/2/20/effortlessly-farm-work-to-an-ec2-instance-without-batting-an-eye" rel="alternate" type="text/html"/>
    <title>Effortlessly farm work to an EC2 instance without batting an eye</title>
<content type="html">
            &lt;p&gt;&lt;strong&gt;Inline media uploading and processing in ruby&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;Today, we released a new gem to make integrating off-site processing easy. With this gem and utilizing Amazon&#8217;s &lt;span class=&quot;caps&quot;&gt;EC2&lt;/span&gt; cloud and S3 storage backend, you can easily process media files in a non-blocking, threaded way and do it all inline with the rest of your application.&lt;/p&gt;


	&lt;p&gt;First download the gem and all it&#8217;s dependencies by typing:&lt;/p&gt;


&lt;pre class=&quot;blackboard&quot;&gt;  sudo gem install processor_pool &lt;span class=&quot;Keyword&quot;&gt;-&lt;/span&gt;y
&lt;/pre&gt;

	&lt;p&gt;This gem is built on top of &lt;a href=&quot;http://sinatra.rubyforge.org/&quot;&gt;Sinatra&lt;/a&gt;. So, if you are familiar with the Sinatra syntax, then you&#8217;ll be right at home. If not, I highly suggest you check it out.&lt;/p&gt;


	&lt;p&gt;First,&lt;/p&gt;


&lt;pre class=&quot;blackboard&quot;&gt;&lt;span class=&quot;Comment&quot;&gt;  &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; In a file called media_processor.rb&lt;/span&gt;
  &lt;span class=&quot;Keyword&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;rubygems&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;Keyword&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;processor_pool&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;Comment&quot;&gt;  &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; Set the access_key_id and the secret_access_key provided by amazon&lt;/span&gt;
  access_key_id, secret_access_key &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;accesskey&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;somethinglongandfuzzyhere&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;Comment&quot;&gt;  &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; And start the processors!&lt;/span&gt;
  &lt;span class=&quot;Support&quot;&gt;ProcessorPool&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;start&lt;/span&gt;(access_key_id, secret_access_key)
&lt;/pre&gt;

	&lt;p&gt;Add to the end of the file&lt;/p&gt;


&lt;pre class=&quot;blackboard&quot;&gt;  get &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;/&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Show me the money&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
&lt;/pre&gt;

	&lt;p&gt;That&#8217;s it. Start your server up with&lt;/p&gt;


&lt;pre class=&quot;blackboard&quot;&gt; ruby media_processor.rb
&lt;/pre&gt;

	&lt;p&gt;And now you are ready to go to allow a user to hit the &lt;span class=&quot;caps&quot;&gt;EC2&lt;/span&gt; cloud (more on this later) and be responded with the &#8220;Show me the money&#8221; text.&lt;/p&gt;


	&lt;p&gt;Replace the above content with the following&lt;/p&gt;


&lt;pre class=&quot;blackboard&quot;&gt;  &lt;span class=&quot;Keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;PFile&lt;/span&gt;
    &lt;span class=&quot;Keyword&quot;&gt;attr_accessor&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;filename&lt;/span&gt;, &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;temp_file&lt;/span&gt;
    &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@@&lt;/span&gt;temp_directory_base&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;tmp&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;Keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;initialize&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;f&lt;/span&gt;)
      &lt;span class=&quot;Variable&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;filename&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; f[&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;filename&lt;/span&gt;]
      &lt;span class=&quot;Variable&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;temp_file&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; f[&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;tempfile&lt;/span&gt;]
      &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;media_file&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;nil&lt;/span&gt;
      &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;temp_dir&lt;/span&gt;
    &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;Keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;delete!&lt;/span&gt;
&lt;span class=&quot;Comment&quot;&gt;      &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt;File.unlink(self.temp_file)&lt;/span&gt;
      &lt;span class=&quot;Variable&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;temp_file&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;delete&lt;/span&gt;
    &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;Keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;store_in_temp_directory&lt;/span&gt;
      &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;temp_dir&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;File&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;join&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@@&lt;/span&gt;temp_directory_base&lt;/span&gt;, &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;upload&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;member_id&lt;/span&gt;, &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;upload&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;media_file_id&lt;/span&gt;)
      &lt;span class=&quot;Support&quot;&gt;FileUtils&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;mkdir_p&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;temp_dir&lt;/span&gt;)
      filename &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;File&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;basename&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;filename&lt;/span&gt;)
      &lt;span class=&quot;Support&quot;&gt;FileUtils&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;mv&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;temp_file&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;path&lt;/span&gt;, &lt;span class=&quot;Support&quot;&gt;File&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;join&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;temp_dir&lt;/span&gt;, filename))
      &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;media_file&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;MediaFile&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;new&lt;/span&gt;(&lt;span class=&quot;Support&quot;&gt;File&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;join&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;temp_dir&lt;/span&gt;, filename))
    &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;Keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;process!&lt;/span&gt;
      &lt;span class=&quot;Support&quot;&gt;ImageConverter&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;new&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;media_file&lt;/span&gt;).&lt;span class=&quot;Entity&quot;&gt;convert&lt;/span&gt;    
      &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;media_file&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;delete!&lt;/span&gt;
      &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Processed images for &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;media_file&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;Entity&quot;&gt;original_file_name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;Keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;save_to_storage&lt;/span&gt;
&lt;span class=&quot;Comment&quot;&gt;      &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; DO THE S3 saving here&lt;/span&gt;
      &lt;span class=&quot;Support&quot;&gt;MediaDirectory&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;new&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;temp_dir&lt;/span&gt;).&lt;span class=&quot;Entity&quot;&gt;copy_to_s3&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;STORAGE_BUCKET&lt;/span&gt;, upload_prefix, &lt;span class=&quot;Constant&quot;&gt;true&lt;/span&gt;)
    &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;Keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;upload_prefix&lt;/span&gt;
      &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;upload&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;Entity&quot;&gt;member_id&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;}&lt;/span&gt;&lt;/span&gt;/&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;upload&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;Entity&quot;&gt;media_file_id&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;Keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;ImageConverter&lt;/span&gt; 
    &lt;span class=&quot;Keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;resize_to&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;name&lt;span class=&quot;Variable&quot;&gt;,&lt;/span&gt; image &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;nil&lt;/span&gt;&lt;/span&gt;)
      img &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; image &lt;span class=&quot;Keyword&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Magick&lt;/span&gt;::&lt;span class=&quot;Entity&quot;&gt;Image&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;read&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;file&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;file_name&lt;/span&gt;).&lt;span class=&quot;Entity&quot;&gt;first&lt;/span&gt;
      named_size &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;self&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;class&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;named_sizes&lt;/span&gt;[name]
      &lt;span class=&quot;Keyword&quot;&gt;if&lt;/span&gt; named_size &lt;span class=&quot;Keyword&quot;&gt;=~&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;c$&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;/&lt;/span&gt;&lt;/span&gt;
        dimensions &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; named_size.&lt;span class=&quot;Entity&quot;&gt;gsub&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;c$&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;/&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;).&lt;span class=&quot;Entity&quot;&gt;split&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;x&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
        img.&lt;span class=&quot;Entity&quot;&gt;crop_resized!&lt;/span&gt;(dimensions[&lt;span class=&quot;Constant&quot;&gt;0&lt;/span&gt;].&lt;span class=&quot;Entity&quot;&gt;to_i&lt;/span&gt;, dimensions[&lt;span class=&quot;Constant&quot;&gt;1&lt;/span&gt;].&lt;span class=&quot;Entity&quot;&gt;to_i&lt;/span&gt;)
      &lt;span class=&quot;Keyword&quot;&gt;else&lt;/span&gt;
        img.&lt;span class=&quot;Entity&quot;&gt;change_geometry!&lt;/span&gt;(named_size) &lt;span class=&quot;Keyword&quot;&gt;do &lt;/span&gt;|&lt;span class=&quot;Variable&quot;&gt;cols&lt;/span&gt;, &lt;span class=&quot;Variable&quot;&gt;rows&lt;/span&gt;, &lt;span class=&quot;Variable&quot;&gt;img&lt;/span&gt;|
          img &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; img.&lt;span class=&quot;Entity&quot;&gt;resize&lt;/span&gt;(cols, rows)
        &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
      &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
      img.&lt;span class=&quot;Entity&quot;&gt;write&lt;/span&gt;(&lt;span class=&quot;Entity&quot;&gt;path_to&lt;/span&gt;(name))
    &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
  post &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;/new&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;file&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;PFile&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;new&lt;/span&gt;(params[&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;file&lt;/span&gt;])
    &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;file&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;store_in_temp_directory&lt;/span&gt;
    &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;file&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;save_to_storage&lt;/span&gt;
    redirect params[&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;success_url&lt;/span&gt;] &lt;span class=&quot;Keyword&quot;&gt;if&lt;/span&gt; params[&lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;success_url&lt;/span&gt;]
  &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;  
&lt;/pre&gt;

	&lt;p&gt;If you look closely, we are just using some simple classes to handle our conversion. But ignoring that, we are sending a post to the server with file parameters. We can send the process a file and the rest is history. Notice that this all happens on a remote server. None of this is handled locally.&lt;/p&gt;


	&lt;p&gt;That&#8217;s it.&lt;/p&gt;


	&lt;p&gt;Of course, you can imagine how you could extend this to include movie types and other types of processing, but for the time being, let&#8217;s focus the images. (Although I will be showing how to do this in rails, you can use this with any back-end, &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;, Java, etc.)&lt;/p&gt;


Let&#8217;s add a convenience method in the application.rb
&lt;pre class=&quot;blackboard&quot;&gt;  &lt;span class=&quot;Keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;url_for_upload_server&lt;/span&gt;
    &lt;span class=&quot;Keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;RAILS_ENV&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;production&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Comment&quot;&gt;      &lt;span class=&quot;Comment&quot;&gt;#&lt;/span&gt; determine the upload server to try to use&lt;/span&gt;
      p &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Processors&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;get_random_processor&lt;/span&gt;(::&lt;span class=&quot;Entity&quot;&gt;SERVER_POOL_BUCKET&lt;/span&gt;)
      &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;http://&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;#{&lt;/span&gt;p&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;Entity&quot;&gt;hostname&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;}&lt;/span&gt;&lt;/span&gt;:4567/new&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;Keyword&quot;&gt;else&lt;/span&gt;
      p &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;Support&quot;&gt;Processors&lt;/span&gt;.&lt;span class=&quot;Entity&quot;&gt;get_random_processor&lt;/span&gt;(::&lt;span class=&quot;Entity&quot;&gt;SERVER_POOL_BUCKET&lt;/span&gt;)
      &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;http://localhost:4567/new&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;Keyword&quot;&gt;end&lt;/span&gt;
&lt;/pre&gt;

	&lt;p&gt;In your upload controller add&lt;/p&gt;


&lt;pre class=&quot;blackboard&quot;&gt;  &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;upload_url&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;=&lt;/span&gt; url_for_upload_server
&lt;/pre&gt;

	&lt;p&gt;Now, in your upload view, add&lt;/p&gt;


&lt;pre class=&quot;blackboard&quot;&gt;  &lt;span class=&quot;Keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;Keyword&quot;&gt;%&lt;/span&gt; form_for &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;media&lt;/span&gt;, &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;id&lt;/span&gt; =&amp;gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;fileform&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;url&lt;/span&gt; =&amp;gt; upload_url, &lt;span class=&quot;Constant&quot;&gt;&lt;span class=&quot;Constant&quot;&gt;:&lt;/span&gt;multipart&lt;/span&gt; =&amp;gt; &lt;span class=&quot;Constant&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do &lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;String&quot;&gt;  ...&lt;/span&gt;
&lt;span class=&quot;String&quot;&gt;  &amp;lt;% end %&lt;span class=&quot;String&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;

	&lt;p&gt;Lets handle this inline and non-blocking&lt;/p&gt;


	&lt;p&gt;Add a button field to the end of your form like so:&lt;/p&gt;


&lt;pre class=&quot;blackboard&quot;&gt;  &lt;span class=&quot;MetaTag&quot;&gt;&lt;span class=&quot;MetaTag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;MetaTag&quot;&gt;button&lt;/span&gt; &lt;span class=&quot;MetaTag&quot;&gt;class&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;button&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;MetaTag&quot;&gt;&lt;span class=&quot;MetaTag&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;MetaTag&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;buttonUpload&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;  &lt;span class=&quot;MetaTag&quot;&gt;onclick&lt;/span&gt;=&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;return beginFileUpload();&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;MetaTag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;Upload&lt;span class=&quot;MetaTag&quot;&gt;&lt;span class=&quot;MetaTag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;MetaTag&quot;&gt;button&lt;/span&gt;&lt;span class=&quot;MetaTag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;

	&lt;p&gt;and this to your javascript file (note, this is jQuery)&lt;/p&gt;


&lt;pre class=&quot;blackboard&quot;&gt;  &lt;span class=&quot;Storage&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;beginFileUpload&lt;/span&gt;()
  {
      &lt;span class=&quot;Comment&quot;&gt;&lt;span class=&quot;Comment&quot;&gt;//&lt;/span&gt; todo: some kind of feedback that upload has started...&lt;/span&gt;
      &lt;span class=&quot;Keyword&quot;&gt;$&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;#uploading&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).show();
      &lt;span class=&quot;Keyword&quot;&gt;$&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;#buttonUpload&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).hide();

      &lt;span class=&quot;Keyword&quot;&gt;$&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;#validation_code&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).&lt;span class=&quot;Support&quot;&gt;load&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&amp;lt;%= url_for(:controller=&amp;gt;&amp;quot;media_file&amp;quot;, :action=&amp;gt;&amp;quot;upload&amp;quot;) %&amp;gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, 
            {    title: &lt;span class=&quot;Keyword&quot;&gt;$&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;#title&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).val(),
                 description: &lt;span class=&quot;Keyword&quot;&gt;$&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;#description&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).val()
            },
            &lt;span class=&quot;Storage&quot;&gt;function&lt;/span&gt;(responseText, textStatus, &lt;span class=&quot;Support&quot;&gt;XMLHttpRequest&lt;/span&gt;) {
                &lt;span class=&quot;Keyword&quot;&gt;$&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;#validation_code&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).val(responseText)
                &lt;span class=&quot;Keyword&quot;&gt;if&lt;/span&gt; (textStatus &lt;span class=&quot;Keyword&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;success&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
                    completeFileUpload();
                &lt;span class=&quot;Keyword&quot;&gt;else&lt;/span&gt;
                    &lt;span class=&quot;Support&quot;&gt;alert&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;Error uploading file.&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);
                });
      &lt;span class=&quot;Keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;false&lt;/span&gt;;
  }

  &lt;span class=&quot;Storage&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;Entity&quot;&gt;completeFileUpload&lt;/span&gt;()
  {
      &lt;span class=&quot;Keyword&quot;&gt;$&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;#fileform&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;).&lt;span class=&quot;Support&quot;&gt;submit&lt;/span&gt;();
      &lt;span class=&quot;Keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;Constant&quot;&gt;false&lt;/span&gt;;
  }
&lt;/pre&gt;

	&lt;p&gt;With that, you have inline file uploading with inline image processing off-site.&lt;/p&gt;


	&lt;p&gt;For more information, check the docs at &lt;a href=&quot;http://rubyforge.org/projects/processorpool/&quot;&gt;http://rubyforge.org/projects/processorpool/&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.citrusbyte.com">
    <author>
      <name>daniel</name>
    </author>
    <id>tag:blog.citrusbyte.com,2008-02-19:12</id>
    <published>2008-02-19T00:14:00Z</published>
    <updated>2008-02-19T00:20:06Z</updated>
    <link href="http://blog.citrusbyte.com/2008/2/19/what-tools-do-you-use" rel="alternate" type="text/html"/>
    <title>What Tools do You Use?</title>
<content type="html">
            &lt;p&gt;At CitrusByte we utilize the best tools for the job.&lt;/p&gt;


	&lt;p&gt;On a typical rails project, we usually employ the following tools:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Haml &#8211; &lt;a href=&quot;http://haml.hamptoncatlin.com/&quot;&gt;Haml&lt;/a&gt; is Markup Haiku. It brings simplicity to our front end code, thus making it a lot more maintainable. Haml is CitrusByte approved.&lt;/li&gt;
		&lt;li&gt;RSpec &#8211; Testing is important, and &lt;a href=&quot;http://rspec.info/&quot;&gt;RSpec&lt;/a&gt; brings a whole new paradigm to the idea of testing. When using RSpec properly, you no longer fear your code breaking, you have the confidence it works. RSpec is the perfect tool for Behavior Driven Development. RSpec is CitrusByte approved.&lt;/li&gt;
		&lt;li&gt;&lt;span class=&quot;caps&quot;&gt;OSX&lt;/span&gt; &#8211; &lt;span class=&quot;caps&quot;&gt;OS X&lt;/span&gt; is a very powerful platform for development. We all more or less come from a Windows enviornment, then tried Linux. Linux is great and all, but it has annoying kinks. When we started playing with macs, we realized it had the power of a linux computer (thanks to a unix back end) and an amazing ease of use factor that Apple really excels at. So, Mac / &lt;span class=&quot;caps&quot;&gt;OS X&lt;/span&gt; is CitrusByte approved.&lt;/li&gt;
		&lt;li&gt;Textmate &#8211; VI is cool, but &lt;a href=&quot;http://macromates.com/&quot;&gt;Textmate&lt;/a&gt; is amazing. Of course we have a couple &lt;em&gt;cool vi / linux players&lt;/em&gt; on our team, but in general we use Textmate. There are many things that make Textmate amazing: the community, the plethora of bundles, the ease, the painlessness, and a very simple UI. Textmate is CitrusByte approved.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;What type of tools do you use on a typical day at work?&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.citrusbyte.com">
    <author>
      <name>daniel</name>
    </author>
    <id>tag:blog.citrusbyte.com,2008-02-06:9</id>
    <published>2008-02-06T21:45:00Z</published>
    <updated>2008-02-07T21:49:56Z</updated>
    <link href="http://blog.citrusbyte.com/2008/2/6/developer-meetups-geek-news-oh-my" rel="alternate" type="text/html"/>
    <title>Developer Meetups, Geek News, oh My!</title>
<content type="html">
            &lt;h2&gt;Developer Meetup Videos&lt;/h2&gt;


	&lt;p&gt;We got videos up from the web-dev meetup, check it out here:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&amp;lt;object type=&quot;application/x-shockwave-flash&quot; height=&quot;300&quot; data=&quot;http://www.vimeo.com/moogaloop.swf?clip_id=664170&amp;amp;server=www.vimeo.com&amp;amp;fullscreen=1&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&quot; width=&quot;400&quot;&gt;    &amp;lt;param name=&quot;quality&quot; value=&quot;best&quot; /&gt;    &amp;lt;param name=&quot;allowfullscreen&quot; value=&quot;true&quot; /&gt;    &amp;lt;param name=&quot;scale&quot; value=&quot;showAll&quot; /&gt;    &amp;lt;param name=&quot;movie&quot; value=&quot;http://www.vimeo.com/moogaloop.swf?clip_id=664170&amp;amp;server=www.vimeo.com&amp;amp;fullscreen=1&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&quot; /&gt;&amp;lt;/object&gt;&lt;br /&gt;&lt;a href=&quot;http://www.vimeo.com/664170/l:embed_664170&quot;&gt;LA Developers Meetup &#8211; &lt;span class=&quot;caps&quot;&gt;JAN 29&lt;/span&gt; &#8211; Eduardo Sciammarella&lt;/a&gt; from &lt;a href=&quot;http://www.vimeo.com/user309459/l:embed_664170&quot;&gt;will jessup&lt;/a&gt; on &lt;a href=&quot;http://vimeo.com/l:embed_664170&quot;&gt;Vimeo&lt;/a&gt;.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;&amp;lt;object type=&quot;application/x-shockwave-flash&quot; height=&quot;300&quot; data=&quot;http://www.vimeo.com/moogaloop.swf?clip_id=664490&amp;amp;server=www.vimeo.com&amp;amp;fullscreen=1&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&quot; width=&quot;400&quot;&gt;    &amp;lt;param name=&quot;quality&quot; value=&quot;best&quot; /&gt;    &amp;lt;param name=&quot;allowfullscreen&quot; value=&quot;true&quot; /&gt;    &amp;lt;param name=&quot;scale&quot; value=&quot;showAll&quot; /&gt;    &amp;lt;param name=&quot;movie&quot; value=&quot;http://www.vimeo.com/moogaloop.swf?clip_id=664490&amp;amp;server=www.vimeo.com&amp;amp;fullscreen=1&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&quot; /&gt;&amp;lt;/object&gt;&lt;br /&gt;&lt;a href=&quot;http://www.vimeo.com/664490/l:embed_664490&quot;&gt;LA Developers Meetup &#8211; &lt;span class=&quot;caps&quot;&gt;JAN 29&lt;/span&gt; &#8211; Blake Senftner&lt;/a&gt; from &lt;a href=&quot;http://www.vimeo.com/user309459/l:embed_664490&quot;&gt;will jessup&lt;/a&gt; on &lt;a href=&quot;http://vimeo.com/l:embed_664490&quot;&gt;Vimeo&lt;/a&gt;.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;&amp;lt;object type=&quot;application/x-shockwave-flash&quot; height=&quot;300&quot; data=&quot;http://www.vimeo.com/moogaloop.swf?clip_id=663940&amp;amp;server=www.vimeo.com&amp;amp;fullscreen=1&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&quot; width=&quot;400&quot;&gt;    &amp;lt;param name=&quot;quality&quot; value=&quot;best&quot; /&gt;    &amp;lt;param name=&quot;allowfullscreen&quot; value=&quot;true&quot; /&gt;    &amp;lt;param name=&quot;scale&quot; value=&quot;showAll&quot; /&gt;    &amp;lt;param name=&quot;movie&quot; value=&quot;http://www.vimeo.com/moogaloop.swf?clip_id=663940&amp;amp;server=www.vimeo.com&amp;amp;fullscreen=1&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&quot; /&gt;&amp;lt;/object&gt;&lt;br /&gt;&lt;a href=&quot;http://www.vimeo.com/663940/l:embed_663940&quot;&gt;LA Developers Meetup &#8211; &lt;span class=&quot;caps&quot;&gt;JAN 29&lt;/span&gt; &#8211; Ben Sandofsky&lt;/a&gt; from &lt;a href=&quot;http://www.vimeo.com/user309459/l:embed_663940&quot;&gt;will jessup&lt;/a&gt; on &lt;a href=&quot;http://vimeo.com/l:embed_663940&quot;&gt;Vimeo&lt;/a&gt;.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;&amp;lt;object type=&quot;application/x-shockwave-flash&quot; height=&quot;300&quot; data=&quot;http://www.vimeo.com/moogaloop.swf?clip_id=664327&amp;amp;server=www.vimeo.com&amp;amp;fullscreen=1&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&quot; width=&quot;400&quot;&gt;    &amp;lt;param name=&quot;quality&quot; value=&quot;best&quot; /&gt;    &amp;lt;param name=&quot;allowfullscreen&quot; value=&quot;true&quot; /&gt;    &amp;lt;param name=&quot;scale&quot; value=&quot;showAll&quot; /&gt;    &amp;lt;param name=&quot;movie&quot; value=&quot;http://www.vimeo.com/moogaloop.swf?clip_id=664327&amp;amp;server=www.vimeo.com&amp;amp;fullscreen=1&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&quot; /&gt;&amp;lt;/object&gt;&lt;br /&gt;&lt;a href=&quot;http://www.vimeo.com/664327/l:embed_664327&quot;&gt;LA Developers Meetup &#8211; &lt;span class=&quot;caps&quot;&gt;JAN 29&lt;/span&gt; &#8211; Jonathan Gray&lt;/a&gt; from &lt;a href=&quot;http://www.vimeo.com/user309459/l:embed_664327&quot;&gt;will jessup&lt;/a&gt; on &lt;a href=&quot;http://vimeo.com/l:embed_664327&quot;&gt;Vimeo&lt;/a&gt;.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h2&gt;Geek News&lt;/h2&gt;


	&lt;p&gt;Because I know you all get that tingly feeling when something &lt;em&gt;geeky&lt;/em&gt; is announced.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;PostgreSQL 8.3 is out – http://www.postgresql.org/about/news.918&lt;/li&gt;
		&lt;li&gt;Macbook Air Review &#8211; http://www.37signals.com/svn/posts/832-holding-the-future-in-your-hand&lt;/li&gt;
		&lt;li&gt;Go to this &lt;a href=&quot;http://metaatem.net/selcolor.php&quot;&gt;site&lt;/a&gt; and then highlight the entire paragraph with your mouse (click drag). Cool stuff, take a look at the source to see how it&#8217;s done.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h2&gt;Cool &#38; Funny&lt;/h2&gt;


	&lt;p&gt;This guy is really amazing, he plays the guitar with his feet! Look at him rocking out, wow!&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&amp;lt;object height=&quot;355&quot; width=&quot;425&quot;&gt;&amp;lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/m3gMgK7h-BA&#38;rel=1&quot;&gt;&amp;lt;/param&gt;&amp;lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;&amp;lt;/param&gt;&amp;lt;embed type=&quot;application/x-shockwave-flash&quot; src=&quot;http://www.youtube.com/v/m3gMgK7h-BA&#38;rel=1&quot; height=&quot;355&quot; wmode=&quot;transparent&quot; width=&quot;425&quot;&gt;&amp;lt;/embed&gt;&amp;lt;/object&gt;&lt;/li&gt;
	&lt;/ul&gt;


And our &lt;span class=&quot;caps&quot;&gt;LOL&lt;/span&gt; pick of the day to calm the stress from all that programming: 
	&lt;ul&gt;
	&lt;li&gt;&lt;img src=&quot;http://icanhascheezburger.files.wordpress.com/2008/02/funny-pictures-lions-tigers-bears-cats.jpg&quot; alt=&quot;&quot; /&gt;&lt;/li&gt;
	&lt;/ul&gt;
          </content>  </entry>
  <entry xml:base="http://blog.citrusbyte.com">
    <author>
      <name>daniel</name>
    </author>
    <id>tag:blog.citrusbyte.com,2008-02-01:8</id>
    <published>2008-02-01T01:51:00Z</published>
    <updated>2008-02-01T01:53:35Z</updated>
    <link href="http://blog.citrusbyte.com/2008/2/1/a-spoon-full-of-updates" rel="alternate" type="text/html"/>
    <title>A Spoon Full of Updates</title>
<content type="html">
            &lt;p&gt;Howdy Ya&#8217;ll!&lt;/p&gt;


	&lt;p&gt;Looks like today&#8217;s update will be quite tasty, just like the double-decker Wendy burger I just ate. Yum!&lt;/p&gt;


	&lt;h2&gt;The Meetup&lt;/h2&gt;


	&lt;p&gt;The &lt;a href=&quot;http://web.meetup.com/34/&quot;&gt;meetup&lt;/a&gt; on Tuesday went really well. We had an attendance rate of over 100 people! How awesome is that? We will have a video up with all the coverage asap.&lt;/p&gt;


	&lt;h2&gt;Ruby News&lt;/h2&gt;


	&lt;p&gt;&lt;a href=&quot;http://blog.zenspider.com/archives/2008/01/hoe_version_150_has_been_released.html&quot;&gt;Hoe Version 1.50 Has Been Released&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;&lt;a href=&quot;http://blog.zenspider.com/archives/2008/01/zentest_version_390_has_been_released.html&quot;&gt;Zentest 3.90 Has been Released&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;&lt;a href=&quot;http://blog.hasmanythrough.com/2008/1/30/segregated-page-cache-storage&quot;&gt;Strategy for Cache Storage&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;&lt;a href=&quot;http://drnicwilliams.com/2008/01/31/get-ready-for-the-textmate-trundle-to-rails-20-bundle/&quot;&gt;Dr. Nic is the new Textmate Bundle Maintainer&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;&lt;a href=&quot;http://www.rubular.com&quot;&gt;Rails App for Regexp Expressions&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;&lt;a href=&quot;http://www.activemerchant.org/&quot;&gt;Active Merchant 1.3 Released&lt;/a&gt;&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;...&#8221;notable improvements with the 1.3 release include:&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;ul&gt;
	&lt;li&gt;Improved documentation&lt;/li&gt;
		&lt;li&gt;Common interface to &lt;span class=&quot;caps&quot;&gt;AVS&lt;/span&gt; / &lt;span class=&quot;caps&quot;&gt;CVV2&lt;/span&gt; results&lt;/li&gt;
		&lt;li&gt;New gateways, including Authorize.net Recurring Billing (ARB)&lt;/li&gt;
		&lt;li&gt;Improved supported feature set of many existing gateways&lt;/li&gt;
		&lt;li&gt;Automatically retry failed connections (when it’s safe)&#8221; 
&lt;a href=&quot;http://weblog.rubyonrails.com/2008/1/31/activemerchant-1-3-released&quot;&gt;source&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h2&gt;Damn Good Links to Read&lt;/h2&gt;


	&lt;p&gt;&lt;a href=&quot;http://www.pbs.org/wsw/news/fortunearticle_20031026_03.html&quot;&gt;Why the Head of Berkshire Isn&#8217;t buying the U.S Dollar&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;&lt;a href=&quot;smashingmagazine.com&quot;&gt;Smashing Magazine&lt;/a&gt; published a article on &lt;a href=&quot;http://www.smashingmagazine.com/2008/01/31/10-principles-of-effective-web-design/&quot;&gt;10 Principles of Effective Web-Design&lt;/a&gt;. Usability is the most important thing in any application and if your job is building websites, it&#8217;s &lt;em&gt;your job to understand&lt;/em&gt; what effective design is. Go on already, open the link in a new tab and read it!&lt;/p&gt;


	&lt;h2&gt;Of Course You Get Entertainment&lt;/h2&gt;


	&lt;p&gt;&lt;a href=&quot;http://www.news.com.au/mercury/story/0,22884,23136575-5005940,00.html&quot;&gt;China Is Stopping Rain From Falling&lt;/a&gt;&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&#8220;Our experiments with rain mitigation have been aimed at light rain,&#8221; said Zhang Qian, head of weather manipulation at the bureau.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&#8220;With heavy rain it is more difficult. The results with light rain have been satisfactory.&#8221;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2257/2234014390_88ac5ea0ae_o.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.citrusbyte.com">
    <author>
      <name>daniel</name>
    </author>
    <id>tag:blog.citrusbyte.com,2008-01-28:6</id>
    <published>2008-01-28T19:10:00Z</published>
    <updated>2008-04-11T23:35:55Z</updated>
    <link href="http://blog.citrusbyte.com/2008/1/28/updates-served-cold" rel="alternate" type="text/html"/>
    <title>Updates Served Cold</title>
<content type="html">
            &lt;h2&gt;The Meetup&lt;/h2&gt;


	&lt;blockquote&gt;
		&lt;p&gt;Our &lt;a href=&quot;http://web.meetup.com/34/&quot;&gt;Los Angeles Web Application Developers Meetup&lt;/a&gt; is tomorrow @ 8pm, sponsored at Fox Interactive Media. A lot of people are coming; &lt;em&gt;we estimate over 70 at least – wow!&lt;/em&gt;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&#8220;The format is the same as usual; four presenters sharing something interesting for 5-10 minutes each with a short Q&#38;A. Fox will be providing food and drinks for everyone so come hungry!&#8221;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;h2&gt;Ruby Links&lt;/h2&gt;


	&lt;p&gt;We help you stay in the Ruby game, so brush up on some of these updates to keep you in the loop:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;If you know Reddit, you should now know about &lt;a href=&quot;http://reddit.com/r/ruby/&quot;&gt;Ruby Reddit&lt;/a&gt;. If you &lt;em&gt;didn&#8217;t know about&lt;/em&gt; Reddit, you &lt;strong&gt;should still know&lt;/strong&gt; about Ruby Reddit if you&#8217;re a Ruby developer.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;There&#8217;s a new badass library in town, maybe not as badass as the new Rambo movie, but it allows you to create your own parsers with ease! Check it out, it&#8217;s called &lt;a href=&quot;http://treetop.rubyforge.org/&quot;&gt;Treetop&lt;/a&gt;.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Here&#8217;s one of my favorite features:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&#8220;There&#8217;s no need for a tokenization phase, and lookahead assertions can be used for a limited degree of context-sensitivity.&#8221;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;Anyone who was at Railsconf 2007 remember something similar that was demonstrated at the session where the security guy bailed, and was turned into a free-for-all stand? If you do, I think this is the released version of that demonstration. Which reminds me, 2008 &lt;a href=&quot;http://en.oreilly.com/rails2008/public/content/home&quot;&gt;Railsconf&lt;/a&gt; tickets open very soon; it could actually be tomorrow – the Railsconf website says tickets sell &#8221;...in late January.&#8221;&lt;/p&gt;


	&lt;h2&gt;Shout-outs&lt;/h2&gt;


	&lt;p&gt;Ari wanted to announce a 48-hour coding party when the iPhone &lt;span class=&quot;caps&quot;&gt;SDK&lt;/span&gt; hits the cloud in late February. If you live in Los Angeles and have an iPhone, I expect you to be there. Ari also wanted to say that &#8220;shawarma is good!&#8221;. Little known fact: it actually increases coding productivity; go eat some!&lt;/p&gt;


	&lt;h2&gt;Entertainment&lt;/h2&gt;


	&lt;p&gt;Because a good laugh or two before coding is just like a hearty breakfeast; damn good.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://sneezl.com/only-in-russia/&quot;&gt;Only in Russia Will You Find These Pictures&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
          </content>  </entry>
  <entry xml:base="http://blog.citrusbyte.com">
    <author>
      <name>will</name>
    </author>
    <id>tag:blog.citrusbyte.com,2008-01-09:2</id>
    <published>2008-01-09T23:40:00Z</published>
    <updated>2008-01-09T23:43:31Z</updated>
    <link href="http://blog.citrusbyte.com/2008/1/9/january-meetup-fox-interactive-media-announced" rel="alternate" type="text/html"/>
    <title>January Meetup @ Fox Interactive Media announced!</title>
<content type="html">
            We just announced that the January &lt;a href=&quot;http://web.meetup.com/34/&quot;&gt;Los Angeles Web Application Developers Meetup&lt;/a&gt; will be held on the 29th at Fox Interactive Media (FIM). 

&lt;blockquote&gt;Join us at Los Angeles's biggest meetup for web application developers. Find out what's new in development for the web. Presenters will allow you to pick up a few tips and tricks and find out about new tools. After our presentations enjoy refreshments (and beer) and network with other local developers.
&lt;/blockquote&gt;

Kindly, FIM is providing us space, food and drinks. 

See you all there.
          </content>  </entry>
</feed>
