<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Vert Studios Web Design Blog</title>
	<atom:link href="http://www.vertstudios.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vertstudios.com/blog</link>
	<description>Web design and development resources.</description>
	<lastBuildDate>Mon, 31 Oct 2011 17:08:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Multiple .screenrc Configurations &#124; GNU Screen Tutorial</title>
		<link>http://www.vertstudios.com/blog/multiple-screenrc-configurations-gnu-screen-tutorial/</link>
		<comments>http://www.vertstudios.com/blog/multiple-screenrc-configurations-gnu-screen-tutorial/#comments</comments>
		<pubDate>Sun, 25 Sep 2011 19:19:37 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[screenrc]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3772</guid>
		<description><![CDATA[As an extension of my <a href="http://www.vertstudios.com/blog/screenrc-simple-workflow/">example .screenrc article</a>, this article describes the why and how of multiple .screenrc configurations.]]></description>
			<content:encoded><![CDATA[<p>As an extension of my <a href="http://www.vertstudios.com/blog/screenrc-simple-workflow/">example .screenrc article</a>, this article describes the why and how of multiple .screenrc configurations.</p>
<h2>Why Do I Need Multiple .screenrc Configs?</h2>
<p>Your workflow can vary greatly depending on the type of project. Sure, all will involve your text editor (such as VIM) as well as some type of version control, such as git. However, that leaves out quite a few requirements. A rails developer will be testing often, thus requiring tabs dedicated to spork, autotest, or other testing tools. Additionally, a screen for running the server locally will be needed. Having multiple screen configurations helps you avoid the hassle of creating new screens and naming each tab over and over again. </p>
<h2>How to Add Multiple .screenrc Configs</h2>
<p>Create a directory where you plan on storing your screen configuration files. For this tutorial, I&#8217;ll use <b>/usr/local/screen</b></p>
<pre class="brush: plain; title: ;">
$ sudo mkdir /usr/local/screen
$ cd /usr/local/screen
</pre>
<p>Now create your configuration files and name them based on your workflow, and place them in the /usr/local/screen directory. For example, &#8220;rails&#8221;, &#8220;flask&#8221;, or &#8220;javascript&#8221;. Here&#8217;s my rails screen config file.</p>
<p><i>rails</i></p>
<pre class="brush: plain; title: ;">
# Screen Configuration file for Rails!
# Skip the startup message
startup_message off 

# Display a caption string below, appearing like tabs and
# displaying the window number and application name (by default).
caption always
caption string &quot;%{kw}%-w%{wr}%n %t%{-}%+w&quot;

# j to move down a window, k to move up. Like teh VIM!
bind j focus down
bind k focus up

screen -t VIM
screen -t Test
screen -t Bash
screen -t Git
screen -t Spork
screen -t Server

# Select first screen
select 0
</pre>
<p>Remember to make sure this file is in your /usr/local/screen directory.</p>
<p>Next, we have to tell screen to load these different configuration files. We&#8217;ll make a simple bash function and append it to our ~/.bashrc</p>
<pre class="brush: plain; title: ;">
# Special screens
# $1 - screen config file name
function scr(){
    screen -c /usr/local/screen/$1
}
</pre>
<h2>Calling the Configurations</h2>
<p>Now if we want to use our rails screen configuration file, we execute </p>
<pre class="brush: plain; title: ;">$ scr rails</pre>
<p>Note that we use &#8220;scr&#8221; instead of &#8220;screen&#8221;. Executing &#8220;screen&#8221; by itself will just load the ~/.screenrc file as its configuration.</p>
<p>It&#8217;s important to note that there isn&#8217;t any configuration file inheritance going on here. The files located in /usr/local/screen need to be full fledged configuration files, as unfortunate as that is.</p>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/what-linux-distro-running/' title='Snippet: What Linux Distro is Running? '>Snippet: What Linux Distro is Running? </a></li>
<li><a href='http://www.vertstudios.com/blog/remove-ruby-gems-ubuntu/' title='Remove All Ruby Gems (Ubuntu)'>Remove All Ruby Gems (Ubuntu)</a></li>
<li><a href='http://www.vertstudios.com/blog/linux-snippet-run-bash-profile-start/' title='Linux Snippet: Run ~/.bash_profile on Startup (GNOME)'>Linux Snippet: Run ~/.bash_profile on Startup (GNOME)</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3772" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/multiple-screenrc-configurations-gnu-screen-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Autotest Won&#8217;t Work &#8211; Just Be Ghetto!</title>
		<link>http://www.vertstudios.com/blog/autotest-work-ghetto/</link>
		<comments>http://www.vertstudios.com/blog/autotest-work-ghetto/#comments</comments>
		<pubDate>Sun, 25 Sep 2011 14:38:54 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[rspec]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3769</guid>
		<description><![CDATA[So I somehow managed to botch my Autotest installation I described in <a href="http://www.vertstudios.com/blog/installing-rspec-autotest-spork-ubuntu-osx/">this tutorial</a>. After spending many hours trying to get it back up and running again, I've decided it's just not worth it. Here's a ghetto bash script for semi-auto testing. You just have to press any key and it'll run the test. ]]></description>
			<content:encoded><![CDATA[<p>So I somehow managed to botch my Autotest installation I described in <a href="http://www.vertstudios.com/blog/installing-rspec-autotest-spork-ubuntu-osx/">this tutorial</a>. After spending many hours trying to get it back up and running again, I&#8217;ve decided it&#8217;s just not worth it. Here&#8217;s a ghetto bash script for semi-auto testing. You just have to press any key and it&#8217;ll run the test. </p>
<p>test.sh</p>
<pre class="brush: plain; title: ;">
#!/bin/bash
# Our ghetto auto-testish thing. User presses any key to test,
# Ctrl-C to get out

function hold(){
    read -n 1 -s
}

function do_test(){
    printf &quot;\nTesting...&quot;
    bundle exec rspec spec/
    printf &quot;\nPress any key to test... \n&quot;
    hold
    do_test
}

do_test
</pre>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/ruby-warning-insecure-world-writable-dir/' title='[SOLVED] warning: Insecure world writable dir'>[SOLVED] warning: Insecure world writable dir</a></li>
<li><a href='http://www.vertstudios.com/blog/list-rails-session-variables/' title='List of Rails Session Variables'>List of Rails Session Variables</a></li>
<li><a href='http://www.vertstudios.com/blog/installing-rspec-autotest-spork-ubuntu-osx/' title='Installing RSpec, Autotest, and Spork on Ubuntu/OS X'>Installing RSpec, Autotest, and Spork on Ubuntu/OS X</a></li>
<li><a href='http://www.vertstudios.com/blog/rails-singularplural-reference-chart/' title='Rails Singular/Plural Reference Chart'>Rails Singular/Plural Reference Chart</a></li>
<li><a href='http://www.vertstudios.com/blog/remove-ruby-gems-ubuntu/' title='Remove All Ruby Gems (Ubuntu)'>Remove All Ruby Gems (Ubuntu)</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3769" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/autotest-work-ghetto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[SOLVED] warning: Insecure world writable dir</title>
		<link>http://www.vertstudios.com/blog/ruby-warning-insecure-world-writable-dir/</link>
		<comments>http://www.vertstudios.com/blog/ruby-warning-insecure-world-writable-dir/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 20:53:21 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3756</guid>
		<description><![CDATA[I've had my face-palm moment for the day.

While searching for how to solve the annoying ruby alert of "Insecure world writable dir", the fact that I was on a FAT32 partition completely skipped my mind. The chmod/chown commands tutorials told me to execute weren't working, and my mind was blown. If you're an Ubuntu user working on a FAT32 partition, <b>you can't change file permissions</b>!]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had my face-palm moment for the day.</p>
<p>While searching for how to solve the annoying ruby alert of &#8220;Insecure world writable dir&#8221;, the fact that I was on a FAT32 partition completely skipped my mind. The chmod/chown commands tutorials told me to execute weren&#8217;t working, and my mind was blown. If you&#8217;re an Ubuntu user working on a FAT32 partition, <b>you can&#8217;t change file permissions</b>!</p>
<h2>The Solution</h2>
<p>Thanks to <a href="http://www.ruby-forum.com/topic/79565">Ruby-Forum.com</a>, I found that inserting &#8220;$VERBOSE=nil&#8221; into my bundler runtime file helped suppress this annoying message. Please be careful with this, and only do this if you work exclusively on a FAT32 partition.</p>
<p>Find your gem path so we can edit the bundler gem. Execute the following in your shell: (<a href="http://gilesbowkett.blogspot.com/2009/06/find-your-ruby-gems-path.html">credit</a>)</p>
<pre class="brush: plain; title: ;">$ ruby -r rubygems -e &quot;p Gem.path&quot;</pre>
<p>Navigate to your gem path and cd into the version of bundler currently being used. Now navigate to <b>lib -&gt; bundler </b> and open <b>runtime.rb</b> in your favorite text editor. Add &#8220;$VERBOSE = nil&#8221; to line 2.</p>
<pre class="brush: ruby; highlight: [2]; title: ;">
require &quot;digest/sha1&quot;
$VERBOSE = nil 

module Bundler
  class Runtime &lt; Environment
    include SharedHelpers

    def setup(*groups)
      # Has to happen first
      clean_load_path

...
</pre>
<p>Now that annoying warning should leave you alone.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/remove-ruby-gems-ubuntu/' title='Remove All Ruby Gems (Ubuntu)'>Remove All Ruby Gems (Ubuntu)</a></li>
<li><a href='http://www.vertstudios.com/blog/list-rails-session-variables/' title='List of Rails Session Variables'>List of Rails Session Variables</a></li>
<li><a href='http://www.vertstudios.com/blog/installing-rspec-autotest-spork-ubuntu-osx/' title='Installing RSpec, Autotest, and Spork on Ubuntu/OS X'>Installing RSpec, Autotest, and Spork on Ubuntu/OS X</a></li>
<li><a href='http://www.vertstudios.com/blog/rails-singularplural-reference-chart/' title='Rails Singular/Plural Reference Chart'>Rails Singular/Plural Reference Chart</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3756" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/ruby-warning-insecure-world-writable-dir/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PyQuery Tutorial: Basic HTML Parsing with PyQuery</title>
		<link>http://www.vertstudios.com/blog/pyquery-tutorial-basic-html-parsing-pyquery/</link>
		<comments>http://www.vertstudios.com/blog/pyquery-tutorial-basic-html-parsing-pyquery/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 03:29:09 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3743</guid>
		<description><![CDATA[As Python is my programming language of choice when it comes to getting things done quickly, I need a dead simple XML parser that gets me the data I want and gets the hell out of the way. ]]></description>
			<content:encoded><![CDATA[<p>As Python is my programming language of choice when it comes to getting things done quickly, I need a dead simple XML parser that gets me the data I want and gets the hell out of the way. </p>
<h2>Enter PyQuery</h2>
<p><a href="http://pypi.python.org/pypi/pyquery">PyQuery</a>, as you may have guessed, is a Python port of the extremely popular <a href="http://jquery.com">jQuery</a> JavaScript library. Anyone even remotely experienced with jQuery know how easy it is to select any element you wish from the DOM. Once you move away from JavaScript, many XML parsers become extremely verbose. PyQuery helps us keeps things simple and extract the data we want without wasting any time. </p>
<h2>Using PyQuery for Basic Parsing</h2>
<p>PyQuery includes many of the jQuery DOM <a href="http://packages.python.org/pyquery/manipulating.html">manipulation methods</a>. For this tutorial, we&#8217;ll just deal with retrieving data from HTML. Once you can read the HTML to a string via PyQuery, you can instantly apply your knowledge of jQuery and append(), remove(), or whatever you need. </p>
<h2>The Setup</h2>
<p><strong>This guide uses Python 2.6.</strong> If you don&#8217;t have <a href="http://pypi.python.org/pypi/virtualenv">virtualenv</a>, grab it now. We&#8217;ll use it in a minute to install the PyQuery package.<br />
Now create a project directory for this tutorial. I&#8217;ll call it pyquery_tutorial</p>
<pre class="brush: plain; title: ;">
$ mkdir pyquery_tutorial
$ cd pyquery_tutorial
</pre>
<p>Now create the virtual environment with your Python executable version of choice (I have only tested this for 2.6 and 2.7)</p>
<pre class="brush: plain; title: ;">
$ virtualenv env --python=python2.6
Running virtualenv with interpreter /usr/bin/python2.6
New python executable in env/bin/python2.6
Also creating executable in env/bin/python
Installing distribute.................................................................................................................................................................................done.
</pre>
<p>Now activate the virtualenv. (You should see (env) beside your prompt if done correctly)</p>
<pre class="brush: plain; title: ;">$ . env/bin/activate</pre>
<p>Now we install the PyQuery package.</p>
<pre class="brush: plain; title: ;">(env) $ pip install pyquery
...
Successfully installed lxml pyquery
Cleaning up...
</pre>
<p>Woohoo, PyQuery is now ready for use!</p>
<h2>Using PyQuery</h2>
<p>Using PyQuery for parsing will feel extremely similar to using jQuery. One of the only differences is initializing the jQuery object. </p>
<p>First, create this html file called &#8220;index.html&#8221; in the project directory. </p>
<p><i>index.html</i></p>
<pre class="brush: xml; title: ;">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;PyQuery Test!&lt;/title&gt;
	&lt;/head&gt;

&lt;body&gt;
	&lt;h1&gt;PyQuery is AWESOME!&lt;/h1&gt;
	&lt;p&gt;&lt;a href=&quot;http://pypi.python.org/pypi/pyquery&quot;&gt;PyQuery&lt;/a&gt; is a Python port of the famous &lt;a href=&quot;http://jquery.com&quot;&gt;jQuery&lt;/a&gt; JavaScript library.
	&lt;h2&gt;What is it Good For?&lt;/h2&gt;
	&lt;ul id=&quot;pitch&quot;&gt;
		&lt;li&gt;It makes parsing files a &lt;strong&gt;SNAP&lt;/strong&gt;!&lt;/li&gt;
		&lt;li&gt;DOM Manipulation is EASY!&lt;/li&gt;
		&lt;li&gt;You &lt;em&gt;never&lt;/em&gt; have to worry about confusing syntax&lt;/li&gt;
	&lt;/ul&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Now fire up Python. (Make sure your virtualenv is still activated!)</p>
<pre class="brush: plain; title: ;">$ python
Python 2.6.6 (r266:84292, Mar 25 2011, 19:36:32)
[GCC 4.5.2] on linux2
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt;
</pre>
<p>First we import PyQuery from the pyquery package. </p>
<pre class="brush: plain; title: ;">
&gt;&gt;&gt; from pyquery import PyQuery
</pre>
<p>Now let&#8217;s read in our <i>index.html</i> file and store it to a string.</p>
<pre class="brush: plain; title: ;">
&gt;&gt;&gt; html = open(&quot;index.html&quot;, 'r').read()
</pre>
<p>Now we instantiate a PyQuery object, passing in our html string. To keep things looking familiar, let the instantiating object be named jQuery!</p>
<pre class="brush: plain; title: ;">
&gt;&gt;&gt; jQuery = PyQuery(html)
</pre>
<p>Now we can traverse this document using the selectors we&#8217;ve grown to love through CSS and jQuery. It might look strange that we&#8217;re assigning jQuery to something, but at this point, we use this jQuery variable JUST like we use $ in our JavaScript. For example, let&#8217;s get the title tag.</p>
<pre class="brush: plain; title: ;">
&gt;&gt;&gt; jQuery(&quot;title&quot;).text()
'PyQuery Test!'
</pre>
<p>jQuery developers that have created their own plugin may already be comfortable using jQuery in place of $ in their JS. Let&#8217;s mess around with PyQuery some more.</p>
<pre class="brush: plain; title: ;">
&gt;&gt;&gt; jQuery(&quot;li&quot;).eq(1).text()
'DOM Manipulation is EASY!'
&gt;&gt;&gt; jQuery(&quot;a&quot;) # The 'jQuery Object' we're used to is now a list
[&lt;a&gt;, &lt;a&gt;]
&gt;&gt;&gt; for x in jQuery(&quot;a&quot;): # We can do for-loops as normal in Python
... print jQuery(x).text()
...
PyQuery
jQuery
</pre>
<p>Get the HTML of the first li element.</p>
<pre class="brush: plain; title: ;">
&gt;&gt;&gt; jQuery(&quot;ul&quot;).children().eq(0).html()
u'It makes parsing files a &lt;strong&gt;SNAP&lt;/strong&gt;!'
</pre>
<h3>Remote Files</h3>
<p>Wanna parse a remote file? No problem!</p>
<pre class="brush: plain; title: ;">
&gt;&gt;&gt; jQuery = PyQuery(url=&quot;http://www.vertstudios.com/&quot;)
&gt;&gt;&gt; jQuery(&quot;title&quot;).text()
&quot;<a href="http://www.vertstudios.com/">Web Design</a> that Doesn't Suck | Vert Studios | Tyler, Texas&quot;
</pre>
<h2>Conclusion</h2>
<p>Now that we&#8217;ve given you a nice kickstart of PyQuery, your knowledge of jQuery coupled with the <a href="http://packages.python.org/pyquery/api.html">PyQuery API</a> provides sufficient power to parse XML/HTML documents.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/daily-contact-form-tests-python-cron/' title='Daily Contact Form Tests with Python and Cron'>Daily Contact Form Tests with Python and Cron</a></li>
<li><a href='http://www.vertstudios.com/blog/install-pyquery-cygwin/' title='Install PyQuery under Cygwin'>Install PyQuery under Cygwin</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3743" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/pyquery-tutorial-basic-html-parsing-pyquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>List of Rails Session Variables</title>
		<link>http://www.vertstudios.com/blog/list-rails-session-variables/</link>
		<comments>http://www.vertstudios.com/blog/list-rails-session-variables/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 19:04:35 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3737</guid>
		<description><![CDATA[As a rails novice, one of the more frustrating things I've encountered with rails is the inability to search for specific method names in its API. This is because a lot of these methods are dynamically generated helpers that you should know by heart once you've mastered the "Rails Way." Unfortunately for me, I'm not at the point of calling myself a Rails guru, so I still need to know what all I have available to me. In my opinion, nothing is more frustrating than not knowing what methods you have at your disposal. ]]></description>
			<content:encoded><![CDATA[<p>As a rails novice, one of the more frustrating things I&#8217;ve encountered with rails is the inability to search for specific method names in its API. This is because a lot of these methods are dynamically generated helpers that you should know by heart once you&#8217;ve mastered the &#8220;Rails Way.&#8221; Unfortunately for me, I&#8217;m not at the point of calling myself a Rails guru, so I still need to know what all I have available to me. In my opinion, nothing is more frustrating than not knowing what methods you have at your disposal. </p>
<p>After doing quite a bit of googling, I was able to find a list of session variables by executing the following in Rails Console:</p>
<pre class="brush: plain; title: ;">
irb(main):001:0&gt; y app.methods.sort
</pre>
<h2>Rails Session Variables List</h2>
<p>Here is my list of Rails Session Variables. These will vary across different apps based upon what gems you have installed. For example, you&#8217;ll see methods with &#8220;refinery&#8221; in the list below, which refers to the <a href="http://refinerycms.com/">RefineryCMS</a> we&#8217;ve adopted here at Vert. I highly recommend you execute the command above for your own app.</p>
<pre class="brush: plain; title: ;">
---
- :!
- :!=
- :!~
- :&lt;=&gt;
- :==
- :===
- :=~
- :__id__
- :__send__
- :_assertions
- :_assertions=
- :_routes
- :`
- :accept
- :accept=
- :acts_like?
- :admin_dashboard_path
- :admin_dashboard_url
- :admin_dialog_path
- :admin_dialog_url
- :admin_disable_upgrade_message_path
- :admin_disable_upgrade_message_url
- :admin_image_path
- :admin_image_url
- :admin_images_path
- :admin_images_url
- :admin_memberships_path
- :admin_memberships_url
- :admin_page_part_path
- :admin_page_part_url
- :admin_page_parts_path
- :admin_page_parts_url
- :admin_page_path
- :admin_page_url
- :admin_pages_path
- :admin_pages_url
- :admin_refinery_setting_path
- :admin_refinery_setting_url
- :admin_refinery_settings_path
- :admin_refinery_settings_url
- :admin_resource_path
- :admin_resource_url
- :admin_resources_path
- :admin_resources_url
- :admin_root_path
- :admin_root_url
- :admin_user_path
- :admin_user_role_path
- :admin_user_role_url
- :admin_user_url
- :admin_users_path
- :admin_users_url
- :as_json
- :assert
- :assert_block
- :assert_dom_equal
- :assert_dom_not_equal
- :assert_empty
- :assert_equal
- :assert_generates
- :assert_in_delta
- :assert_in_epsilon
- :assert_includes
- :assert_instance_of
- :assert_kind_of
- :assert_match
- :assert_nil
- :assert_no_match
- :assert_no_tag
- :assert_not_empty
- :assert_not_equal
- :assert_not_in_delta
- :assert_not_in_epsilon
- :assert_not_includes
- :assert_not_instance_of
- :assert_not_kind_of
- :assert_not_match
- :assert_not_nil
- :assert_not_operator
- :assert_not_respond_to
- :assert_not_same
- :assert_nothing_raised
- :assert_nothing_thrown
- :assert_operator
- :assert_raise
- :assert_raises
- :assert_recognizes
- :assert_redirected_to
- :assert_respond_to
- :assert_response
- :assert_routing
- :assert_same
- :assert_select
- :assert_select_email
- :assert_select_encoded
- :assert_select_rjs
- :assert_send
- :assert_tag
- :assert_throws
- :assigns
- :blank?
- :body
- :breakpoint
- :build_message
- :cancel_user_registration_path
- :cancel_user_registration_url
- :capture_io
- :class
- :class_eval
- :clone
- :controller
- :cookies
- :copy_instance_variables_from
- :count_description
- :create_multiple_admin_page_roles_path
- :create_multiple_admin_page_roles_url
- :create_multiple_admin_user_roles_path
- :create_multiple_admin_user_roles_url
- :css_select
- :debugger
- :default_url_options
- :default_url_options=
- :default_url_options?
- :define_singleton_method
- :delete
- :delete_via_redirect
- :destroy_multiple_admin_page_roles_path
- :destroy_multiple_admin_page_roles_url
- :destroy_multiple_admin_user_roles_path
- :destroy_multiple_admin_user_roles_url
- :destroy_user_session_path
- :destroy_user_session_url
- :display
- :dup
- :duplicable?
- :edit_admin_image_path
- :edit_admin_image_url
- :edit_admin_page_path
- :edit_admin_page_url
- :edit_admin_refinery_setting_path
- :edit_admin_refinery_setting_url
- :edit_admin_resource_path
- :edit_admin_resource_url
- :edit_admin_user_path
- :edit_admin_user_url
- :edit_member_path
- :edit_member_url
- :edit_polymorphic_path
- :edit_polymorphic_url
- :edit_user_password_path
- :edit_user_password_url
- :edit_user_registration_path
- :edit_user_registration_url
- :enable_warnings
- :enum_for
- :eql?
- :equal?
- :exception_details
- :extend
- :find_all_tag
- :find_tag
- :fixture_file_upload
- :flash
- :flunk
- :follow_redirect!
- :freeze
- :friendly_id?
- :frozen?
- :gem
- :get
- :get_via_redirect
- :hash
- :hash_for_admin_dashboard_path
- :hash_for_admin_dashboard_url
- :hash_for_admin_dialog_path
- :hash_for_admin_dialog_url
- :hash_for_admin_disable_upgrade_message_path
- :hash_for_admin_disable_upgrade_message_url
- :hash_for_admin_image_path
- :hash_for_admin_image_url
- :hash_for_admin_images_path
- :hash_for_admin_images_url
- :hash_for_admin_memberships_path
- :hash_for_admin_memberships_url
- :hash_for_admin_page_part_path
- :hash_for_admin_page_part_url
- :hash_for_admin_page_parts_path
- :hash_for_admin_page_parts_url
- :hash_for_admin_page_path
- :hash_for_admin_page_url
- :hash_for_admin_pages_path
- :hash_for_admin_pages_url
- :hash_for_admin_refinery_setting_path
- :hash_for_admin_refinery_setting_url
- :hash_for_admin_refinery_settings_path
- :hash_for_admin_refinery_settings_url
- :hash_for_admin_resource_path
- :hash_for_admin_resource_url
- :hash_for_admin_resources_path
- :hash_for_admin_resources_url
- :hash_for_admin_root_path
- :hash_for_admin_root_url
- :hash_for_admin_user_path
- :hash_for_admin_user_role_path
- :hash_for_admin_user_role_url
- :hash_for_admin_user_url
- :hash_for_admin_users_path
- :hash_for_admin_users_url
- :hash_for_cancel_user_registration_path
- :hash_for_cancel_user_registration_url
- :hash_for_create_multiple_admin_page_roles_path
- :hash_for_create_multiple_admin_page_roles_url
- :hash_for_create_multiple_admin_user_roles_path
- :hash_for_create_multiple_admin_user_roles_url
- :hash_for_destroy_multiple_admin_page_roles_path
- :hash_for_destroy_multiple_admin_page_roles_url
- :hash_for_destroy_multiple_admin_user_roles_path
- :hash_for_destroy_multiple_admin_user_roles_url
- :hash_for_destroy_user_session_path
- :hash_for_destroy_user_session_url
- :hash_for_edit_admin_image_path
- :hash_for_edit_admin_image_url
- :hash_for_edit_admin_page_path
- :hash_for_edit_admin_page_url
- :hash_for_edit_admin_refinery_setting_path
- :hash_for_edit_admin_refinery_setting_url
- :hash_for_edit_admin_resource_path
- :hash_for_edit_admin_resource_url
- :hash_for_edit_admin_user_path
- :hash_for_edit_admin_user_url
- :hash_for_edit_member_path
- :hash_for_edit_member_url
- :hash_for_edit_user_password_path
- :hash_for_edit_user_password_url
- :hash_for_edit_user_registration_path
- :hash_for_edit_user_registration_url
- :hash_for_insert_admin_images_path
- :hash_for_insert_admin_images_url
- :hash_for_insert_admin_resources_path
- :hash_for_insert_admin_resources_url
- :hash_for_link_to_admin_pages_dialogs_path
- :hash_for_link_to_admin_pages_dialogs_url
- :hash_for_member_path
- :hash_for_member_url
- :hash_for_members_path
- :hash_for_members_url
- :hash_for_new_admin_image_path
- :hash_for_new_admin_image_url
- :hash_for_new_admin_page_part_path
- :hash_for_new_admin_page_part_url
- :hash_for_new_admin_page_path
- :hash_for_new_admin_page_url
- :hash_for_new_admin_refinery_setting_path
- :hash_for_new_admin_refinery_setting_url
- :hash_for_new_admin_resource_path
- :hash_for_new_admin_resource_url
- :hash_for_new_admin_user_path
- :hash_for_new_admin_user_url
- :hash_for_new_member_path
- :hash_for_new_member_url
- :hash_for_new_user_password_path
- :hash_for_new_user_password_url
- :hash_for_new_user_registration_path
- :hash_for_new_user_registration_url
- :hash_for_new_user_session_path
- :hash_for_new_user_session_url
- :hash_for_page_path
- :hash_for_page_url
- :hash_for_rails_info_properties_path
- :hash_for_rails_info_properties_url
- :hash_for_refinery_root_path
- :hash_for_refinery_root_url
- :hash_for_refinery_update_menu_positions_path
- :hash_for_refinery_update_menu_positions_url
- :hash_for_root_path
- :hash_for_root_url
- :hash_for_test_email_admin_pages_dialogs_path
- :hash_for_test_email_admin_pages_dialogs_url
- :hash_for_test_url_admin_pages_dialogs_path
- :hash_for_test_url_admin_pages_dialogs_url
- :hash_for_update_positions_admin_pages_path
- :hash_for_update_positions_admin_pages_url
- :hash_for_user_password_path
- :hash_for_user_password_url
- :hash_for_user_registration_path
- :hash_for_user_registration_url
- :hash_for_user_root_path
- :hash_for_user_root_url
- :hash_for_user_session_path
- :hash_for_user_session_url
- :hash_for_wymiframe_path
- :hash_for_wymiframe_url
- :head
- :headers
- :host
- :host!
- :host=
- :html_document
- :html_safe?
- :https!
- :https?
- :initialize_clone
- :initialize_dup
- :insert_admin_images_path
- :insert_admin_images_url
- :insert_admin_resources_path
- :insert_admin_resources_url
- :inspect
- :instance_eval
- :instance_exec
- :instance_of?
- :instance_values
- :instance_variable_defined?
- :instance_variable_get
- :instance_variable_names
- :instance_variable_set
- :instance_variables
- :is_a?
- :kind_of?
- :link_to_admin_pages_dialogs_path
- :link_to_admin_pages_dialogs_url
- :load
- :load_dependency
- :member_path
- :member_url
- :members_path
- :members_url
- :message
- :method
- :method_missing
- :methods
- :mu_pp
- :new_admin_image_path
- :new_admin_image_url
- :new_admin_page_part_path
- :new_admin_page_part_url
- :new_admin_page_path
- :new_admin_page_url
- :new_admin_refinery_setting_path
- :new_admin_refinery_setting_url
- :new_admin_resource_path
- :new_admin_resource_url
- :new_admin_user_path
- :new_admin_user_url
- :new_member_path
- :new_member_url
- :new_polymorphic_path
- :new_polymorphic_url
- :new_user_password_path
- :new_user_password_url
- :new_user_registration_path
- :new_user_registration_url
- :new_user_session_path
- :new_user_session_url
- :nil?
- <img src='http://www.vertstudios.com/blog/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> bject_id
- :page_path
- :page_url
- :pass
- :path
- :polymorphic_path
- :polymorphic_url
- :post
- :post_via_redirect
- :presence
- :present?
- :pretty_inspect
- :pretty_print
- :pretty_print_cycle
- :pretty_print_inspect
- :pretty_print_instance_variables
- :private_methods
- :protected_methods
- :psych_to_yaml
- :psych_y
- :public_method
- :public_methods
- :public_send
- :put
- :put_via_redirect
- :rails_info_properties_path
- :rails_info_properties_url
- :redirect?
- :redirect_to_url
- :refinery_root_path
- :refinery_root_url
- :refinery_update_menu_positions_path
- :refinery_update_menu_positions_url
- :refute
- :refute_empty
- :refute_equal
- :refute_in_delta
- :refute_in_epsilon
- :refute_includes
- :refute_instance_of
- :refute_kind_of
- :refute_match
- :refute_nil
- :refute_operator
- :refute_respond_to
- :refute_same
- :remote_addr
- :remote_addr=
- :request
- :request_count
- :request_count=
- :request_via_redirect
- :require
- :require_association
- :require_dependency
- :require_library_or_gem
- :require_or_load
- :reset!
- :respond_to?
- :respond_to_missing?
- :response
- :response_from_page_or_rjs
- :returning
- :root_path
- :root_url
- :send
- :session
- :silence_stderr
- :silence_stream
- :silence_warnings
- :singleton_class
- :singleton_methods
- :skip
- :status
- :status_message
- :suppress
- :suppress_warnings
- :taint
- :tainted?
- :tap
- :test_email_admin_pages_dialogs_path
- :test_email_admin_pages_dialogs_url
- :test_url_admin_pages_dialogs_path
- :test_url_admin_pages_dialogs_url
- :to_dragonfly_unique_s
- :to_enum
- :to_json
- :to_param
- :to_query
- :to_s
- :to_yaml
- :to_yaml_properties
- :trust
- :try
- :unescape_rjs
- :unfriendly_id?
- :unloadable
- :untaint
- :untrust
- :untrusted?
- :update_positions_admin_pages_path
- :update_positions_admin_pages_url
- :url_for
- :url_options
- :user_password_path
- :user_password_url
- :user_registration_path
- :user_registration_url
- :user_root_path
- :user_root_url
- :user_session_path
- :user_session_url
- :with_options
- :with_routing
- :with_warnings
- :wymiframe_path
- :wymiframe_url
- <img src='http://www.vertstudios.com/blog/wp-includes/images/smilies/icon_mad.gif' alt=':x' class='wp-smiley' /> hr
- <img src='http://www.vertstudios.com/blog/wp-includes/images/smilies/icon_mad.gif' alt=':x' class='wp-smiley' /> ml_http_request
- :y
</pre>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/ruby-warning-insecure-world-writable-dir/' title='[SOLVED] warning: Insecure world writable dir'>[SOLVED] warning: Insecure world writable dir</a></li>
<li><a href='http://www.vertstudios.com/blog/installing-rspec-autotest-spork-ubuntu-osx/' title='Installing RSpec, Autotest, and Spork on Ubuntu/OS X'>Installing RSpec, Autotest, and Spork on Ubuntu/OS X</a></li>
<li><a href='http://www.vertstudios.com/blog/rails-singularplural-reference-chart/' title='Rails Singular/Plural Reference Chart'>Rails Singular/Plural Reference Chart</a></li>
<li><a href='http://www.vertstudios.com/blog/remove-ruby-gems-ubuntu/' title='Remove All Ruby Gems (Ubuntu)'>Remove All Ruby Gems (Ubuntu)</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3737" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/list-rails-session-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Start VIM in File Navigation Mode</title>
		<link>http://www.vertstudios.com/blog/start-vim-file-navigation-mode/</link>
		<comments>http://www.vertstudios.com/blog/start-vim-file-navigation-mode/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 20:31:48 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3734</guid>
		<description><![CDATA[A quick way to open VIM in file navigation mode when no files are passed to VIM. ]]></description>
			<content:encoded><![CDATA[<p>I often find myself doing the following:</p>
<pre class="brush: plain; title: ;">
vim .
</pre>
<p>to open up VIM and then explore my files. Because I&#8217;m lazy, here&#8217;s a way to open up VIM in file navigation mode if no files are specified when running VIM.</p>
<p>Append the following to your .bashrc</p>
<pre class="brush: bash; title: ;">
function vim(){
    vimpath=`which vim`
    if [ &quot;$#&quot; -gt 0 ]
    then
        $vimpath $@
    else
        $vimpath .
    fi
}
</pre>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/overcome-programming-apathy/' title='Overcome Programming Apathy'>Overcome Programming Apathy</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3734" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/start-vim-file-navigation-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing RSpec, Autotest, and Spork on Ubuntu/OS X</title>
		<link>http://www.vertstudios.com/blog/installing-rspec-autotest-spork-ubuntu-osx/</link>
		<comments>http://www.vertstudios.com/blog/installing-rspec-autotest-spork-ubuntu-osx/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 19:30:50 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3726</guid>
		<description><![CDATA[I'm an Ubuntu lover in the process of learning Ruby on Rails. I've spent a good majority of my time "learning" rails trying to get Rspec, Spork, and Autotest to play nicely. Unfortunately, <a href="http://www.twitter.com/vertjustin">our designer</a> is an Apple fanboy, so my testing suite needs to perform on OS X as well. It's extremely frustrating to spend so many hours trying to get these gems to work, just so you can continue on with the tutorial! Thus, to save you all the heartache I endured, here is a definitive guide to integrating Spork and Autotest with Rspec for Ubuntu AND Mac OS X!]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m an Ubuntu lover in the process of learning Ruby on Rails. I&#8217;ve spent a good majority of my time &#8220;learning&#8221; rails trying to get Rspec, Spork, and Autotest to play nicely. Unfortunately, <a href="http://www.twitter.com/vertjustin">our designer</a> is an Apple fanboy, so my testing suite needs to perform on OS X as well. It&#8217;s extremely frustrating to spend so many hours trying to get these gems to work, just so you can continue on with the tutorial! Thus, to save you all the heartache I endured, here is a definitive guide to integrating Spork and Autotest with Rspec for Ubuntu AND Mac OS X!</p>
<h2>Time Required</h2>
<p>15 &#8211; 30 minutes</p>
<h2>The Main Problem: Gemfile Hacks</h2>
<p>The main issue with most of the tutorials I&#8217;ve followed is that they require you to list gems such as autotest in Gemfiles, and this can cause a huge array of conflicts between the different operating systems. So our philosophy throughout this tutorial is knowing when a gem should be executed via its binary (autotest) or via bundle exec (bundle exec autotest). Most of the time executing via binary or through bundle exec doesn&#8217;t make any difference. However, in this context, autotest and spork react much differently based upon which way you call them. Thus, in order to keep our project portable, we aim to eliminate any OS-specific hacks in the Gemfile. </p>
<h2>Get the Project Template</h2>
<p>First, we&#8217;ll pull a rails project template file that has rspec preconfigured.</p>
<pre class="brush: plain; title: ;">$ git clone git://github.com/joequery/Rails-Template.git</pre>
<p>Now rename the app to whatever you want</p>
<pre class="brush: plain; title: ;">$ rails g rename_to YourApp</pre>
<p>Now execute the following</p>
<pre class="brush: plain; title: ;">
$ bundle install
$ gem install ZenTest
$ gem install autotest-rails
</pre>
<p>(You may need to use sudo for your gem install, depends on your setup)</p>
<p>Now we move on to OS-Specific implementations.</p>
<h2 id="ubuntu">Ubuntu Configuration</h2>
<p>(<a href="#osx">Skip to OS X</a>)<br />
Credit most of the Ubuntu instructions to <a href="http://ykyuen.wordpress.com/2010/11/15/rails-integrate-autotest-and-rspec-in-linux/">Ykyuen</a></p>
<p>First, execute</p>
<pre class="brush: plain; title: ;">
$ sudo apt-get install libnotify-bin
</pre>
<p>Now create an autotest configuration file in the home directory (~/.autotest) and paste in the following:</p>
<pre class="brush: ruby; title: ;">
#!/bin/ruby

#require 'redgreen'
require 'autotest/timestamp'

module Autotest::GnomeNotify
def self.notify title, msg, img
system &quot;notify-send '#{title}' '#{msg}' -i #{img} -t 1500&quot;
end

Autotest.add_hook :ran_command do |at|
	image_root = &quot;~/.autotest_images&quot;
	results = [at.results].flatten.join(&quot;\n&quot;)
	results.gsub!(/\\e\[\d+m/,'')
	output = results.slice(/(\d+)\sexamples?,\s(\d+)\sfailures?(,\s(\d+)\spending?|)/)
	full_sentence, green, failures, garbage, pending = $~.to_a.map(&amp;:to_i)
	if output
		if failures &gt; 0
		notify &quot;FAIL&quot;, &quot;#{output}&quot;, &quot;#{image_root}/fail.png&quot;

		elsif pending &gt; 0
		notify &quot;Pending&quot;, &quot;#{output}&quot;, &quot;#{image_root}/pending.png&quot;

		else
		notify &quot;Pass&quot;, &quot;#{output}&quot;, &quot;#{image_root}/pass.png&quot;

		end
	end
end

end
</pre>
<p>Now create an ~/.autotest_images folder and extract <a href="http://www.vertstudios.com/blog/images/rspec/images.tar.gz">these images</a> to it.</p>
<p>Everything is now configured. Jump to <a href="#testing">Testing Your Setup</a></p>
<h2 id="osx">Mac OS X</h2>
<p>First, execute </p>
<pre class="brush: plain; title: ;">
$ gem install autotest-growl
</pre>
<p>(You may need to use sudo, based upon your setup).</p>
<p>Edit the ~/.autotest file (create it if it does not exist), and paste the following in</p>
<pre class="brush: plain; title: ;">
require &quot;autotest/growl&quot;
</pre>
<p>Everything is now configured. Jump to <a href="#testing">Testing Your Setup</a></p>
<h2 id="testing">Testing Your Setup</h2>
<p>The Ubuntu Nerds and the Apple Fanboys reunite! It's time to test our installations.</p>
<p>First, lets generate a controller to test.</p>
<pre class="brush: plain; title: ;">
$ rails generate controller Pages home contact
</pre>
<p>You'll see a bunch of files created. Let's get rid of some of the unnecessary files rspec made</p>
<pre class="brush: plain; title: ;">
$ rm -rf spec/helpers
$ rm -rf spec/views
</pre>
<p>Now let's run our test without autotest. We should have 2 success and 0 failures at this point.</p>
<pre class="brush: plain; title: ;">
$ bundle exec rspec spec/
</pre>
<p>Now open two terminal windows or tabs and cd back to your project directory in both of them.<br />
In one tab, execute </p>
<pre class="brush: plain; title: ;">$ bundle exec spork</pre>
<p>You may see a bunch of warning messages. It's safe to ignore these for the time being. If everything went well, you should see</p>
<pre class="brush: plain; title: ;">
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!
</pre>
<p>In the other tab you opened, simply execute</p>
<pre class="brush: plain; title: ;">$ autotest -c</pre>
<p>Once again, you may see a bunch of warning messages in the terminal, and these are also safe to ignore for now. More importantly, you should see a pop up notification that shows that the tests passed. You'll also see</p>
<pre class="brush: plain; title: ;">
Finished in 0.xxxx seconds
2 examples, 0 failures
</pre>
<p>in the window/tab where you executed autotest.</p>
<p>Now, to see if the autotest is working properly, lets open spec/controllers/pages_controller_spec.rb. The file contains the following:</p>
<pre class="brush: ruby; title: ;">
require 'spec_helper'

describe PagesController do

  describe &quot;GET 'home'&quot; do
    it &quot;should be successful&quot; do
      get 'home'
      response.should be_success
    end
  end

  describe &quot;GET 'contact'&quot; do
    it &quot;should be successful&quot; do
      get 'contact'
      response.should be_success
    end
  end

end
</pre>
<p>Lets make the test fail by changing all occurances of "contact" in the second describe block to "about".</p>
<pre class="brush: ruby; title: ;">
require 'spec_helper'

describe PagesController do

  describe &quot;GET 'home'&quot; do
    it &quot;should be successful&quot; do
      get 'home'
      response.should be_success
    end
  end

  describe &quot;GET 'about'&quot; do
    it &quot;should be successful&quot; do
      get 'about'
      response.should be_success
    end
  end

end
</pre>
<p>We should get a pop up saying that the test failed, and you can find the details in the tab with autotest running.</p>
<pre class="brush: plain; title: ;">
Finished in 0.07293 seconds
2 examples, 1 failure

Failed examples:

rspec ./spec/controllers/pages_controller_spec.rb:13 # PagesController GET 'about' should be successful

# Waiting since 2011-09-13 14:19:31
</pre>
<p>If this shows up along with the pop up, congratulations, you've successufully integrated Spork and Autotest into RSpec!</p>
<p><strong>Note:</strong> Sometimes spork can get kind of screwy. If you're ever in a situation where you KNOW a test should pass or should fail, you should restart spork and see if that helps.</p>
<h2>Do I have to do this EVERY TIME?!?!</h2>
<p>Nope! For subsequent projects, your procedure should be as follows:</p>
<pre class="brush: plain; title: ;">
$ git clone git@github.com:joequery/Rails-Template.git
$ cd Rails-Template
$ rails g rename_to MyApp
$ bundle install
</pre>
<p>In a separate window/tab</p>
<pre class="brush: plain; title: ;">
$ bundle exec spork
</pre>
<p>In another separate window/tab</p>
<pre class="brush: plain; title: ;">
$ autotest
</pre>
<p>And that's it!</p>
<h2>Feedback</h2>
<p>Did the tutorial help? Did you find parts of the tutorial unclear? Let us know in the comments below!<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/autotest-work-ghetto/' title='Autotest Won&#8217;t Work &#8211; Just Be Ghetto!'>Autotest Won&#8217;t Work &#8211; Just Be Ghetto!</a></li>
<li><a href='http://www.vertstudios.com/blog/ruby-warning-insecure-world-writable-dir/' title='[SOLVED] warning: Insecure world writable dir'>[SOLVED] warning: Insecure world writable dir</a></li>
<li><a href='http://www.vertstudios.com/blog/list-rails-session-variables/' title='List of Rails Session Variables'>List of Rails Session Variables</a></li>
<li><a href='http://www.vertstudios.com/blog/rails-singularplural-reference-chart/' title='Rails Singular/Plural Reference Chart'>Rails Singular/Plural Reference Chart</a></li>
<li><a href='http://www.vertstudios.com/blog/remove-ruby-gems-ubuntu/' title='Remove All Ruby Gems (Ubuntu)'>Remove All Ruby Gems (Ubuntu)</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3726" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/installing-rspec-autotest-spork-ubuntu-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails Singular/Plural Reference Chart</title>
		<link>http://www.vertstudios.com/blog/rails-singularplural-reference-chart/</link>
		<comments>http://www.vertstudios.com/blog/rails-singularplural-reference-chart/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 17:03:13 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3718</guid>
		<description><![CDATA[I've begun my descent into pure Rails. The whole naming convention idiom is hard to remember while I'm just learning, so here's a reference chart for myself and for any other Rails noobs. ]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve begun my descent into pure Rails. The whole naming convention idiom is hard to remember while I&#8217;m just learning, so here&#8217;s a reference chart for myself and for any other Rails noobs. </p>
<pre class="brush: plain; title: ;">
# Routes
resources: users

# Controllers
users_controller.rb
class UsersController &lt; ApplicationController
@users = User.all

# Models
user.rb (model)
class User &lt; ActiveRecord::Base
</pre>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/ruby-warning-insecure-world-writable-dir/' title='[SOLVED] warning: Insecure world writable dir'>[SOLVED] warning: Insecure world writable dir</a></li>
<li><a href='http://www.vertstudios.com/blog/installing-rspec-autotest-spork-ubuntu-osx/' title='Installing RSpec, Autotest, and Spork on Ubuntu/OS X'>Installing RSpec, Autotest, and Spork on Ubuntu/OS X</a></li>
<li><a href='http://www.vertstudios.com/blog/remove-ruby-gems-ubuntu/' title='Remove All Ruby Gems (Ubuntu)'>Remove All Ruby Gems (Ubuntu)</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3718" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/rails-singularplural-reference-chart/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Snippet: What Linux Distro is Running?</title>
		<link>http://www.vertstudios.com/blog/what-linux-distro-running/</link>
		<comments>http://www.vertstudios.com/blog/what-linux-distro-running/#comments</comments>
		<pubDate>Sun, 04 Sep 2011 18:26:46 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3712</guid>
		<description><![CDATA[Quick snippet here for you guys!  You're a dev SSHing into various VPS's and you need to know what linux distro you're running. ]]></description>
			<content:encoded><![CDATA[<p>Quick snippet here for you guys!  You&#8217;re a dev SSHing into various VPS&#8217;s and you need to know what linux distro you&#8217;re running. Simply execute</p>
<pre class="brush: plain; title: ;">
cat /etc/*release
</pre>
<p>For example, on Media Temple (dv), the following comes up</p>
<pre class="brush: plain; title: ;">
CentOS release 5.5 (Final)
</pre>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/multiple-screenrc-configurations-gnu-screen-tutorial/' title='Multiple .screenrc Configurations | GNU Screen Tutorial'>Multiple .screenrc Configurations | GNU Screen Tutorial</a></li>
<li><a href='http://www.vertstudios.com/blog/remove-ruby-gems-ubuntu/' title='Remove All Ruby Gems (Ubuntu)'>Remove All Ruby Gems (Ubuntu)</a></li>
<li><a href='http://www.vertstudios.com/blog/linux-snippet-run-bash-profile-start/' title='Linux Snippet: Run ~/.bash_profile on Startup (GNOME)'>Linux Snippet: Run ~/.bash_profile on Startup (GNOME)</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3712" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/what-linux-distro-running/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Avoiding the AJAX New Line Pitfall</title>
		<link>http://www.vertstudios.com/blog/avoiding-ajax-newline-pitfall/</link>
		<comments>http://www.vertstudios.com/blog/avoiding-ajax-newline-pitfall/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 20:11:40 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>

		<guid isPermaLink="false">http://www.vertstudios.com/blog/?p=3695</guid>
		<description><![CDATA[Here, my friends, is a JavaScript pitfall that has plagued entire workdays. It's small and simple, but menacing ... you'd do well to heed this warning! ]]></description>
			<content:encoded><![CDATA[<p>Here, my friends, is a JavaScript pitfall that has plagued entire workdays. It&#8217;s small and simple, but menacing &#8230; you&#8217;d do well to heed this warning! </p>
<h2>Beware of Trailing New Lines!</h2>
<p>If you&#8217;re retrieving information via AJAX, you have two easy options for retaining your sanity:</p>
<ul>
<li>Make sure the document sending a response to your AJAX request has no trailing Newline. This includes all the files that may be <i>included</i> or <i>required</i> in a php file.</li>
<li>Sanitize the server response with a <a href="http://stackoverflow.com/questions/3000649/trim-spaces-from-start-and-end-of-string">whitespace trim function</a></li>
</ul>
<p>Why is that? Let&#8217;s take a look at an example.</p>
<h2>Example of the Pitfall</h2>
<p>Let&#8217;s execute a simple jQuery.post request to see how this can happen. </p>
<pre class="brush: xml; title: ;">
&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;jQuery AJAX Pitfall&lt;/title&gt;
	&lt;/head&gt;
	&lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js&quot;&gt;&lt;/script&gt;

	&lt;script type=&quot;text/javascript&quot;&gt;
$.post(&quot;ajax.php&quot;, function(data) {
			alert(data == &quot;foo&quot;)
	 });
	&lt;/script&gt;
&lt;body&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Now we have a file ajax.php</p>
<pre class="brush: php; title: ;">
&lt;?php
require(&quot;whitespacetrap.php&quot;);
echo &quot;foo&quot;;
?&gt;
</pre>
<p>The file <b>whitespacetrap.php</b> is simply a file with a newline. (Just open up notepad and press enter once and save).</p>
<p>You&#8217;ll see &#8220;false&#8221; as the alert when you load up the html file. Now comment out the require file in ajax.php, and reload the html file. It&#8217;s now true! That new line is concatenated with the echo and returned. This will completely screw up any string comparisons with the response message. </p>
<h2>Moral of the Story</h2>
<p>Use console.log or alert to echo print the value the server sends. If your string comparisons fail when you <em>KNOW</em> they shouldn&#8217;t, make sure there are no stray newlines in the files associated with an AJAX request.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.vertstudios.com/blog/static-classes-js-immutable-members/' title='Static Classes in JavaScript with Immutable Members'>Static Classes in JavaScript with Immutable Members</a></li>
<li><a href='http://www.vertstudios.com/blog/getelementbyid-ie7-issue/' title='getElementById IE7 Issue'>getElementById IE7 Issue</a></li>
<li><a href='http://www.vertstudios.com/blog/killer-javascript-video-book-review/' title='Book Review: Killerjavascript.com'>Book Review: Killerjavascript.com</a></li>
<li><a href='http://www.vertstudios.com/blog/javascript-convert-miles-kilometers/' title='Convert Miles to Kilometers with JavaScript'>Convert Miles to Kilometers with JavaScript</a></li>
</ul>
 <img src="http://www.vertstudios.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3695" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.vertstudios.com/blog/avoiding-ajax-newline-pitfall/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

