<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3545886534042322597</id><updated>2022-07-14T06:49:17.114-07:00</updated><category term="merb"/><category term="datamapper"/><category term="ruby on rails"/><category term="code"/><category term="script"/><category term=":bundle"/><category term="active record"/><category term="book review"/><category term="css"/><category term="dm"/><category term="gem"/><category term="git"/><category term="hosting"/><category term="links"/><category term="logging"/><category term="mongrel"/><category term="orm"/><category term="package tracking"/><category term="rss"/><category term="scm"/><category term="swiftiply"/><category term="ups"/><category term="video"/><category term="web development"/><category term="web worker"/><title type='text'>Just In Time</title><subtitle type='html'>Web Dev and Other Ramblings by Justin Pease</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jit.nuance9.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-3809601497705502556</id><published>2009-11-28T09:37:00.000-08:00</published><updated>2009-11-28T10:40:26.767-08:00</updated><title type='text'>What If Hosting Was a Library?</title><content type='html'># Was thinking, &quot;if hosting was a library, what might it look like...&quot;&lt;br /&gt;&lt;br /&gt;require &#39;ProviderX&#39;&lt;br /&gt;&lt;br /&gt;# We&#39;ll pretend we already have an account with fictitious ProviderX&lt;br /&gt;&lt;br /&gt;host = ProviderX.new(:user =&gt; &#39;foo&#39;, :password =&gt; &#39;secret&#39;)&lt;br /&gt;&lt;br /&gt;# Let&#39;s see what ProviderX will allow us to deploy to&lt;br /&gt;&lt;br /&gt;host.provides&lt;br /&gt;&gt; [&#39;Amazon&#39;, &#39;Google&#39;]&lt;br /&gt;&lt;br /&gt;# Let&#39;s create a new environment to deploy to&lt;br /&gt;&lt;br /&gt;production = host.cloud.new(:vendor =&gt; &#39;Amazon&#39;, :name =&gt; &#39;production&#39;, :min_cpu =&gt; 2, :min_mem =&gt; 1024)&lt;br /&gt;&lt;br /&gt;# We also would need to define the application that we wish to deploy&lt;br /&gt;&lt;br /&gt;application = host.application.new(:repository =&gt; &#39;http://foo.com/foo.git&#39;, :type =&gt; &#39;Rails&#39;, :name =&gt; &#39;foo&#39;, :domain =&gt; &#39;foo.com&#39;, :ssl_enabled =&gt; true)&lt;br /&gt;&lt;br /&gt;# All set!  Let&#39;s deploy.&lt;br /&gt;&lt;br /&gt;application.deploy_to production&lt;br /&gt;&lt;br /&gt;application.deployed?&lt;br /&gt;&gt; true&lt;br /&gt;&lt;br /&gt;application.deployed_to&lt;br /&gt;&gt; [&#39;production&#39;]&lt;br /&gt;&lt;br /&gt;production.applications&lt;br /&gt;&gt; [&#39;foo&#39;]&lt;br /&gt;&lt;br /&gt;# Maybe we forgot that we want to redirect www.foo.com to foo.com&lt;br /&gt;&lt;br /&gt;application.redirects.add :from =&gt; &#39;www.foo.com&#39;, :to =&gt; &#39;foo.com&#39; &lt;br /&gt;&lt;br /&gt;# We don&#39;t want to deploy the code again, we just want to sync configuration changes (the redirect).&lt;br /&gt;&lt;br /&gt;application.sync_configs production&lt;br /&gt;&lt;br /&gt;# Perhaps we could control our resources from within our application&lt;br /&gt;&lt;br /&gt;if production.swapping?&lt;br /&gt;&amp;nbsp;&amp;nbsp;production.ram.add 128&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# That&#39;s it for my day-dreaming.</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/3809601497705502556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2009/11/what-if-hosting-was-library.html#comment-form' title='44 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/3809601497705502556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/3809601497705502556'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2009/11/what-if-hosting-was-library.html' title='What If Hosting Was a Library?'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>44</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-4665321812080413196</id><published>2008-09-27T07:49:00.001-07:00</published><updated>2008-09-27T07:55:22.286-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dm"/><category scheme="http://www.blogger.com/atom/ns#" term="gem"/><category scheme="http://www.blogger.com/atom/ns#" term="merb"/><category scheme="http://www.blogger.com/atom/ns#" term="script"/><title type='text'>Remove Gems By Prefix</title><content type='html'>If you are working with Merb or DM you know that approximately a gazillion gems are involved.  When, for whatever reason, I want to remove them it is a pain to do by hand.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here is a simple script to help:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;code&gt;#!/bin/bash&lt;/code&gt;&lt;/div&gt;&lt;code&gt;&lt;div&gt;prefix=$1&lt;/div&gt;&lt;/code&gt;&lt;div&gt;&lt;code&gt;gem list --local | grep $prefix  | awk &#39;{ print $1 }&#39; | xargs sudo gem uninstall&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I saved mine as remove_gem_by_prefix, gave it executable permissions and placed it in my path.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now I can issue the commands:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;$ remove_gem_by_prefix merb&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;or &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;$ remove_gem_by_prefix dm&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And they all get blasted.  You do need to be careful to make sure the prefix you provide is unique to the gems you wish to remove.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/4665321812080413196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2008/09/remove-gems-by-prefix.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/4665321812080413196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/4665321812080413196'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2008/09/remove-gems-by-prefix.html' title='Remove Gems By Prefix'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-8656493293512869240</id><published>2008-09-13T14:04:00.001-07:00</published><updated>2008-09-14T16:36:34.336-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="scm"/><category scheme="http://www.blogger.com/atom/ns#" term="script"/><title type='text'>Quick Remote Git Repository Creation Script</title><content type='html'>If you are using &lt;a href=&quot;http://git.or.cz/&quot;&gt;Git&lt;/a&gt; for your source code management, &lt;a href=&quot;http://www.github.com/&quot;&gt;GitHub&lt;/a&gt; is an awesome tool.  It especially shines for public projects where you freely allow others to fork your code and possibly pull patches back in.&lt;br /&gt;&lt;br /&gt;Sometimes I&#39;m just working on a project that I would prefer to keep in a private repository.  GitHub provides paying accounts with such an option.  However, I already have hosting accounts that are terribly underused.  Here is a little script I use to create a remote git repository on one of my VPS accounts that I can then pull from and push to.&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:large;&quot;&gt;Prerequisites&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;A hosting account  which you can ssh / scp into.&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:large;&quot;&gt;The Script&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;$ vim new_repo&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#! /bin/sh&lt;br /&gt;PWD=`pwd`&lt;br /&gt;&lt;br /&gt;# You must adjust these variables for your specifc hosting account.&lt;br /&gt;# Remote user you will connect as.&lt;br /&gt;REMOTE_USER=&quot;admin&quot;&lt;br /&gt;# The IP address you will SSH / SCP to.&lt;br /&gt;REMOTE_HOST=&quot;123.456.123.456&quot;&lt;br /&gt;# The remote path you wish to store your .git repositories in.&lt;br /&gt;REMOTE_REPO_PATH=&quot;/home/admin/repos/&quot;&lt;br /&gt;&lt;br /&gt;if [ -d $1 ]; then&lt;br /&gt;  echo &quot;EXITING: Local directory &#39;$1&#39; already exists.&quot;&lt;br /&gt;  exit 0&lt;br /&gt;else&lt;br /&gt;  mkdir $1&lt;br /&gt;  cd $1&lt;br /&gt;  git init-db&lt;br /&gt;  touch README&lt;br /&gt;  git add .&lt;br /&gt;  git commit -m &quot;Initial Repository Creation&quot;&lt;br /&gt;  cd ..&lt;br /&gt;  git clone --bare $1/.git $1.git&lt;br /&gt;  echo &quot;** Copying new repository $1.git to $REMOTE_HOST:$REMOTE_REPO_PATH&quot;&lt;br /&gt;  scp -r $1.git $REMOTE_USER@$REMOTE_HOST:$REMOTE_REPO_PATH&lt;br /&gt;  rm -rf $1.git&lt;br /&gt;  rm -rf $1&lt;br /&gt;  echo &quot;** Cloning locally at $PWD/$1&quot;&lt;br /&gt;  git clone $REMOTE_USER@$REMOTE_HOST:$REMOTE_REPO_PATH$1.git&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;exit 0&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:large;&quot;&gt;Or get it from GitHub&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://github.com/jpease/git-o-mator&quot;&gt;http://github.com/jpease/git-o-mator&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:large;&quot;&gt;Configuration&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Of course, you will need to REMOTE_USER=&quot;admin&quot; with an actual user on your hosting account, adjust REMOTE_HOST=&quot;123.456.123.456&quot; to point to your accounts IP address, and edit REMOTE_REPO_PATH=&quot;/home/admin/repos/&quot; with whatever path you wish to contain your Git repositories.&lt;br /&gt;&lt;br /&gt;Once that is done, provide executable permissions.&lt;br /&gt;&lt;br /&gt;$ chmod +x new_repo&lt;br /&gt;&lt;br /&gt;That&#39;s it.  Now if you execute:&lt;br /&gt;&lt;br /&gt;$ ./new_repo testing&lt;br /&gt;&lt;br /&gt;You will end up with /home/user/repos/testing.git on your remote host, and ./testing locally.  From ./testing you can git push  to send commits to the remote repository, and git pull to retrieve from the remote repository.&lt;br /&gt;&lt;br /&gt;If you see room for improvement, I&#39;m sure there is some, please leave a comment with your revision!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/8656493293512869240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2008/09/quick-remote-git-repository-creation.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/8656493293512869240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/8656493293512869240'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2008/09/quick-remote-git-repository-creation.html' title='Quick Remote Git Repository Creation Script'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-7296234539895008025</id><published>2008-06-23T18:55:00.001-07:00</published><updated>2008-06-23T19:11:46.405-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="datamapper"/><title type='text'>DataMapper: Many-to-many</title><content type='html'>You can define many-to-many associations using this syntax:&lt;br /&gt;&lt;br /&gt;#item.rb&lt;br /&gt;has n, :things, :through =&gt; Resource&lt;br /&gt;&lt;br /&gt;#thing.rb&lt;br /&gt;has n, :items, :through =&gt; Resource&lt;br /&gt;&lt;br /&gt;In this case it will create a table items_things to manage the assignments.  Easy enough.  Depending on the relationship you are mapping out, it may make more sense to use the :through =&gt; :model syntax.&lt;br /&gt;&lt;br /&gt;Now if you create an instance of an Item, you will get a method &quot;things=&quot;.  At first I thought this would be how you would assign a new Thing to your Item.  Such as:&lt;br /&gt;&lt;br /&gt;@item = Item.get(1)&lt;br /&gt;@thing = Thing.get(1)&lt;br /&gt;@item.things = @thing&lt;br /&gt;&lt;br /&gt;FAIL!  If you try adding a single Thing to your Item with this method you will receive a failure that the class you sent did not have a map method defined.  Ah, ok.   That makes sense, things= is obviously plural and will want an array of things.  So how do you assign just one thing?&lt;br /&gt;&lt;br /&gt;If you are unsure, a handy tool is to remember the &quot;methods&quot; method.  So in this case you can try out:&lt;br /&gt;&lt;br /&gt;@item.methods&lt;br /&gt;&lt;br /&gt;You will see that you have not only a &quot;things=&quot; method, but also a plain old &quot;things&quot; method.  If you try:&lt;br /&gt;&lt;br /&gt;@item.things.methods&lt;br /&gt;&lt;br /&gt;You will see that you have a &lt;&lt; method, as should be expected.  So to add our single Thing to our Item we do:&lt;br /&gt;&lt;br /&gt;@item.things &lt;&lt; @thing&lt;br /&gt;&lt;br /&gt;That&#39;s it.</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/7296234539895008025/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2008/06/datamapper-many-to-many.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/7296234539895008025'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/7296234539895008025'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2008/06/datamapper-many-to-many.html' title='DataMapper: Many-to-many'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-2071619242030888669</id><published>2008-06-06T20:08:00.000-07:00</published><updated>2008-06-06T20:15:33.052-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="datamapper"/><category scheme="http://www.blogger.com/atom/ns#" term="merb"/><category scheme="http://www.blogger.com/atom/ns#" term="orm"/><title type='text'>DataMapper: Parent / Child Relationship</title><content type='html'>I couldn&#39;t find an example at datamapper.org /docs for a parent child relationship.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After a little searching, I found the answer in the &lt;a href=&quot;http://github.com/sam/dm-core/tree/master/spec/integration/association_spec.rb&quot;&gt;integration tests&lt;/a&gt;.  Here is the example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; class Node&lt;br /&gt;   include DataMapper::Resource&lt;br /&gt;&lt;br /&gt;   def self.default_repository_name&lt;br /&gt;     ADAPTER&lt;br /&gt;   end&lt;br /&gt;&lt;br /&gt;   property :id, Integer, :serial =&gt; true&lt;br /&gt;   property :name, String&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;     has n, :children, :class_name =&gt; &#39;Node&#39;, :child_key =&gt; [ :parent_id ]&lt;br /&gt;   belongs_to :parent, :class_name =&gt; &#39;Node&#39;, :child_key =&gt; [ :parent_id ]&lt;/span&gt;&lt;br /&gt; end&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Hope that helps someone else.</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/2071619242030888669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2008/06/datamapper-parent-child-relationship.html#comment-form' title='45 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/2071619242030888669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/2071619242030888669'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2008/06/datamapper-parent-child-relationship.html' title='DataMapper: Parent / Child Relationship'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>45</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-8888189073701350254</id><published>2008-03-03T10:00:00.000-08:00</published><updated>2008-02-29T13:06:16.957-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="merb"/><title type='text'>Merb Monday: Vacation Edition</title><content type='html'>I&#39;m on vacation visiting family (with limited Internet access).  Back to semi-normal next week.</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/8888189073701350254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2008/03/merb-monday-vacation-edition.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/8888189073701350254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/8888189073701350254'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2008/03/merb-monday-vacation-edition.html' title='Merb Monday: Vacation Edition'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-7804365641224006792</id><published>2008-02-25T13:27:00.000-08:00</published><updated>2008-02-25T13:47:44.062-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="merb"/><title type='text'>Merb Monday: The Leap Year Edition</title><content type='html'>&lt;span style=&quot;font-weight: bold;font-size:130%;&quot; &gt;News&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://www.merbivore.com/documentation.html&quot;&gt;Official documentation&lt;/a&gt; has been updated to include 0.9.  Still a little light, but coming along.  If you would like to help, &lt;a href=&quot;http://gweezlebur.com/2008/2/1/so-you-want-to-contribute-to-merb-core-part-1&quot;&gt;create your own git branch&lt;/a&gt; and have at it!&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://gweezlebur.com/2008/2/19/michael-has_baby-true&quot;&gt;Ivey had a baby&lt;/a&gt;.  Congratulations!&lt;br /&gt;&lt;br /&gt;Expect 0.9.1 (developer release) today (or soon).&lt;br /&gt;&lt;br /&gt;You get an &quot;extra&quot; day this week.  Use it wisely.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Teaser&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Code name: &lt;a href=&quot;http://github.com/wvl/merb_demos/tree/master&quot;&gt;Merblets&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Q&amp;amp;A&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q: &lt;/span&gt;What!?  No RJS?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:130%;&quot; &gt;A:&lt;/span&gt; You can do anything rjs can do with *.js.erb templates (&lt;span style=&quot;font-style: italic;&quot;&gt;Answer by ezmobius&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; I read that Merb is template agnostic. What templates languages do I have available?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; erb out of the box (erubis), haml (merb_haml as a dependency in init.rb), markaby (&lt;span style=&quot;font-style: italic;&quot;&gt;Answer by sqred&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; What does a named route in Merb look like?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; r.match(&quot;/login&quot;).to(:controller =&gt; &quot;Sessions&quot;, :action =&gt; &quot;new&quot;).name(:login)&lt;br /&gt;(&lt;span style=&quot;font-style: italic;&quot;&gt;Answer by jodo&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; Does Merb have a debugger tool?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:130%;&quot; &gt;A:&lt;/span&gt; You can use ruby-debug.  Start Merb with the -D option to enable ruby-debug support.&lt;br /&gt;Enter &quot;debugger&quot; somewhere in your code as a breakpoint.  (&lt;span style=&quot;font-style: italic;&quot;&gt;Answer by jdempsey&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q: &lt;/span&gt;How do I find out what version of Merb I&#39;m using?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; merb -v (&lt;span style=&quot;font-style: italic;&quot;&gt;Answer by ezmobius&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; How can I see the current routes?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; merb -i&lt;br /&gt;      merb.show_routes&lt;br /&gt;      (&lt;span style=&quot;font-style: italic;&quot;&gt;Answer by ezmobius&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; Can the cookie session be used for large production apps?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; As long as you don&#39;t store really sensitive info in the session then cookie sessions are fine (&lt;span style=&quot;font-style: italic;&quot;&gt;Answer by ezmobius&lt;/span&gt;)</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/7804365641224006792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2008/02/merb-monday-leap-year-edition.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/7804365641224006792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/7804365641224006792'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2008/02/merb-monday-leap-year-edition.html' title='Merb Monday: The Leap Year Edition'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-1059409778585858816</id><published>2008-02-18T14:47:00.000-08:00</published><updated>2008-02-18T15:15:59.433-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="merb"/><title type='text'>Merb Monday: State of flux</title><content type='html'>This week&#39;s edition is a little short.  Certainly not for lack of activity in #merb, but due to the continued disturbance in the force caused by the 0.9 transition.&lt;br /&gt;&lt;br /&gt;0.5 to 0.9 is a big jump (no wonder they skipped 0.6, 0.7 and 0.8!)  Most of the discussion this week continued to be related to the transition to 0.9 and trouble ticket type &quot;stuff&quot;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;News&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://gweezlebur.com/2008/2/14/merb-0-9-0-released-kinda&quot;&gt;0.9 was released (kinda)&lt;/a&gt;, however this is a &quot;developer&quot; release and still has some wrinkles to be ironed out before a general public release will be pushed to RubyForge.  If you are anxious to give it a spin, check &lt;a href=&quot;http://merbivore.com/get_merb.html#stable&quot;&gt;Merbivore&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It looks like there will likely be a 0.9.1 &quot;developer&quot; release in the near future.  Once we get to a 0.9.x general public release things should settle down and this series should get back to normal.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://rubyforge.org/projects/merbful-auth/&quot;&gt;merbful_authentication&lt;/a&gt; should soon be updated to be compatible with 0.9.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Required Reading&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;0.9 introduces some really cool changes.  One of those is Rack integration.  You should read Ezra&#39;s post &quot;&lt;a href=&quot;http://brainspl.at/articles/2008/02/16/so-merb-core-is-built-on-rack-you-say-why-should-i-care&quot;&gt;So merb-core is built on rack you say? Why should I care?&lt;/a&gt;&quot;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; If I use ActiveRecord as the ORM, do I then use ActiveRecord&#39;s migrations (and its syntax) by default?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; Yes.  You can use ActiveRecord with Merb as you would with Rails.  (&lt;span style=&quot;font-style: italic;&quot;&gt;Answer by amoeba&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; How do you generate an app in Merb 0.9?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; ./script/generate is gone.  In it&#39;s place now lives merb-gen.&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;merb-gen myapp # a normal merb app&lt;br /&gt;&lt;br /&gt;merb-gen myapp --flat # a flattened app&lt;br /&gt;&lt;br /&gt;merb-gen myapp --very-flat # a single-file app&lt;/code&gt;&lt;/blockquote&gt;(&lt;span style=&quot;font-style: italic;&quot;&gt;Answer by ivey&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Answer Of The Week&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;And the answer to many of the questions this week which followed the format of:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; _____________________ in Merb 0.9?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; &quot;It&#39;s not in -core anymore&quot; (&lt;span style=&quot;font-style: italic;&quot;&gt;Answer by ivey&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Audience Participation&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; Assuming you are using ActiveRecord with Merb, how can you share models with a Rails application?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you leave your answer in the comments, I&#39;ll post it next week.  (&lt;a href=&quot;http://railspikes.com/2007/4/1/merb&quot;&gt;hint&lt;/a&gt;) (&lt;span style=&quot;font-style: italic;&quot;&gt;Question &amp;amp; link by seebg&lt;/span&gt;)</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/1059409778585858816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2008/02/merb-monday-state-of-flux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/1059409778585858816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/1059409778585858816'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2008/02/merb-monday-state-of-flux.html' title='Merb Monday: State of flux'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-4471911985405373941</id><published>2008-02-11T06:37:00.000-08:00</published><updated>2008-02-11T11:38:56.433-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="merb"/><title type='text'>Merb Monday: &quot;That&#39;s the spirit&quot;</title><content type='html'>Tidbits from #merb for the week of Feb 4 - Feb 10.&lt;br /&gt;&lt;br /&gt;A lot of the conversation this week revolved around the pre 0.9 release.  Many of the questions involved bugs or other issues that one can expect in a pre-release.  In general I didn&#39;t include them as they will quickly be outdated and likely be of little on going value.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; How do I install (freeze) gems within my application?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; Navigate to the root of your Merb application.&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;gem install foo -i gems&lt;/code&gt;&lt;/blockquote&gt;In your merb.yml file include a line:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;dependency &quot;foo&quot;&lt;/code&gt;&lt;/blockquote&gt;(&lt;span style=&quot;font-style: italic;&quot;&gt;Answer by wycats&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q: &lt;/span&gt;How do I support a new MIME type?  Say for an Atom feed.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; &lt;blockquote&gt;&lt;code&gt;Merb.add_mime_type(:atom,:to_atom,%w[application/x-atom])&lt;/code&gt;&lt;/blockquote&gt;Replace application/x-atom with whatever the correct header for atom is then make a template: foo.atom.erb&lt;br /&gt;&lt;br /&gt;In your controller, use:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;provides :atom&lt;/code&gt;&lt;/blockquote&gt;(&lt;span style=&quot;font-style: italic;&quot;&gt;Answer by ezmobius&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; Where could I define a constant which would then be accessible in different views, but should have a different value depending on the environment merb is running in?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; config/environment/*.rb where * represents the desired environment, for example development.rb.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; How do I find the current controller and action in the view?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A: &lt;/span&gt;&lt;/span&gt;In a helper you could create the two following methods.&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;def controller_name&lt;br /&gt;controller.request.controller_name.split(&#39;_&#39;).first&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;def action_name&lt;br /&gt;controller.request.action&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;(&lt;span style=&quot;font-style: italic;&quot;&gt;Answer by slurry&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; What happened to MERB_ENV?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:130%;&quot; &gt;A:&lt;/span&gt; Merb&#39;s application constants have been re-factored as follows:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;Old  constant        : New method&lt;br /&gt;&lt;br /&gt;MERB_FRAMEWORK_ROOT  :  Merb.framework_root&lt;br /&gt;MERB_ROOT                                          :  Merb.root&lt;br /&gt;MERB_VIEW_ROOT                      :  Merb.view_path&lt;br /&gt;MERB_SKELETON_DIR     :  Merb.skeleton_path&lt;br /&gt;MERB_LOGGER                                 :  Merb.logger&lt;br /&gt;MERB_PATHS                                      :  Merb.load_paths&lt;br /&gt;MERB_ENV                                              :  Merb.environment&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;(&lt;span style=&quot;font-style: italic;&quot;&gt;Answer by slurry&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; Is there a way to list all the generators available?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A: &lt;/span&gt;&lt;/span&gt;ruby ./script/generate&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; Where is the source now?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; The Merb project has switched from using SVN to Git for source code management.  With that change the source is now at &lt;a href=&quot;http://www.github.com/&quot;&gt;Github&lt;/a&gt;.  Specifically you will want to use wycats repo, which you can find at:  git://github.com/wycats/&lt;br /&gt;&lt;br /&gt;The source code is broken down into merb-core, merb-more, and merb-plugins.&lt;br /&gt;&lt;br /&gt;For more information on how to work with Git, see &quot;&lt;a href=&quot;http://gweezlebur.com/2008/2/1/so-you-want-to-contribute-to-merb-core-part-1&quot;&gt;So you want to contribute to Merb-core&lt;/a&gt;&quot;.&lt;br /&gt;&lt;br /&gt;Once you have cloned the Git repos to your local system, you will then move into that directory and issue a &quot;rake install&quot; command to build the gem.&lt;br /&gt;(&lt;span style=&quot;font-style: italic;&quot;&gt;Answer by ivey&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; Where are bugs / tickets being tracked now?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; Along with the move to Github, bugs and ticket tracking has been moved from DevJaVu over to Lighthouse, specifically at &lt;a href=&quot;http://merb.lighthouseapp.com/&quot;&gt;merb.lighthouseapp.com&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Answer of the week&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here is one little snippet of conversation that may provide the answer regardless of your specific problem:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; Can I do _____________?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;u&gt;hassox&lt;/u&gt;: I guess so&lt;br /&gt;&lt;u&gt;hassox&lt;/u&gt;: but I can&#39;t really help you on it...&lt;br /&gt;&lt;u&gt;grrt&lt;/u&gt;: :) I&#39;ll see how far I get&lt;br /&gt;&lt;u&gt;hassox&lt;/u&gt;: that&#39;s the spirit :)&lt;br /&gt;&lt;u&gt;grrt&lt;/u&gt;: it&#39;s great to just explore&lt;br /&gt;&lt;br /&gt;Sometimes it&#39;s best to just try something out.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Audience Participation&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Q:&lt;/span&gt; Merb-core has methods &quot;render&quot; and &quot;display&quot;.  What&#39;s the difference?  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Leave your answer in the comments.  (&lt;a href=&quot;http://github.com/wycats/merb-core/tree/master/docs/new_render_api&quot;&gt;Hint&lt;/a&gt;)</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/4471911985405373941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2008/02/merb-monday-thats-spirit.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/4471911985405373941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/4471911985405373941'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2008/02/merb-monday-thats-spirit.html' title='Merb Monday: &quot;That&#39;s the spirit&quot;'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-1050600569932261377</id><published>2008-02-04T09:00:00.000-08:00</published><updated>2008-02-04T07:27:36.526-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="merb"/><title type='text'>Merb Monday: Environment variables, partials, etc.</title><content type='html'>I see a lot questions asked and answered in the #merb IRC room.&lt;br /&gt;&lt;br /&gt;Many of them are questions that later I wish I remembered the answer to!  So I&#39;m going to try to keep track of questions I see asked and answered and record them here for the benefit of myself and others, and hopefully publish them here every Monday.&lt;br /&gt;&lt;br /&gt;I might re-phrase the questions and answers slightly, as the writing tends to be quite terse on IRC.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Q: &lt;span style=&quot;font-size:100%;&quot;&gt;How do you check the current environment in Merb? I&#39;m looking for the Merb equivalent to RAILS_ENV.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; Merb.environment &lt;span style=&quot;font-style: italic;&quot;&gt;(Answered by: Booster)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Q: How do you render partials?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; You use the &lt;a href=&quot;http://merb.rubyforge.org/classes/Merb/RenderMixin.html#M000128&quot;&gt;partial&lt;/a&gt; method.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Scenario 1&lt;/u&gt;: You wish to render a partial template found in the same directory as your action&#39;s view template.&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;partial :foo&lt;/code&gt;&lt;/blockquote&gt;This will look in the current directory for a file named _foo.html.erb&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Scenario 2&lt;/u&gt;: You wish to render a partial template found in a different directory than the action&#39;s view template.&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;partial &#39;common/foo&#39;&lt;/code&gt;&lt;/blockquote&gt;This will look for the file views/common/_foo.html.erb&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;(Answered by: jp_n9)&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Q: I&#39;m trying to run my db:migrate and I&#39;m getting a &quot;no such file to load -- spec/rake/spectask&quot; error.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; Make sure you have the rspec gem installed.&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;sudo gem install rspec&lt;/code&gt;&lt;/blockquote&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;(Answered by: octopod)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Q: How do I start merb in production mode?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; Use the -e option.  For example,&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;merb -e production&lt;/code&gt;&lt;/blockquote&gt;For a complete list of parameters type:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;merb --help&lt;/code&gt;&lt;/blockquote&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;(Answered by: Phoop)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Q: How do I get Merb to log data to the log file?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; Make sure that you start Merb as a daemon with the -d directive, this will cause output to be logged to the log file located in the log/ directory (instead of being output to the console window).&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;merb -d&lt;/code&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;(Answered by: ezmobius)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Q: How can I use HAML for my templates?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;A:&lt;/span&gt;&lt;/span&gt; Name your files with the .html.haml extension instead of the default .html.erb extension.&lt;br /&gt;&lt;br /&gt;Example: name.html.haml&lt;br /&gt;&lt;br /&gt;Second, you need to edit dependencies.rb to include the line:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;dependency &quot;haml&quot;&lt;/code&gt;&lt;/blockquote&gt;You will also need to have the haml gem installed on your system.  Restarting Merb will also likely be required. &lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;(Answered by: QaDeS, bradly)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Q: Is there an easy way to get the current URL in a merb view?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:130%;&quot; &gt;A:&lt;/span&gt; I think it&#39;s request.uri&lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt; (Answered by: hassox)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;In my  testing the request variable does not appear to be directly available from a view template.  However if you need that information you can easily pass the entire request variable, or just request.uri, into your view from the controller.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/1050600569932261377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2008/02/merb-faqs-environment-variables.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/1050600569932261377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/1050600569932261377'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2008/02/merb-faqs-environment-variables.html' title='Merb Monday: Environment variables, partials, etc.'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-6449767459235924911</id><published>2008-01-18T12:01:00.000-08:00</published><updated>2008-01-18T14:35:56.584-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=":bundle"/><category scheme="http://www.blogger.com/atom/ns#" term="css"/><category scheme="http://www.blogger.com/atom/ns#" term="merb"/><title type='text'>Merb: Multiple CSS files, one server request.</title><content type='html'>In my previous post &lt;a href=&quot;http://jit.nuance9.com/2007/11/continued-education-performance-yahoo.html&quot;&gt;Continued Education: Performance Yahoo&lt;/a&gt; I referred to Steve Souder&#39; book &quot;High Performance Web Sites&quot;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Rule #1 is &quot;Make fewer HTTP requests.&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now we already know that &lt;a href=&quot;http://merbivore.com/&quot;&gt;Merb&lt;/a&gt; is &quot;built for speed&quot;, but generally that is considered within the context of the server side of things.&lt;br /&gt;&lt;br /&gt;I was happy to see that Merb also allows us to follow Souder&#39;s #1 Rule for making the client side snappy too.  So how does Merb allow us to make fewer HTTP requests?  By dynamically combining multiple stylesheet or script files into one.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:130%;&quot; &gt;Let&#39;s see some code!&lt;/span&gt;&lt;br /&gt;It&#39;s this simple:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;&lt;br /&gt;# app/views/layout/application.html.erb&lt;br /&gt;&lt;% require_css :reset %&gt;&lt;br /&gt;&lt;% require_css :master %&gt;&lt;br /&gt;&lt;%= include_required_css :bundle =&gt; true %&gt;&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;We define the various CSS files we wish to be included using require_css (in this example reset.css and master.css), then by setting the :bundle =&gt; true paramenter everything will be served up in a single HTTP request in a file called  all.css!  Now that&#39;s pretty cool.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:130%;&quot; &gt;But wait there&#39;s more!&lt;/span&gt;&lt;br /&gt;The same technique works for Javascripts too.&lt;br /&gt;You can have the same functionality for your javascripts using this syntax:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;&lt;% require_js :foo $&gt;&lt;br /&gt;&lt;%= include_required_js :bundle =&gt; true %&gt;&lt;br /&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;span style=&quot;font-weight: bold;font-size:130%;&quot; &gt;But wait there&#39;s even more!&lt;/span&gt;&lt;br /&gt;Now what is really cool is that you don&#39;t have to place your require_css or require_js statements only in the layout.  You can place those in your views or even partials.  &lt;strike&gt;That means that for any given request, the bundled file will only include the files that are needed for that specific view.&lt;/strike&gt; Edit: It looks like you may need to manually define and uniquely name each possible combination of files.  It also appears that a CSS file required in a view will appear first in the generated combined CSS file and thus be over ridden by the (likely) more general file defined in the layout - which probably isn&#39;t the desired behavior.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:130%;&quot; &gt;Getting it to work&lt;/span&gt;&lt;br /&gt;By default the bundling action should only occur when in production mode.  At the moment (Merb 0.5.2) it appears there is a bug and the bundling action doesn&#39;t realize when it is in production mode - so nothing happens.&lt;br /&gt;&lt;br /&gt;What you need to do is edit your config/merb.yml file and uncomment the line that reads:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;:bundle_assets: true&lt;/code&gt;&lt;/blockquote&gt;That&#39;s it!  Should work.  Enjoy.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;One Gottcha&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;By forcing :bundle_assets to true in the merb.yml file, we are enabling this functionality for all environments instead of just for production.  This isn&#39;t really ideal&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Credits&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Thanks to dudleyf in #merb for helping me figure this out.  Thanks to &lt;a href=&quot;http://blog.codahale.com/&quot;&gt;codahale&lt;/a&gt; for writing the code for :bundle.</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/6449767459235924911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2008/01/merb-multiple-css-file-one-server.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/6449767459235924911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/6449767459235924911'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2008/01/merb-multiple-css-file-one-server.html' title='Merb: Multiple CSS files, one server request.'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-5370203534602407814</id><published>2007-12-10T07:14:00.000-08:00</published><updated>2007-12-10T07:24:15.289-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="logging"/><category scheme="http://www.blogger.com/atom/ns#" term="merb"/><title type='text'>Merb Tidbit: Logging</title><content type='html'>Merb has it&#39;s handy built in Mongrel server, so you can easily start it up while developing with:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;merb&lt;/code&gt;&lt;/pre&gt;However, you may wonder &quot;Why isn&#39;t it generating any log files?&quot;&lt;br /&gt;&lt;br /&gt;Well actually it is, but the deal is they are all being output to the command line instead of being written to a file in the log/ directory.  If you want to have them written to a log file, you need to start Merb up as a daemon.  This is simply done like so:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;merb -d&lt;/code&gt;&lt;/pre&gt;Now your logs will be written to the log/ directory.  To stop the background merb process, use the -k PORT flag.  For example, if you are running on port 4000 (which is the default) you would use:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;merb -k 4000&lt;/code&gt;&lt;/pre&gt;You can also control the level of detail to be logged using the -l flag.  Optional logging levels which can be passed with the -l flag include:  DEBUG, INFO, WARN, ERROR and FATAL.&lt;br /&gt;&lt;br /&gt;That&#39;s today&#39;s Merb tidbit.  Happy Merbing!</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/5370203534602407814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2007/12/merb-tidbit-logging.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/5370203534602407814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/5370203534602407814'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2007/12/merb-tidbit-logging.html' title='Merb Tidbit: Logging'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-6978810230048441384</id><published>2007-11-15T10:33:00.000-08:00</published><updated>2008-01-31T11:37:44.356-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hosting"/><category scheme="http://www.blogger.com/atom/ns#" term="mongrel"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails"/><category scheme="http://www.blogger.com/atom/ns#" term="swiftiply"/><title type='text'>Rails on Swiftiply / Mongrel</title><content type='html'>Hosting Ruby on Rails is complicated, right?  Not necessarily.  Let&#39;s take a look at a fast and flexible way to serve up your Rails application.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Rails on Swiftiply / Mongrel&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;If you have done any reading or work with Rails you have probably heard of &lt;a href=&quot;http://mongrel.rubyforge.org/&quot;&gt;Mongrel&lt;/a&gt;.  According to the Mongrel site, &quot;Mongrel is a fast HTTP library and server for Ruby&quot;.&lt;br /&gt;&lt;br /&gt;You may not have heard of &lt;a href=&quot;http://swiftiply.swiftcore.org/&quot;&gt;Swiftiply&lt;/a&gt; yet.  But you will.  Well, actually I guess you just did.  But you will no doubt be hearing &lt;span style=&quot;font-weight: bold;&quot;&gt;more&lt;/span&gt; about it.  Swiftiply &quot;is a very fast, narrowly targetted clustering proxy&quot;.  The Swiftiply website says &quot;scaling your web applications should be easy&quot;.  Sounds good to me.  Let&#39;s see if it is!&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:130%;&quot;&gt;Prerequisites&lt;/span&gt;&lt;br /&gt;We will assume that you have already properly installed and configured the following:&lt;br /&gt;Ruby&lt;br /&gt;RubyGems&lt;br /&gt;Rails&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;Version Info&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Here are the most recent versions tested at the time of this article.  Different versions may cause varying results.&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;OS: Ubuntu 7.10&lt;/li&gt;&lt;li&gt;Ruby: 1.8.6&lt;/li&gt;&lt;li&gt;RubyGems: 1.0.1&lt;/li&gt;&lt;li&gt;Swiftiply: 0.6.1.1&lt;/li&gt;&lt;li&gt;Mongrel: 1.1.3&lt;/li&gt;&lt;li&gt;Rails: 2.0.2&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Installation: It&#39;s a breeze.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;code&gt;sudo gem install mongrel --include-dependencies&lt;br /&gt;sudo gem install swiftiply --include-dependencies&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;I told you it was a breeze.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Configuration: Piece of cake.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Let&#39;s go ahead and configure Swiftiply first.  Swiftiply does not install a configuration file for you, so you are creating a new blank file in the following step:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;code&gt;sudo vim /etc/swiftiply.conf&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;Here is the configuration that I used:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;code&gt;cluster_address: 123.45.678.9  # Use your IP here&lt;br /&gt;cluster_port: 80&lt;br /&gt;daemonize: true&lt;br /&gt;epoll: true&lt;br /&gt;epoll_descriptors: 20000&lt;br /&gt;map:&lt;br /&gt;- incoming:&lt;br /&gt; - sample.com&lt;br /&gt; - www.sample.com&lt;br /&gt;outgoing: 127.0.0.1:30000 # Where Mongrels will connect&lt;br /&gt;default: true&lt;br /&gt;docroot: /var/www/sample.com/current # Rails root&lt;br /&gt;cache_directory: public&lt;br /&gt;redeployable: true&lt;br /&gt;cache_extensions:&lt;br /&gt; - htm&lt;br /&gt; - html&lt;br /&gt; - txt&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;Amazingly that is all that is required in the way of configuration.  If you wanted to serve up other applications on other domains or sub-domains, simply repeat the &quot;map:&quot; section for each.&lt;br /&gt;&lt;br /&gt;Start up Swiftiply with:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;code&gt;swiftiply -c /etc/swiftiply.conf&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;With Swiftiply running, now all you need to do is start Mongrel(s) from within the directory of the Rails app you wish to serve.  We let the system know that we want to use the special Swiftiply version of Mongrel with the &quot;env SWIFT=1&quot; directive.  We also tell them to connect to the IP and port that you defined in your swiftiply.conf, like so:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;code&gt;env SWIFT=1 mongrel_rails start -d -a 127.0.0.1 -p 30000&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;You may also wish to include the directive &quot;-e production&quot;, but I ran out of room on the line! ;)&lt;br /&gt;&lt;br /&gt;Now if you want multiple mongrels serving up your app, just start another one up exactly the same.  Same IP and port.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;And now... your done.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;And that is it.  You have your basic Swiftiply / Mongrel stack setup.&lt;br /&gt;&lt;br /&gt;Keep your eyes on Swiftiply as there will be some exciting new features be adding in the coming weeks and months.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:130%;&quot;&gt;Performance&lt;/span&gt;&lt;br /&gt;With a blank Rails 1.2.5 application I show the following memory usages in &quot;top&quot;:&lt;br /&gt;&lt;br /&gt;Ruby (Mongrel): 47M&lt;br /&gt;Swiftiply: 17M&lt;br /&gt;&lt;br /&gt;For some statistics on performance of Swiftiply, please see the post &quot;&lt;a href=&quot;http://www.webficient.com/2007/08/testing-various-configurations-of-rails.html&quot;&gt;Testing Various Configurations of Rails, Merb, Swiftiply and Nginx&lt;/a&gt;&quot; on Webficient.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:130%;&quot;&gt;Stuff To Know&lt;/span&gt;&lt;br /&gt;Here are a couple things to remember about Swiftiply as you are setting it up:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Each application you wish to serve will be linked to ONE port.&lt;/li&gt;&lt;li&gt;All mongrels serving that application will connect to the exact same ONE port.&lt;/li&gt;&lt;li&gt;Even if you have (n) mongrels, they all connect to the exact same ONE port per application.&lt;/li&gt;&lt;li&gt;Swiftiply can serve multiple applications, just repeat the part from &quot;map:&quot; down in the swiftiply.conf file assigning your new application a single unique port.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:large;&quot;&gt;Useful?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;If so, why not &lt;a href=&quot;http://www.workingwithrails.com/recommendation/new/person/6666-justin-pease&quot;&gt;recommend me on Working With Rails&lt;/a&gt;!&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/6978810230048441384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2007/11/rails-on-swiftiply-mongrel.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/6978810230048441384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/6978810230048441384'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2007/11/rails-on-swiftiply-mongrel.html' title='Rails on Swiftiply / Mongrel'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-6221873662644164086</id><published>2007-11-12T07:44:00.000-08:00</published><updated>2007-11-12T08:16:03.290-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="active record"/><category scheme="http://www.blogger.com/atom/ns#" term="book review"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails"/><title type='text'>Book Review: Pro Active Record</title><content type='html'>Title: Pro Active Record: Databases with Ruby and Rails.&lt;br /&gt;Authors: Kevin Marshall, Chad Pytel, and Jon Yurek&lt;br /&gt;&lt;br /&gt; Visuals:&lt;br /&gt;Font size and layout are good.  Easy on the eyes.  Large and frequent sub-headings make it easier to locate information.&lt;br /&gt;&lt;br /&gt;Audience:&lt;br /&gt;The book lists it&#39;s intended &quot;User level&quot; at &quot;Intermediate-Advanced&quot;.&lt;br /&gt;&lt;br /&gt;Practicality:&lt;br /&gt;It really depends on what you are expecting.  I&#39;ve been using Rails and ActiveRecord for about 2 years, so I should fit into the target audience.  After reading the book I think it will be a great reference book to have within arm&#39;s reach while working with ActiveRecord.  To me it will serve as an API to AR.  So it will be practical in that sense. &lt;br /&gt;&lt;br /&gt;On the other hand, while reading it I never experienced any &quot;aha!&quot; moments where I felt like I learned something new or exciting, which I had hoped for.&lt;br /&gt;&lt;br /&gt;If you are a beginner (never having used AR) it will definitely save you time (and eye strain) hunting down tutorials on blogs.&lt;br /&gt;&lt;br /&gt;Overall:&lt;br /&gt;It&#39;s a good Active Record reference &amp;amp; usage tutorial(s).  I would have appreciated this book even more when I was first starting to use the Ruby on Rails framework.  So if you are a beginner, don&#39;t let the &quot;Intermediate - Advanced&quot; user level scare you off.  Active Record is not a terribly complicated subject, and if you are using Rails (as a beginner or not) you will probably be using Active Record too.&lt;br /&gt;&lt;br /&gt;I was kind of surprised when I read the Introduction to the book that it starts off with:&lt;br /&gt;&lt;br /&gt;&quot;Is there really enough to talk about in Active Record to fill a whole book?&quot;&lt;br /&gt;&lt;br /&gt;&quot;Our answer, then and now, is, &quot;Yes and no&quot;&quot;&lt;br /&gt;&lt;br /&gt;As an &quot;Intermediate - Advanced&quot; user, that&#39;s kind of how I felt at the end of this &quot;Pro&quot; book.</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/6221873662644164086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2007/11/book-review-pro-active-record.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/6221873662644164086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/6221873662644164086'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2007/11/book-review-pro-active-record.html' title='Book Review: Pro Active Record'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-4667921518787177103</id><published>2007-11-07T08:02:00.000-08:00</published><updated>2008-02-25T15:15:20.296-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="datamapper"/><category scheme="http://www.blogger.com/atom/ns#" term="merb"/><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><title type='text'>Merb &amp; Datamapper: Getting Rolling</title><content type='html'>Today we want to take a look at &lt;a href=&quot;http://merbivore.org/&quot;&gt;Merb&lt;/a&gt; and &lt;a href=&quot;http://www.datamapper.org/&quot;&gt;DataMapper&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(153, 0, 0); font-weight: bold;&quot;&gt;NOTE:&lt;/span&gt; I&#39;m doing this run through on OS X.  If you are using a different OS, some of the instructions may need modifications (specifically in regards to path locations).  This post also assumes that you are using MySQL, which you should already have installed (including the MySQL gem).&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:130%;&quot; &gt;Merb: A Web Framework&lt;/span&gt;.&lt;br /&gt;&lt;strike&gt;Yesterday marked the 0.4 release of Merb.  At this point it should be fairly stable.  Stable enough to make it, at the very least, worth a run through.&lt;/strike&gt;  A few months have passed since the original tutorial, and since then Merb has released versions 0.4.1, 0.4.2, 0.5.0, 0.5.1, 0.5.2 and 0.5.3.  Since 0.5.3 there has been a large amount of work done in putting together the 0.9.x release.  At the time of this update, 0.9 is a &quot;developer&quot; release.  I will be updating these instructions soon.&lt;br /&gt;&lt;br /&gt;Merb, like Ruby on Rails, is an MVC web framework.  The Merb project has goals of being performance oriented and providing flexibility through plugins.  This should allow a developer to better mix and match available tool sets to the specific needs of any given project.&lt;br /&gt;&lt;br /&gt;One of the areas of flexibility that Merb provides is in the use of an Object Relational Mapper (ORM).  You may have heard of, or be familiar with, ActiveRecord which is the ORM provided by default within the Ruby on Rails framework.  You can use ActiveRecord with Merb, but you also have other ORM options such as DataMapper and Sequel.&lt;br /&gt;&lt;br /&gt;So let&#39;s get started.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:130%;&quot; &gt;Installation (outdated - still is 0.4 based)&lt;/span&gt;&lt;br /&gt;First off you need to get Merb &amp;amp; DataMapper installed on your machine.  Assuming that you already have Ruby and Gems installed on your system, installation is as simple as:&lt;br /&gt;&lt;blockquote style=&quot;font-weight: bold;&quot;&gt;&lt;pre&gt;&lt;code&gt;sudo gem install merb --include-dependencies&lt;br /&gt;sudo gem install datamapper&lt;br /&gt;&lt;/code&gt;&lt;code&gt;sudo gem install ruby2ruby --include-dependencies&lt;/code&gt;&lt;br /&gt;&lt;code&gt;sudo gem install merb_datamapper ??&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;UPDATE: Merb does depend on the json gem (json_pure if you want to use it on jruby).  This &quot;should&quot; be installed when you install &quot;merb --include-dependencies&quot;, but some readers have reported that it wasn&#39;t.  So just to be safe, run:&lt;br /&gt;&lt;blockquote style=&quot;font-weight: bold;&quot;&gt;&lt;pre&gt;&lt;code&gt;sudo gem install json&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;Lastly, we need to make sure DataObjects.rb drivers are installed. You should now be able to install as a gem:&lt;br /&gt;&lt;blockquote style=&quot;font-weight: bold;&quot;&gt;&lt;pre&gt;&lt;code&gt;sudo gem install do_mysql&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;UPDATE (12/11/07): benr75 reports: &quot;The do_mysql gem is currently broken and refers to an absolute path for MySQL that may not exist on users systems.  &lt;a href=&quot;http://blog.kineticweb.com/articles/2007/12/06/bad-do_mysql-0-2-2-gem&quot; rel=&quot;nofollow&quot;&gt;Fix instructions here.&lt;/a&gt;&quot;&lt;br /&gt;&lt;br /&gt;Other possibly useful resources are: &lt;a href=&quot;http://blog.heimidal.net/2007/10/30/installing-datamapper-on-leopard&quot;&gt;post on Blog::Heimidal&lt;/a&gt; and the DataMapper &lt;a href=&quot;http://datamapper.org/getting_started.html&quot;&gt;Getting Started page&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Assuming everything went smoothly for you, we are now ready to roll.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Generate &amp;amp; Configure Your New Merb Project (updated to 0.9)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Next we will be generating the default framework files.&lt;br /&gt;&lt;br /&gt;Change to the directory where you wish to create your Merb project.  For me that was:&lt;br /&gt;&lt;blockquote style=&quot;font-weight: bold;&quot;&gt;&lt;pre&gt;&lt;code&gt;cd /Users/justin/programming/projects/&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;Similar to Rails, to generate the framework code we simply run:&lt;br /&gt;&lt;blockquote style=&quot;font-weight: bold;&quot;&gt;&lt;pre&gt;&lt;code&gt;merb-gen project_name&lt;br /&gt;cd project_name&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;As mentioned before we need to configure our Merb application to let it know that we want to use the DataMapper ORM, and setup our database.  Pretty simple stuff.  Just a few text edits in 2 files.&lt;br /&gt;&lt;br /&gt;First, open &lt;span style=&quot;font-weight: bold;&quot;&gt;config/init.rb&lt;/span&gt; and find and uncomment the following line as below:&lt;br /&gt;&lt;blockquote style=&quot;font-weight: bold;&quot;&gt;&lt;pre&gt;&lt;code&gt;### Uncomment for DataMapper ORM&lt;br /&gt;use_orm :datamapper&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;The only other file we need to setup is our database configuration file.  When you initially generated your project code Merb did not create this file.  Why?  Because you hadn&#39;t yet told it what ORM you wanted to use.&lt;br /&gt;&lt;br /&gt;Since we have edited the dependencies.rb file to indicate we will be using the DataMapper ORM, all we now need to do is load the Merb framework and it will auto-generate a sample database configuration file for us.  This sample file will be based on the specific requirements of the ORM we have chosen.  So from the command line run:&lt;br /&gt;&lt;blockquote style=&quot;font-weight: bold;&quot;&gt;&lt;pre&gt;&lt;code&gt;merb&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;Easy.  Merb saw that you wanted to use DataMapper, but no database has been configured.  Automatically the database.sample.yml file was then generated.  Now let&#39;s finish up our configuration of Merb.  Open &lt;span style=&quot;font-weight: bold;&quot;&gt;config/database.sample.yml &lt;/span&gt;and edit it according to your specific setup.  For example mine looks like:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;code&gt;---&lt;br /&gt;# This is a sample database file for the DataMapper ORM&lt;br /&gt;:development: &amp;amp;defaults&lt;br /&gt;:adapter: mysql&lt;br /&gt;:database: merbtest_development&lt;br /&gt;:username: root&lt;br /&gt;:password:&lt;br /&gt;:host: localhost&lt;br /&gt;&lt;br /&gt;:test:&lt;br /&gt;&lt;&lt;: *defaults      :database: merbtest_test              :production:      &lt;&lt;: *defaults      :database: merbtest_production&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;Don&#39;t forget to copy or rename the file to database.yml.&lt;br /&gt;&lt;br /&gt;Also, the databases that you just configured in database.yml need to actually exist, so if you haven&#39;t done so already please take a moment to create them now.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;That&#39;s It!&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;With those two simple configuration steps, our bare bones application should now be ready to roll.  To start up, from within your application directory type:&lt;br /&gt;&lt;blockquote style=&quot;font-weight: bold;&quot;&gt;&lt;pre&gt;&lt;code&gt;merb&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;By default Merb is setup to run on port 4000 of host 0.0.0.0.  So open up your browser and point it to:&lt;br /&gt;&lt;blockquote style=&quot;font-weight: bold;&quot;&gt;&lt;pre&gt;&lt;code&gt;http://0.0.0.0:4000/&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;You should now see the Merb default page before you.&lt;br /&gt;&lt;br /&gt;If you wish to adjust the IP address or port number that Merb runs on, that is configurable from the &lt;strike&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;config/merb.yml&lt;/span&gt;&lt;/strike&gt; config/init.rb file.&lt;br /&gt;&lt;br /&gt;That&#39;s it for this post.  In the next post we will actually make our Merb app do something.&lt;br /&gt;&lt;br /&gt;Until then you can get some basic ideas of how to wire things together &lt;a href=&quot;http://paulbarry.com/articles/2007/11/16/merb-and-data-mapper&quot;&gt;in this post on PaulBarry.com&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/4667921518787177103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2007/11/merb-datamapper-getting-rolling.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/4667921518787177103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/4667921518787177103'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2007/11/merb-datamapper-getting-rolling.html' title='Merb &amp; Datamapper: Getting Rolling'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-2922006046352913503</id><published>2007-08-28T16:37:00.000-07:00</published><updated>2007-08-30T14:32:50.446-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="package tracking"/><category scheme="http://www.blogger.com/atom/ns#" term="rss"/><category scheme="http://www.blogger.com/atom/ns#" term="ups"/><title type='text'>Package Tracking &amp; RSS: A Natural Fit?</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://1.bp.blogspot.com/_pGfdZQGFgvE/RtS0PNuyp8I/AAAAAAAAADA/oWUl7U4kxfM/s1600-h/ups.jpg&quot;&gt;&lt;img style=&quot;margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;&quot; src=&quot;http://1.bp.blogspot.com/_pGfdZQGFgvE/RtS0PNuyp8I/AAAAAAAAADA/oWUl7U4kxfM/s320/ups.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5103902451194570690&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;I have a badly needed printer on it&#39;s way.&lt;br /&gt;&lt;br /&gt;It is being shipped by UPS.  If you are like me, and have some obsessive compulsive type tendencies, you probably check the package tracking more often than necessary.&lt;br /&gt;&lt;br /&gt;As I refreshed the UPS page today for the 2nd or 3rd time to find out that &lt;span style=&quot;font-style: italic;&quot;&gt;still&lt;/span&gt; nothing has changed since yesterday, I thought:&lt;br /&gt;&lt;br /&gt;&quot;Wouldn&#39;t this be a good fit for RSS?&quot;&lt;br /&gt;&lt;br /&gt;What do you think?&lt;br /&gt;&lt;br /&gt;If you had a choice of a personalized RSS feed that automatically updated in your favorite RSS reader as your package&#39;s status changed, would you chose and use that over a web page?&lt;br /&gt;&lt;br /&gt;Any other seemingly obvious fits for RSS that you have stumbled upon?&lt;br /&gt;&lt;br /&gt;Love to hear your thoughts!!&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:130%;&quot; &gt;Update&lt;/span&gt;&lt;br /&gt;In a short period of time I recieved a comment from &quot;SAI&quot; providing a link to the &quot;&lt;a href=&quot;http://isnoop.net/tracking/&quot;&gt;Universal Package Tracking&lt;/a&gt;&quot; offered on iSnoop.net.&lt;br /&gt;&lt;br /&gt;According to the site it will accept tracking numbers from UPS, FedEx, USPS, or DHL/AirBorne.  I entered my UPS tracking number, and it worked as advertised.  A RSS feed was created for my shipment, and a Google Map showing each location that it stopped at as it progressed to delivery.&lt;br /&gt;&lt;br /&gt;Great find SAI!  And next time you have a package to track, check out iSnoop&#39;s tool.</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/2922006046352913503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2007/08/package-tracking-rss-natural-fit.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/2922006046352913503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/2922006046352913503'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2007/08/package-tracking-rss-natural-fit.html' title='Package Tracking &amp; RSS: A Natural Fit?'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_pGfdZQGFgvE/RtS0PNuyp8I/AAAAAAAAADA/oWUl7U4kxfM/s72-c/ups.jpg" height="72" width="72"/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-6416981317969216938</id><published>2007-06-05T11:24:00.000-07:00</published><updated>2007-06-05T11:55:35.080-07:00</updated><title type='text'>Time Inventory: Do you keep track?</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://1.bp.blogspot.com/_pGfdZQGFgvE/RmWsdZsYtlI/AAAAAAAAAB4/LHjmWoI2fmY/s1600-h/362500_pastrami_sandwich_200x150.shkl.jpg&quot;&gt;&lt;img style=&quot;margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;&quot; src=&quot;http://1.bp.blogspot.com/_pGfdZQGFgvE/RmWsdZsYtlI/AAAAAAAAAB4/LHjmWoI2fmY/s320/362500_pastrami_sandwich_200x150.shkl.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5072650176415970898&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Every business sells something.&lt;br /&gt;&lt;br /&gt;For many businesses this &quot;something&quot; is a physical object.  For instance, when I was 16 I worked at a deli in the North East.  We sold things like sandwiches, coffee and soda.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;What do you sell?&lt;/span&gt;&lt;/h4&gt;If you are reading this blog most likely you provide some service.  &lt;strong&gt;In essence you sell your time.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Back at the deli (or any business that sell physical goods) a regular inventory was kept.  This helped to keep track of ordering needs, but also could be used to make sure that product wasn&#39;t getting stolen and to otherwise double check sales numbers.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Do you keep an inventory of your time?&lt;/span&gt;&lt;/h4&gt;To do so you need to keep track of 2 basic things.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Time Coming In&lt;/strong&gt; (X)&lt;br /&gt;How many hours are you going to work a week?  If you have a set 40 hour schedule, then your business &quot;receives&quot; 40 hours every week.  If you don&#39;t have a set work schedule, then you will need to track how many hours you spend &quot;working&quot; (whether you actually are or not).&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Actual Time Sold&lt;/strong&gt; (Y)&lt;br /&gt;Simply keep track of your billable hours.&lt;/li&gt;&lt;/ol&gt;Once you track these two numbers it is beneficial to do a weekly (or at least monthly) &quot;inventory&quot; check.&lt;br /&gt;&lt;br /&gt;You had X hours come in, and although all X hours are now gone from your inventory - only Y hours were sold.&lt;br /&gt;&lt;br /&gt;At the deli it wasn&#39;t expected that every single item would be sold.  Some inventory items were required to keep things running: bags, napkins, condiments, straws, etc.  Also, the employees were allowed free drinks and food while on the job.  That was a perk.  As a 16 year old guy free roast beef sandwiches were more important than 401K plans!&lt;br /&gt;&lt;br /&gt;Likewise, &lt;strong&gt;you shouldn&#39;t expect that you will be able to sell every hour of your inventory of time&lt;/strong&gt; on a weekly basis.  You have other non-billable tasks to take care of and the occasional job perk (time you use freely as you please).  But by regularly reviewing these numbers it can reveal disturbing trends.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;What does your inventory reveal?&lt;/span&gt;&lt;/h4&gt;Does your inventory analysis show that you are losing an unacceptable amount of time to non-billable activities?  &lt;strong&gt;Are you being robbed blind?&lt;/strong&gt;  If so, you may need to put forth some serious effort to identify those time thiefs and develop a security measures to protect yourself against them.&lt;br /&gt;&lt;br /&gt;Finally by recording these numbers on a long-term basis you can analyze larger trends.  Are your billable hours going up, down or staying level over the last 3 to 6 months?  By introducing new Product-X or Methodology-Y what was the impact on your billable time?&lt;br /&gt;&lt;!-- technorati tags start --&gt;&lt;p style=&quot;text-align: right; font-size: 10px;&quot;&gt;Technorati Tags: &lt;a href=&quot;http://www.technorati.com/tag/productivity&quot; rel=&quot;tag&quot;&gt;productivity&lt;/a&gt;, &lt;a href=&quot;http://www.technorati.com/tag/freelancing&quot; rel=&quot;tag&quot;&gt;freelancing&lt;/a&gt;, &lt;a href=&quot;http://www.technorati.com/tag/time%20management&quot; rel=&quot;tag&quot;&gt;time management&lt;/a&gt;, &lt;a href=&quot;http://www.technorati.com/tag/web%20work&quot; rel=&quot;tag&quot;&gt;web work&lt;/a&gt;&lt;/p&gt;&lt;!-- technorati tags end --&gt;</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/6416981317969216938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2007/06/time-inventory-do-you-keep-track.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/6416981317969216938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/6416981317969216938'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2007/06/time-inventory-do-you-keep-track.html' title='Time Inventory: Do you keep track?'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_pGfdZQGFgvE/RmWsdZsYtlI/AAAAAAAAAB4/LHjmWoI2fmY/s72-c/362500_pastrami_sandwich_200x150.shkl.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-4333325841128071310</id><published>2007-05-16T19:00:00.000-07:00</published><updated>2007-05-25T18:09:32.400-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="links"/><category scheme="http://www.blogger.com/atom/ns#" term="web worker"/><title type='text'>Ever wanted to bounce something off someone?</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://bp0.blogger.com/_pGfdZQGFgvE/Rld-Cbm-HsI/AAAAAAAAAA8/ngq_NoTumaU/s1600-h/idea_200.jpg&quot;&gt;&lt;img style=&quot;margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;&quot; src=&quot;http://bp0.blogger.com/_pGfdZQGFgvE/Rld-Cbm-HsI/AAAAAAAAAA8/ngq_NoTumaU/s320/idea_200.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5068658485864832706&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;As a web worker I find on occasion the desire to bounce an idea off of someone else. Being that I generally work by myself there often isn&#39;t someone physically there to discuss with. IRC and forums can help in that regard.&lt;br /&gt;&lt;br /&gt;Today I found an interesting site that allows you to present a short question, and receive responses from the world at large. You have no idea who will respond, so responses should probably be taken with a grain of salt. Nevertheless it allows you an opportunity to tap into the &quot;crowd&quot; and see if perhaps it will give you a fresh outlook.&lt;br /&gt;&lt;br /&gt;Site: &lt;a href=&quot;http://www.brainreactions.net/brainstorms&quot;&gt;BrainReactions&lt;/a&gt;&lt;br /&gt;&lt;!-- technorati tags start --&gt;&lt;p style=&quot;text-align: right; font-size: 10px;&quot;&gt;Technorati Tags: &lt;a href=&quot;http://www.technorati.com/tag/web%20work&quot; rel=&quot;tag&quot;&gt;web work&lt;/a&gt;&lt;/p&gt;&lt;!-- technorati tags end --&gt;</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/4333325841128071310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2007/05/ever-wanted-to-bounce-something-off.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/4333325841128071310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/4333325841128071310'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2007/05/ever-wanted-to-bounce-something-off.html' title='Ever wanted to bounce something off someone?'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://bp0.blogger.com/_pGfdZQGFgvE/Rld-Cbm-HsI/AAAAAAAAAA8/ngq_NoTumaU/s72-c/idea_200.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3545886534042322597.post-8917086944150006480</id><published>2007-05-15T18:06:00.000-07:00</published><updated>2007-05-25T18:17:23.182-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails"/><category scheme="http://www.blogger.com/atom/ns#" term="video"/><title type='text'>Ruby on Rails vs The World</title><content type='html'>&lt;a href=&quot;http://www.rubyonrails.com/&quot;&gt;Ruby on Rails&lt;/a&gt; may not be perfect, but it sure lives up to it&#39;s tag line &quot;Web development that doesn&#39;t hurt.&quot;&lt;br /&gt;&lt;br /&gt;The guys over at &lt;a href=&quot;http://www.railsenvy.com/&quot;&gt;Rails Envy&lt;/a&gt; are putting together 4 &quot;Hello I&#39;m a Mac&quot; parodies for Ruby on Rails.&lt;br /&gt;&lt;br /&gt;Enjoy:&lt;br /&gt;&lt;br /&gt;#1) &lt;a href=&quot;http://railsenvy.com/2007/5/14/ruby-on-rails-commercial&quot;&gt;RoR vs Java&lt;/a&gt;&lt;br /&gt;#2) &lt;a href=&quot;http://railsenvy.com/2007/5/15/hi-i-m-ruby-on-rails-part-2&quot;&gt;RoR vs PHP&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Check their website for the final two, which will be presented tomorrow (May 16) and Thursday (May 17).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;!-- technorati tags start --&gt;&lt;p style=&quot;text-align: right; font-size: 10px;&quot;&gt;Technorati Tags: &lt;a href=&quot;http://www.technorati.com/tag/rails%20envy&quot; rel=&quot;tag&quot;&gt;rails envy&lt;/a&gt;, &lt;a href=&quot;http://www.technorati.com/tag/ruby%20on%20rails&quot; rel=&quot;tag&quot;&gt;ruby on rails&lt;/a&gt;&lt;/p&gt;&lt;!-- technorati tags end --&gt;</content><link rel='replies' type='application/atom+xml' href='http://jit.nuance9.com/feeds/8917086944150006480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jit.nuance9.com/2007/05/ruby-on-rails-vs-world.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/8917086944150006480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3545886534042322597/posts/default/8917086944150006480'/><link rel='alternate' type='text/html' href='http://jit.nuance9.com/2007/05/ruby-on-rails-vs-world.html' title='Ruby on Rails vs The World'/><author><name>Justin Pease</name><uri>http://www.blogger.com/profile/00062669138144919279</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>