<?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>Ivan Enviroman &#187; ruby</title>
	<atom:link href="http://www.ivanenviroman.com/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ivanenviroman.com</link>
	<description>Sustainability, Business, Technology, and Spirit</description>
	<lastBuildDate>Wed, 28 Jul 2010 17:40:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>The Simplest Possible Cucumber Test</title>
		<link>http://www.ivanenviroman.com/test-post/</link>
		<comments>http://www.ivanenviroman.com/test-post/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 21:15:59 +0000</pubDate>
		<dc:creator>ivanoats</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[rubyonrails]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[webdesign]]></category>
		<category><![CDATA[webdevelopment]]></category>

		<guid isPermaLink="false">http://www.ivanenviroman.com/?p=1656</guid>
		<description><![CDATA[I&#8217;m not really that good at testing. So what, so are a lot of people. Having some tests is better than none! And, the way testing tutorials are written can seem really complex and scary. Today I started thinking about &#8230; <a href="http://www.ivanenviroman.com/test-post/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not really that good at testing. So what, so are a lot of people. Having some tests is better than none! And, the way testing tutorials are written can seem really complex and scary. Today I started thinking about the simplest possible way to get started with web app testing.</p>
<p>When I&#8217;m getting back into a project after not working on it for a while, I just want to know whether the application works. I want to know whether it will run on my development environment, even if I&#8217;m on a new machine. I have three computers that I use at various locations so this is important to me.</p>
<p>So for me the simplest possible test would be:</p>
<ul>
<li>The home page should load. That is the default route should return a successful page without any errors. It will have some key piece of text that says it&#8217;s working.</li>
</ul>
<p>Here&#8217;s how I do it with <a href="http://www.cukes.info/">cucumber</a>:</p>
<p>If you haven&#8217;t installed the cucumber gems yet, put this in your <code>config/test.rb</code>file.
</p>
<p>If you haven&#8217;t cucumber set up yet, run
<pre class="brush: php">script/generate cucumber</pre>
</p>
<p>Then, create the file below:</p>
<p>File: features/homepage.feature</p>
<pre class="brush: ruby">
Feature: View homepage for app
  In order to make sure the app loads
  As a user
  I want to see the home page

Scenario: Homepage should say Search
  When I go to the homepage
  Then I should see &quot;Search&quot;
</pre>
<p>Tip: none of what you write in the Feature section really matters. It&#8217;s just for you or your client&#8217;s benefit.</p>
<p>Then, run
<pre class="brush: php">cucumber features</pre>
</p>
<p>You should get the following output:</p>
<pre class="brush: ruby">
:&gt; cucumber features
Feature: View homepage for app
  In order to make sure the app loads
  As a user
  I want to see the home page

  Scenario: Homepage should say Search # features/homepage.feature:6
    When I go to the homepage          # features/step_definitions/webrat_steps.rb:10
    Then I should see &quot;My Telltale Text&quot; # features/step_definitions/webrat_steps.rb:118

1 scenario (1 passed)
2 steps (2 passed)
</pre>
</p>
<p>Some cool things about this: &#8220;the homepage&#8221; is something that cucumber / webrat understands out of the box. See features/step_definitions/webrat_steps.rb for how to define other custom route names. And also, &#8220;I should see &#8220;something in quotes&#8221; is out of the box cucumber goodness.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ivanenviroman.com/test-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate Random Passwords</title>
		<link>http://www.ivanenviroman.com/random-password-generator/</link>
		<comments>http://www.ivanenviroman.com/random-password-generator/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 06:11:15 +0000</pubDate>
		<dc:creator>ivanoats</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.ivanenviroman.com/sustainable-websites-green-web-hosting-generate-random-passwords/</guid>
		<description><![CDATA[I wrote an article on the Sustainable Websites Blog on a quick program to Generate Random Passwords.]]></description>
			<content:encoded><![CDATA[<p>I wrote an article on the Sustainable Websites Blog on a quick program to <a href="http://www.sustainablewebsites.com/article/random-password-generator">Generate Random Passwords</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ivanenviroman.com/random-password-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Screen Scraping with Ruby</title>
		<link>http://www.ivanenviroman.com/screen-scraping-with-ruby/</link>
		<comments>http://www.ivanenviroman.com/screen-scraping-with-ruby/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 20:19:15 +0000</pubDate>
		<dc:creator>ivanoats</dc:creator>
				<category><![CDATA[Bookmarks]]></category>
		<category><![CDATA[rubyonrails]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[screenscraping]]></category>

		<guid isPermaLink="false">http://delicious.com/url/ae4d7a5067bac8b38ee503ebc7727569#ivanoats</guid>
		<description><![CDATA[Useful short presentation explaining regular expressions, xpath, firebug, hpricot and screen scraping <a href="http://www.ivanenviroman.com/screen-scraping-with-ruby/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Useful short presentation explaining regular expressions, xpath, firebug, hpricot and screen scraping</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ivanenviroman.com/screen-scraping-with-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails for PHP Developers &#8211; Reference</title>
		<link>http://www.ivanenviroman.com/rails-for-php-developers-reference/</link>
		<comments>http://www.ivanenviroman.com/rails-for-php-developers-reference/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 19:52:49 +0000</pubDate>
		<dc:creator>ivanoats</dc:creator>
				<category><![CDATA[Bookmarks]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://delicious.com/url/05b063ef193d8835c36786e582b283cb#ivanoats</guid>
		<description><![CDATA[Finally, this is a great resource for PHP programmers switching to Ruby like me. This function reference covers commonly used PHP libraries to their closest Ruby equivalents. The reference is structured very closely against the PHP reference library. <a href="http://www.ivanenviroman.com/rails-for-php-developers-reference/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Finally, this is a great resource for PHP programmers switching to Ruby like me. This function reference covers commonly used PHP libraries to their closest Ruby equivalents. The reference is structured very closely against the PHP reference library.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ivanenviroman.com/rails-for-php-developers-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WHM XML API Ruby</title>
		<link>http://www.ivanenviroman.com/whm-xml-api-ruby/</link>
		<comments>http://www.ivanenviroman.com/whm-xml-api-ruby/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 18:32:44 +0000</pubDate>
		<dc:creator>Ivan Storck</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[web host manager]]></category>
		<category><![CDATA[web hosting]]></category>
		<category><![CDATA[whm]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.ivanenviroman.com/?p=258</guid>
		<description><![CDATA[I&#8217;m working on a ruby wrapper to the WHM (Web Host Manager) XML API. It is on GitHub and it is under an MIT open source license. This code can be used to manage a reseller account on a web &#8230; <a href="http://www.ivanenviroman.com/whm-xml-api-ruby/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a ruby wrapper to the WHM (Web Host Manager) XML API. <a href="http://github.com/ivanoats/whm_xml_api_ruby">It is on GitHub</a> and it is under an MIT open source license. </p>
<p>This code can be used to manage a reseller account on a web host that uses the WHM/Cpanel system. It can install new accounts, suspend/unsuspend accounts and other methods  </p>
<p>Currently it is unfinished and I am looking for some help to implement all the functions. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ivanenviroman.com/whm-xml-api-ruby/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>RailRoad diagrams generator</title>
		<link>http://www.ivanenviroman.com/railroad-diagrams-generator/</link>
		<comments>http://www.ivanenviroman.com/railroad-diagrams-generator/#comments</comments>
		<pubDate>Sat, 11 Oct 2008 10:36:36 +0000</pubDate>
		<dc:creator>ivanoats</dc:creator>
				<category><![CDATA[Bookmarks]]></category>
		<category><![CDATA[diagrams]]></category>
		<category><![CDATA[object-model]]></category>
		<category><![CDATA[oop]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://delicious.com/url/21cc5aabfec7aaf2fbe29f27a0e6469e#ivanoats</guid>
		<description><![CDATA[RailRoad is a class diagrams generator for Ruby on Rails applications. It&#39;s a Ruby script that loads the application classes and analyzes its properties (attributes, methods) and relationships (inheritance, model associations like has_many, etc.) The output is a graph description in the DOT language, suitable to be handled with tools like Graphviz. <a href="http://www.ivanenviroman.com/railroad-diagrams-generator/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>RailRoad is a class diagrams generator for Ruby on Rails applications. It&#39;s a Ruby script that loads the application classes and analyzes its properties (attributes, methods) and relationships (inheritance, model associations like has_many, etc.) The output is a graph description in the DOT language, suitable to be handled with tools like Graphviz.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ivanenviroman.com/railroad-diagrams-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails SEO Tips</title>
		<link>http://www.ivanenviroman.com/ruby-on-rails-seo-tips/</link>
		<comments>http://www.ivanenviroman.com/ruby-on-rails-seo-tips/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 05:40:47 +0000</pubDate>
		<dc:creator>ivanoats</dc:creator>
				<category><![CDATA[Bookmarks]]></category>
		<category><![CDATA[rubyonrails]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://delicious.com/url/5409968f0a810226715ac442781ff634#ivanoats</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.ivanenviroman.com/ruby-on-rails-seo-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails Code Quality Checklist &#8211; Articles &#8211; Matthew Moore</title>
		<link>http://www.ivanenviroman.com/ruby-on-rails-code-quality-checklist-articles-matthew-moore/</link>
		<comments>http://www.ivanenviroman.com/ruby-on-rails-code-quality-checklist-articles-matthew-moore/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 05:35:32 +0000</pubDate>
		<dc:creator>ivanoats</dc:creator>
				<category><![CDATA[Bookmarks]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[rubyonrails]]></category>
		<category><![CDATA[bestpractice]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[quality]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://delicious.com/url/49c742abe61c3d4d5c5457624bc50111#ivanoats</guid>
		<description><![CDATA[In Matt Moore&#039;s experience, Ruby and Ruby on Rails has been one of the most difficult language/framework combinations to truly master.  For someone who grew up on C, C++ &#38; Java in the majority of their training, Ruby has hugely different (and better!) ways of OO design, and the Rails framework has a lot of opinions to be understood and remembered.  As long as it&#039;s taken to master them to the level he has - and he&#039;s sure there&#039;s still a long way to go - he loves it and won&#039;t be going back. <a href="http://www.ivanenviroman.com/ruby-on-rails-code-quality-checklist-articles-matthew-moore/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In Matt Moore&#039;s experience, Ruby and Ruby on Rails has been one of the most difficult language/framework combinations to truly master.  For someone who grew up on C, C++ &amp; Java in the majority of their training, Ruby has hugely different (and better!) ways of OO design, and the Rails framework has a lot of opinions to be understood and remembered.  As long as it&#039;s taken to master them to the level he has &#8211; and he&#039;s sure there&#039;s still a long way to go &#8211; he loves it and won&#039;t be going back.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ivanenviroman.com/ruby-on-rails-code-quality-checklist-articles-matthew-moore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to remove subversion (SVN) info from a project</title>
		<link>http://www.ivanenviroman.com/how-to-remove-subversion-svn-info-from-a-project/</link>
		<comments>http://www.ivanenviroman.com/how-to-remove-subversion-svn-info-from-a-project/#comments</comments>
		<pubDate>Wed, 13 Feb 2008 00:35:07 +0000</pubDate>
		<dc:creator>Ivan Storck</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.ivanenviroman.com/2008/02/12/how-to-remove-subversion-svn-info-from-a-project/</guid>
		<description><![CDATA[Sometimes when I&#8217;m coding I need to remove all the subversion (SVN &#8211; a source code version control program, which if you&#8217;re a non-programmer, you could also use for any documents you want to version control) information from the project. &#8230; <a href="http://www.ivanenviroman.com/how-to-remove-subversion-svn-info-from-a-project/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sometimes when I&#8217;m coding I need to remove all the subversion (<a href="http://svnbook.red-bean.com/" title="Subversion Manual">SVN</a> &#8211; a source code version control program, which if you&#8217;re a non-programmer, <a href="http://lifehacker.com/software/subversion/hack-attack-how-to-set-up-a-personal-home-subversion-server-188582.php" title="why, and what is version control with subversion">you could also use</a> for any documents you want to version control) information from the project. Perhaps you&#8217;ve copied the code to another directory and want to start a new source repository, or have some other reason. I wrote a short ruby script to help called &#8216;stripsvn&#8217; Here it is:</p>
<pre>
<code>#!/usr/bin/env ruby
# note above line may need to be changed on linux - use 'which ruby' to find path to ruby
# by Ivan Storck 13 February 2008
puts "The current directory is #{ENV["PWD"]}"
puts "About to delete ALL subversion info from this directory and all directories below"
print "WARNING - this is permanent! Type YES to continue:"
confirm = gets
if confirm == "YES\n" or confirm == nil
  puts `find . -name .svn -type d -print0 | xargs -0 rm -rf`
  puts "Deleted all subversion info"
else
  puts "Command aborted"
end
</code>
</pre>
<p>I put this in a file called stripsvn in a folder called bash_scripts (I know, it&#8217;s not written in bash, it&#8217;s in ruby) &#8211; that was in my path from the command line so I could just type <code>stripsvn</code> at the terminal and run the command. You could put it anywhere, but it&#8217;s useful to have a folder that you put scripts you&#8217;ve wrote in, and have it included in your path. You might also have to <code>chmod 755 stripsvn</code> to make it executable. This short script is a good example of using mostly ruby to write a useful shell script and only use bash or what I&#8217;d call &#8220;unix&#8221; commands when you have to. It&#8217;s all ruby except for the line with the find that actually does the deleting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ivanenviroman.com/how-to-remove-subversion-svn-info-from-a-project/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Sinatra : Classy web-development dressed in a DSL</title>
		<link>http://www.ivanenviroman.com/sinatra-classy-web-development-dressed-in-a-dsl/</link>
		<comments>http://www.ivanenviroman.com/sinatra-classy-web-development-dressed-in-a-dsl/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 10:59:50 +0000</pubDate>
		<dc:creator>Ivan Storck</dc:creator>
				<category><![CDATA[asides]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[webdevelopment]]></category>

		<guid isPermaLink="false">http://www.ivanenviroman.com/2007/11/13/sinatra-classy-web-development-dressed-in-a-dsl/</guid>
		<description><![CDATA[The world doesn&#8217;t think it needs another Ruby web framework, but Sinatra is so different it will cut out a new market. A whole web app can be encapsulated in a single Sinatra file, making it especially ideal for small &#8230; <a href="http://www.ivanenviroman.com/sinatra-classy-web-development-dressed-in-a-dsl/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The world doesn&#8217;t think it needs another Ruby web framework, but Sinatra is so different it will cut out a new market. A whole web app can be encapsulated in a single Sinatra file, making it especially ideal for small projects like Facebook apps. It even includes Haml markup! It was born out a need for something lighter than Ruby on Rails.</p>
<p><a href="http://sinatra.rubyforge.org/">read more</a> | <a href="http://digg.com/programming/Sinatra_Classy_web_development_dressed_in_a_DSL">digg story</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ivanenviroman.com/sinatra-classy-web-development-dressed-in-a-dsl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
