<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.2" -->
<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/"
	>

<channel>
	<title>IT.Signals</title>
	<link>http://itsignals.cascadia.com.au</link>
	<description>Musings on Ruby, Rails, C++ and whatever else</description>
	<pubDate>Fri, 17 Apr 2009 10:57:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>
	<language>en</language>
			<item>
		<title>HOWTO: Resize a KVM Virtual Machine Image</title>
		<link>http://itsignals.cascadia.com.au/?p=28</link>
		<comments>http://itsignals.cascadia.com.au/?p=28#comments</comments>
		<pubDate>Fri, 09 Jan 2009 00:40:47 +0000</pubDate>
		<dc:creator>etienne</dc:creator>
		
		<category><![CDATA[kvm]]></category>

		<category><![CDATA[ubuntu]]></category>

	<!-- AutoMeta Start -->
	<category>ubuntu</category>
	<category>kvm</category>
	<category>vm</category>
	<category>resize</category>
	<category>image</category>
	<category>file</category>
	<category>howto</category>
	<category>virtual</category>
	<category>machine</category>
	<category>image</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://itsignals.cascadia.com.au/?p=28</guid>
		<description><![CDATA[Last year I decided to build a new development server running a number of Virtual Machines. After spending two days hitting myself over the head with OpenSuse + Xen and coming away bloodied and bruised, I decided to give Ubuntu + KVM a go. So far I have been very impressed, everything worked as advertised [...]]]></description>
			<content:encoded><![CDATA[<p><font size="2">Last year I decided to build a new development server running a number of Virtual Machines. After spending two days hitting myself over the head with OpenSuse + Xen and coming away bloodied and bruised, I decided to give Ubuntu + KVM a go. So far I have been very impressed, everything worked as advertised and I was able to get up and running in no time at all, I think I am an Ubuntu convert&#8230;</font></p>
<p><font size="2">I originally created my VM with 20GB of disk space under the false impression that my image file would grow automatically as more space was required. After using the VM for sometime I realised that 20GB was not going to be enough and that I was going to need more space. The question was how do I increase the size without having to create the VM from scratch, not a task I relished as I&#8217;d spent many hours using the VM and had installed a lot of software and really did not want to repeat the process.</font></p>
<p><font size="2">I used Google to search for how I could achieve this thinking that a lot of people would strike this problem and that a solution would be but a few clicks away&#8230;wrong!  After a lot of searching I found a few articles on how this could be achieved, a lot of them where complicated including having to hack the MBR. After making a backup of my image file, I tried a couple of solutions but they ended up damaging my image file to the point where I could no longer boot the VM.</font></p>
<p><font size="2">It&#8217;s at this point I started to sweat, I had spent hours installing and setting up software within my VM, I really did not want to have to do it all over again! After a lot of experimentation I found something that works reliably for me, I&#8217;m sure there are better ways of doing this (is&#8217;nt there always!) but this works for me every time.<br />
</font></p>
<p><font size="2" color="#ff0000">DISCLAIMER: Take care in what you do, make sure you have a reliable backup of the VM image before you start. You do this at your own risk, I accept no responsibility if it all goes wrong.</font></p>
<p><font size="2">So let&#8217;s dive in&#8230;</font></p>
<p><font size="2"><strong>Step 1</strong>: Stop the VM</font></p>
<p><font size="2"><strong>Step 2</strong>: Change to the directory where your VM image files are stored, mine is in /kvm/ubuntu-dev/</font></p>
<blockquote>
<p><font size="2">cd /kvm/ubuntu-dev</font></p>
</blockquote>
<p><font size="2">Here is what my 20GB file looks like.</font></p>
<p><font size="2"><img alt="" style="clear: both;" src="/img/original_image_file.png" /></font></p>
<p><br clear=all></p>
<p><font size="2"><strong>Step 3</strong>: Backup the image file, my image file is called ubuntu-dev.img. I created a sub-directory called bak where I store my image backup file</font></p>
<blockquote>
<p><font size="2">sudo cp ubuntu-dev.img bak/ubuntu-dev.img.bak</font></p>
<p><br clear=all>
</p></blockquote>
<p><font size="2"><strong>Step 4</strong>: Create a blank qemu file, this is the file we will be adding to our VM image. Create it with a size equal to the amount of extra disk space you want added to your VM. In my case I want to add an additional 30GB of space.</font></p>
<blockquote>
<p><font size="2">sudo qemu-img create -f raw addon.raw 30G</font></p>
<p><br clear=all>
</p></blockquote>
<p><font size="2">This is what the addon file looks like on my system after it is created.</font></p>
<p><font size="2"><img src="/img/addon_file.png" alt="Addon file" style="clear: both;" />&nbsp;</font></p>
<p><br clear=all></p>
<p><font size="2"><strong>Step 5</strong>: Rename the original image file to .save as is shown in the image above. We never actually modify the original image file so we end up with two backup files, the .save as well as the backup file we created in Step 3, just in case something goes wrong. When you are sure everything has worked you can always delete these files.</font></p>
<p><font size="2"><strong>Step 6</strong>: We are now ready to combine the image file with the new blank qemu file we created earlier. You need to be logged in as the super user to perform this step.</font></p>
<blockquote>
<p><font size="2">su</font></p>
<p><font size="2">cat ubuntu-dev.img.save addon.raw &gt;&gt; ubuntu-dev.img</font></p>
<p><br clear=all>
</p></blockquote>
<p><font size="2"><strong>Step 7</strong>: Once this completes you can check the new file size, my new file size is now 50GB which is my original 20GB + 30GB of extra space.</font></p>
<p><font size="2"><img style="clear: both;" alt="Expanded file" src="/img/expanded_image_file.png" /></font></p>
<p><br clear=all></p>
<p><font size="2"><strong>Step 8</strong>: We have successfully increased the size of our image file by 30GB to 50GB, now we need to fix our partitions. To do this you need to downloaded <a href="http://gparted.sourceforge.net/livecd.php" onclick="javascript:urchinTracker ('/outbound/article/gparted.sourceforge.net');">GParted</a> and create a live CD. Once you have created the CD and loaded into your machine run the following command to start GParted using the new image file.</font></p>
<blockquote>
<p><font size="2">sudo qemu -hda ubuntu-dev.img -cdrom /dev/cdrom -boot d</font></p>
<p><br clear=all>
</p></blockquote>
<p><font size="2">The following window should be displayed.</font></p>
<p><font size="2"><img alt="Starting GParted" style="clear: both;" src="/img/gparted_start.png" />&nbsp;</font></p>
<p><br clear=all></p>
<p><font size="2">Select the &quot;GParted Live (Default settings)&quot; option or the one appropriate for you. You will then be prompted with a number of setup options, I normally accept the defaults. Once GParted has been loaded you should see your current VM image partitions, here is mine:</font></p>
<p><font size="2"><img style="clear: both;" alt="VM Image initial partitions" src="/img/gparted_running_init_layout.png" /></font></p>
<p><br clear=all></p>
<p><font size="2">The first thing we need to do is delete the swap partition so that the primary ext3 partition is next to the new unallocated space we added, this will allow us to expand the primary partition. Note that the correct device is selected in the top right hand corner, it shows our newly expanded 50GB device.</font></p>
<p><font size="2">So select the swap partition and select &quot;Delete&quot;, the command will be added to the pending operations list shown in the bottom panel. We can undo all operations until we select &quot;Apply&quot;.</font></p>
<p><font size="2"><img style="clear: both;" alt="Delete swap partition" src="/img/delete_swap.png" /></font></p>
<p><br clear=all></p>
<p><font size="2">Now we can resize the primary partition, select primary partition and select &quot;Rezise/Move&quot; and resize the partition as required. I&#8217;m reserving 2GB for the swap partition and allocate the rest to the primary partition.</font></p>
<p><font size="2"><img style="clear: both;" alt="Resise primary partition" src="/img/resize_partition.png" /></font></p>
<p><br clear=all></p>
<p><font size="2">The last step is to create a new swap partition.</font></p>
<p><font size="2"><img style="clear: both;" alt="Create swap partition" src="/img/create_swap.png" /></font></p>
<p><br clear=all></p>
<p><font size="2">We have now completed all the steps required to re-partition our image. We deleted the old swap partition, resized the primary partition and created a new swap partition. All these steps are listed as pending actions, we can still undo anything at this stage but I&#8217;m happy with what I&#8217;ve done and select &quot;Apply&quot; to get GParted to make the changes.</font></p>
<p><font size="2"><img style="clear: both;" alt="Complete changes" src="/img/complete_resize.png" /></font></p>
<p><br clear=all></p>
<p><font size="2">&nbsp;GParted will then start making the changes.</font></p>
<p><font size="2"><img src="/img/apply_steps_detail.png" alt="Changes in progress" style="clear: both;" /></font></p>
<p><br clear=all></p>
<p><font size="2">Once completed we can see our new partitions, the primary partition is now 48GB in size and we have a 2GB swap partition.</font></p>
<p><font size="2"><img src="/img/final_gparted_status.png" alt="Change completed" style="clear: both;" /></font></p>
<p><br clear=all></p>
<p><font size="2"><strong>Step 9</strong>: Exit GParted and restart your system, my VM automatically starts when the server is restarted. Login to the VM (hopefully everything starts ok). We need to activate the swap file in the new swap partition we created, so once you have logged in start GParted, your new partitions should be displayed.</font></p>
<p><font size="2">&nbsp;<img style="clear: both;" alt="New disk partition in VM" src="/img/new_disk_in_vm.png" /></font></p>
<p><br clear=all></p>
<p><font size="2">&nbsp;To activate the swap file, select the swap partition and press the right mouse button. The following popup menu should be displayed, select the &quot;Swapon&quot; option to turn the swap file on.</font></p>
<p><font size="2"><img style="clear: both;" alt="Swap menu" src="/img/swap_popup2.png" />&nbsp;</font></p>
<p><br clear=all></p>
<p><strong><font size="2">Conclusion</font></strong></p>
<p><font size="2">That&#8217;s it we have successfully added and extra 30GB of space to our VM image file. Once you are happy that everything is working you can remove your backup files. I normally keep mine for a little while until I&#8217;m 100% sure everything is working as it should.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://itsignals.cascadia.com.au/?feed=rss2&amp;p=28</wfw:commentRss>
		</item>
		<item>
		<title>Testing with the help of machinist, forgery, cucumber, webrat and rspec</title>
		<link>http://itsignals.cascadia.com.au/?p=30</link>
		<comments>http://itsignals.cascadia.com.au/?p=30#comments</comments>
		<pubDate>Wed, 07 Jan 2009 08:23:01 +0000</pubDate>
		<dc:creator>etienne</dc:creator>
		
		<category><![CDATA[cucumber]]></category>

		<category><![CDATA[rspec]]></category>

		<category><![CDATA[Rails]]></category>

		<category><![CDATA[Ruby]]></category>

	<!-- AutoMeta Start -->
	<category>rails</category>
	<category>ruby</category>
	<category>rspec</category>
	<category>testing</category>
	<category>cucumber</category>
	<category>forgery</category>
	<category>sham</category>
	<category>webrat</category>
	<category>bdd</category>
	<category>behavioral</category>
	<category>drive</category>
	<category>development</category>
	<category>machinist</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://itsignals.cascadia.com.au/?p=30</guid>
		<description><![CDATA[I&#8217;ve been using rspec for my testing for some now and have played around the edges with rspec user stories. When I started working on a new application a month or two ago I thought it would be a great opportunity to revisit my testing approach and my testing toolkit. After reading and researching the [...]]]></description>
			<content:encoded><![CDATA[<p><font size="2">I&#8217;ve been using <a href="http://github.com/dchelimsky/rspec/wikis/home" onclick="javascript:urchinTracker ('/outbound/article/github.com');">rspec</a> for my testing for some now and have played around the edges with rspec user stories. When I started working on a new application a month or two ago I thought it would be a great opportunity to revisit my testing approach and my testing toolkit. After reading and researching the current trends I have settled on the following:</font></p>
<ul>
<li><font size="2"><a href="http://github.com/notahat/machinist/tree/master" onclick="javascript:urchinTracker ('/outbound/article/github.com');">machinist</a> - After trying many fixture replacement plugins I&#8217;m happy with machinist, so far it does everything I need.</font></li>
<li><font size="2"><a href="http://github.com/sevenwire/forgery/tree/master" onclick="javascript:urchinTracker ('/outbound/article/github.com');">forgery</a> - Machinist includes Sham which allows me to create dummy data for my fixtures, I use forgery which is a very nice fake data generator to supply the data to Sham,</font></li>
<li><font size="2"><a href="http://github.com/aslakhellesoy/cucumber/tree/master" onclick="javascript:urchinTracker ('/outbound/article/github.com');">cucumber</a> - Is the replacement for rspec user stories, it allows you to write plain text stories (features) and execute them as functional tests.</font></li>
<li><font size="2"><a href="http://github.com/brynary/webrat/tree/master" onclick="javascript:urchinTracker ('/outbound/article/github.com');">webrat</a> - It lets you write expressive and robust acceptance tests for a Ruby web application.</font></li>
<li><font size="2"><a href="http://github.com/dchelimsky/rspec/wikis/home" onclick="javascript:urchinTracker ('/outbound/article/github.com');">rspec</a> - Is a Behaviour Driven Development (BDD) framework for writing executable code examples.</font></li>
</ul>
<p><font size="2">After reading lot&#8217;s of articles and looking at lots of example code I was finding it all very daunting, I found myself suffering from a severe case of coders block. I really did not know where to start, how to structure my code, how to write the features and so on. I was hoping that the <a href="http://www.pragprog.com/titles/achbd/the-rspec-book" onclick="javascript:urchinTracker ('/outbound/article/www.pragprog.com');">Rspec book</a></font> might have been released before I had to start development to give me some direction but the beta release has been delayed and I had to face my fears and dive in.</p>
<p><font size="2">Once I started, I was pleasantly surprised how natural the whole process felt, after writing my first half dozen features or so I was really starting to enjoy it! In this article I want to give a brief overview of what I did to get started, show some example features and steps, as well as demonstrating how all the tools in my toolkit mesh together to form a very nice testing framework. I&#8217;m still very new to the process of writing features and steps and am still becoming familiar with all the tools, so I&#8217;m sure that I will make adjustments as I become more experienced in using the framework.</font></p>
<p><font size="2">I will not go into how to install the plugins as this is well documented for each plugin.</font></p>
<p><strong><font size="3">Creating my fixtures</font></strong></p>
<p><font size="2">I create my fixtures using machinist. To use machinist you use a class method called blueprint which is an extension of ActiveRecord::Base which means you can use it on any of your ActiveRecord models. In my application I have an &quot;Account&quot; link that allows the user to modify their account details including the password and email address which is the first feature I wanted to write. So the first thing I did was to create some blueprints for my user models in the blueprint.rb file which resides in the spec directory. </font><font size="2">The first thing I do is define some standard sham&#8217;s that I will use in my blueprints, I use forgery to populate these shams with some good dummy data. </font></p>
<blockquote><p><font size="2">require &#8216;forgery&#8217;</p>
<p># Shams<br />
# We use forgery to make up some test data</p>
<p>Sham.name&nbsp; { NameForgery.full_name }<br />
Sham.login&nbsp; { InternetForgery.user_name }<br />
Sham.email&nbsp; { InternetForgery.email_address }<br />
Sham.password&nbsp; { BasicForgery.password }<br />
Sham.string { BasicForgery.text }<br />
Sham.text { LoremIpsumForgery.text }</p>
<p># Blueprints</p>
<p>Role.blueprint do<br />
&nbsp; name { &#8216;guest&#8217; }<br />
end</p>
<p>SiteUser.blueprint do<br />
&nbsp; user_type { &#8216;SiteUser&#8217; }<br />
&nbsp; login { Sham.login }<br />
&nbsp; name { Sham.name }<br />
&nbsp; email = Sham.email<br />
&nbsp; email { email }<br />
&nbsp; email_confirmation { email }<br />
&nbsp; pwd = Sham.password<br />
&nbsp; password { pwd }<br />
&nbsp; password_confirmation { pwd }<br />
&nbsp; accept_terms { &#8216;true&#8217; }<br />
&nbsp; time_zone { &#8216;Melbourne&#8217; } <br />
end</p>
<p>OpenidUser.blueprint do<br />
&nbsp; user_type { &#8216;OpenidUser&#8217; }<br />
&nbsp; time_zone { &#8216;Melbourne&#8217; } <br />
&nbsp; email { Sham.email }<br />
end<br />
</font>       </p></blockquote>
<p><font size="2">These blueprints allow me to easily create some objects using make, i.e.</font></p>
<blockquote>
<p><font size="2">user = SiteUser.make</font></p>
</blockquote>
<p><strong><font size="3">Where to put my test files</font></strong></p>
<p><font size="2">There are any number of ways to structure your files and directories, after reading <a href="http://github.com/aslakhellesoy/cucumber/wikis/cucumber-backgrounder" onclick="javascript:urchinTracker ('/outbound/article/github.com');">this</a> article I decided to create a new sub-directory for each model that I wanted to test, so my directory structure looks something like this:</font></p>
<p><font size="2"> <img height="210" width="227" src="/img/features_directory.png" alt="Directory structure" /></font></p>
<p>&nbsp;</p>
<p><font size="2">So for model User I created a users directory which contains a user.feature file and a steps_definitions sub-directory where the step files will be located, in this case we have user-steps.rb.</font></p>
<p><strong><font size="3">Setting up my env.rb</font></strong></p>
<p><font size="2">Before we start writing features we need to tweak the cucumber env.rb file. </font><font size="2">I&#8217;ve added code to load webrat and machinist</font><font size="2">, my file looks like this:</font></p>
<blockquote><p><font size="2"># Sets up the Rails environment for Cucumber<br />
ENV[&quot;RAILS_ENV&quot;] = &quot;test&quot;<br />
require File.expand_path(File.dirname(__FILE__) + &#8216;/../../config/environment&#8217;)<br />
require &#8216;cucumber/rails/world&#8217;<br />
Cucumber::Rails.use_transactional_fixtures</p>
<p># Add webrat<br />
require &quot;webrat&quot;<br />
Webrat.configure do |config|<br />
&nbsp; config.mode = :rails<br />
end</p>
<p># Comment out the next line if you&#8217;re not using RSpec&#8217;s matchers (should / should_not) in your steps.<br />
require &#8216;cucumber/rails/rspec&#8217;</p>
<p># Add machinist<br />
require File.join(RAILS_ROOT, &#8217;spec&#8217;, &#8216;blueprints&#8217;)<br />
</font>    </p></blockquote>
<p><strong><font size="3">Writing my first feature</font></strong></p>
<p><font size="2">The first feature I wanted to write was the ability for the user to display their account details once they had logged in. I initially started writing the feature using my own words to describe it, for example:</font></p>
<blockquote><p><font size="2">Feature: User functions</p>
<p>In order to maintain the correct account information<br />
As a logged in user<br />
I want to maintain my account information</p>
<p>Scenario: Display my account information if I am an SiteUser<br />
&nbsp; Given I am logged in as a SiteUser <br />
&nbsp; When I go to the &quot;Account&quot; page<br />
&nbsp; Then I should see my account details<br />
&nbsp;&nbsp;&nbsp; And I should see a &quot;Change Password&quot; link<br />
&nbsp;&nbsp;&nbsp; And I should see &quot;Change Email&quot; link<br />
</font>   </p></blockquote>
<p><font size="2">I then implemented each of these in my steps file using webrat. It&#8217;s only after some time that I realized that cucumber comes with a webrat steps definition file, i.e. webrat_steps.rb. Which contains a lot of standard webrat steps which I could directly call from my feature definition. So I could rewrite my scenario using the webrat steps:</font></p>
<blockquote><p><font size="2">Scenario: Display my account information if I am an SiteUser<br />
&nbsp; Given I am logged in as a SiteUser <br />
&nbsp;<strong> When I follow &quot;Account&quot; </strong><br />
&nbsp; <strong>Then I should see &quot;Account&quot;</strong><br />
&nbsp;&nbsp;&nbsp; And I should see my account details<br />
&nbsp;&nbsp;&nbsp; <strong>And I should see &quot;Change Password&quot;</strong><br />
&nbsp;&nbsp;&nbsp; <strong>And I should see &quot;Change Email&quot;</strong><br />
</font> </p></blockquote>
<p><font size="2">The steps in bold are all webrat steps that I do not have to implement in my own steps file as they are implemented in the webrat steps file! There are only two steps that I have to define myself.</font></p>
<p><font size="2"><strong>Step 1: Given I am logged in as a SiteUser</strong></font></p>
<p><font size="2">This step is quite involved as I have to figure out how to login a user using a user name/password, I also need to cater for those users that use an OpenID. I decided to create a step_helper.rb file which is located in the /features/step-definitions sub-directory and will be automatically loaded by cucumber, which will contain any shared steps. It currently contains only one step that handles the login process for a user and looks like this:</font></p>
<blockquote><p><font size="2"># Login<br />
# e.g.<br />
# Given I login as a SiteUser in the guest role<br />
# Given I login as a OpenidUser in the admin role<br />
#<br />
Given /I login as a (.*) in the (.*) role/i do |user_type, role|<br />
&nbsp; role = Role.make<br />
&nbsp; @user = Object::const_get(user_type).make_unsaved(:roles =&gt; role)&nbsp; <br />
&nbsp; if (!@user.openid)<br />
&nbsp;&nbsp;&nbsp; @user.activate!<br />
&nbsp;&nbsp;&nbsp; visit login_path<br />
&nbsp;&nbsp;&nbsp; fill_in(&quot;login&quot;, :with =&gt; @user.login)<br />
&nbsp;&nbsp;&nbsp; fill_in(&quot;password&quot;, :with =&gt; @user.password)<br />
&nbsp; else<br />
&nbsp;&nbsp;&nbsp; # identity_url not allowed to be set via mass assignment in blueprint<br />
&nbsp;&nbsp;&nbsp; @user.identity_url = &#8216;https://good.openid.url/&#8217;<br />
&nbsp;&nbsp;&nbsp; @user.activate!<br />
&nbsp;&nbsp;&nbsp; visit login_with_openid_path<br />
&nbsp;&nbsp;&nbsp; fill_in(&quot;openid_identifier&quot;, :with =&gt; @user.identity_url)&nbsp;&nbsp;&nbsp; <br />
&nbsp; end&nbsp; <br />
&nbsp; click_button(&quot;Log in&quot;)<br />
&nbsp; Then &#8216;I should see &quot;Dashboard&quot;&#8217;<br />
end<br />
</font> </p></blockquote>
<p><font size="2">&nbsp;To use it I create a separate step within my steps file. One important point to note is that you can reuse steps by calling them directly from within other steps. In the example below we are calling the shared login step from within the step by calling <em>Given &quot;I login as a #{user_type} in the guest role&quot;.</em></font></p>
<blockquote><p><font size="2">Given /I am logged in as a (.*)/i do |user_type|<br />
&nbsp;&nbsp; Given &quot;I login as a #{user_type} in the guest role&quot;<br />
end<br />
</font> </p></blockquote>
<p><font size="2">This step can then be used in my feature like this:</font></p>
<blockquote>
<p><font size="2">Given I am logged in as a SiteUser</font></p>
</blockquote>
<p><font size="2"><strong>Step 2: And I should see my account details</strong></font></p>
<p><font size="2">The last step we need to implement is the one that checks to make sure that the users account details are actually being displayed. The step do this looks like this:</font></p>
<blockquote><p><font size="2">Then /I should see my account details/ do<br />
&nbsp; Then &quot;I should see \&quot;#{@user.name}\&quot;&quot;<br />
&nbsp; Then &quot;I should see \&quot;#{@user.company}\&quot;&quot;<br />
end<br />
</font> </p></blockquote>
<p><strong><font size="3">Running my features</font></strong></p>
<p><font size="2">Before we run the feature here is the content of our feature and step file so far.</font></p>
<blockquote><p><font size="2">Feature: User functions</font><br />
<font size="2"> </font><br />
<font size="2"> In order to maintain the correct account information</font><br />
<font size="2"> As a logged in user</font><br />
<font size="2"> I want to maintain my account information</font><br />
<font size="2"> </font><br />
<font size="2"> Scenario: Display my account information if I am an SiteUser</font><br />
<font size="2"> &nbsp; Given I am logged in as a SiteUser </font><br />
<font size="2"> &nbsp; When I follow &quot;Account&quot; </font><br />
<font size="2"> &nbsp; Then I should see &quot;Account&quot;</font><br />
<font size="2"> &nbsp;&nbsp;&nbsp; And I should see my account details</font><br />
<font size="2"> &nbsp;&nbsp;&nbsp; And I should see &quot;Change Password&quot;</font><br />
<font size="2"> &nbsp;&nbsp;&nbsp; And I should see &quot;Change Email&quot;</font>
</p></blockquote>
<p><font size="2"> And my user-steps.rb looks like this:</font></p>
<blockquote><p><font size="2">Given /I am logged in as a (.*)/i do |user_type|<br />
&nbsp;&nbsp; Given &quot;I login as a #{user_type} in the guest role&quot;<br />
end</p>
<p>Then /I should see my account details/ do<br />
&nbsp; Then &quot;I should see \&quot;#{@user.name}\&quot;&quot;<br />
&nbsp; Then &quot;I should see \&quot;#{@user.company}\&quot;&quot;<br />
end<br />
</font>  </p></blockquote>
<p><font size="2">When I run the the feature assuming I&#8217;ve implemented the code I get the following output:</font></p>
<p><font size="2"><img height="225" width="973" src="/img/run_feature.png" alt="Feature result" /></font></p>
<p>&nbsp;</p>
<p><strong><font size="3">More example features</font></strong></p>
<p><font size="2">Here are a few more example features and the steps.<br />
</font></p>
<blockquote><p><font size="2">Feature: User functions</p>
<p>In order to maintain the correct account information<br />
As a logged in user<br />
I want to maintain my account information</p>
<p>Scenario: Display my account information if I am an SiteUser<br />
&nbsp; Given I am logged in as a SiteUser <br />
&nbsp; When I follow &quot;Account&quot; <br />
&nbsp; Then I should see &quot;Account&quot;<br />
&nbsp;&nbsp;&nbsp; And I should see my account details<br />
&nbsp;&nbsp;&nbsp; And I should see &quot;Change Password&quot;<br />
&nbsp;&nbsp;&nbsp; And I should see &quot;Change Email&quot;</p>
<p>Scenario: Display my account information if I am an OpenidUser<br />
&nbsp; Given I am logged in as a OpenidUser <br />
&nbsp; When I follow &quot;Account&quot; <br />
&nbsp; Then I should see &quot;Account&quot;<br />
&nbsp;&nbsp;&nbsp; And I should see my account details<br />
&nbsp;&nbsp;&nbsp; And I should not see &quot;Change Password&quot;<br />
&nbsp;&nbsp;&nbsp; And I should not see &quot;Change Email&quot;</p>
<p>Scenario: Allow me to change my password<br />
&nbsp; Given I am logged in as a SiteUser <br />
&nbsp; When I follow &quot;Account&quot; <br />
&nbsp;&nbsp;&nbsp; And I follow &quot;Change Password&quot;<br />
&nbsp;&nbsp;&nbsp; And I fill in my new password details<br />
&nbsp;&nbsp;&nbsp; And I press &quot;Change your password&quot;<br />
&nbsp; Then my password should be changed<br />
&nbsp;&nbsp;&nbsp; And I should see &quot;Account&quot;<br />
&nbsp;&nbsp;&nbsp; And I should see &quot;Password successfully updated&quot;</p>
<p>Scenario: Not allow me to change my password if the old password incorrect<br />
&nbsp; Given I am logged in as a SiteUser <br />
&nbsp; When I follow &quot;Account&quot; <br />
&nbsp;&nbsp;&nbsp; And I follow &quot;Change Password&quot;<br />
&nbsp;&nbsp;&nbsp; And I fill in an incorrect old password<br />
&nbsp;&nbsp;&nbsp; And I press &quot;Change your password&quot;<br />
&nbsp; Then my password should not be changed<br />
&nbsp;&nbsp;&nbsp; And I should see &quot;You password was not changed, your old password is incorrect.&quot;</p>
<p>Scenario: Not allow me to change my password when the password and confirmation is not the same<br />
&nbsp; Given I am logged in as a SiteUser <br />
&nbsp; When I follow &quot;Account&quot; <br />
&nbsp;&nbsp;&nbsp; And I follow &quot;Change Password&quot;<br />
&nbsp;&nbsp;&nbsp; And I fill in an incorrect password confirmation<br />
&nbsp;&nbsp;&nbsp; And I press &quot;Change your password&quot;<br />
&nbsp; Then my password should not be changed<br />
&nbsp;&nbsp;&nbsp; And I should see &quot;New password does not match the password confirmation.&quot;</p>
<p>Scenario: Allow me to change my account details<br />
&nbsp; Given I am logged in as a SiteUser <br />
&nbsp; When I follow &quot;Account&quot; <br />
&nbsp;&nbsp;&nbsp; And I fill in my new account details<br />
&nbsp;&nbsp;&nbsp; And I press &quot;Save&quot;<br />
&nbsp; Then my account details should be changed<br />
&nbsp;&nbsp;&nbsp; And I should see &quot;Account details updated.&quot;</p>
<p>Scenario: Allow me to change my email<br />
&nbsp; Given I am logged in as a SiteUser <br />
&nbsp; When I follow &quot;Account&quot; <br />
&nbsp;&nbsp;&nbsp; And I follow &quot;Change Email&quot;<br />
&nbsp;&nbsp;&nbsp; And I fill in my new email address<br />
&nbsp;&nbsp;&nbsp; And I press &quot;Change your email&quot;<br />
&nbsp; Then my email should be changed<br />
&nbsp;&nbsp;&nbsp; And I should see &quot;Account&quot;<br />
&nbsp;&nbsp;&nbsp; And I should see &quot;Email successfully updated&quot;</p>
<p>Scenario: Not allow me to change my email when the email and confirmation is not the same<br />
&nbsp; Given I am logged in as a SiteUser <br />
&nbsp; When I follow &quot;Account&quot; <br />
&nbsp;&nbsp;&nbsp; And I follow &quot;Change Email&quot;<br />
&nbsp;&nbsp;&nbsp; And I fill in an incorrect email confirmation<br />
&nbsp;&nbsp;&nbsp; And I press &quot;Change your email&quot;<br />
&nbsp; Then my email should not be changed<br />
&nbsp;&nbsp;&nbsp; And I should see &quot;New email does not match the email confirmation.&quot;<br />
</font>          </p></blockquote>
<p><font size="2">Steps in user-steps.rb</font></p>
<blockquote>
<p><font size="2">Given /I am logged in as a (.*)/i do |user_type|<br />
&nbsp;&nbsp; Given &quot;I login as a #{user_type} in the guest role&quot;<br />
end</p>
<p>Then /I should see my account details/ do<br />
&nbsp; Then &quot;I should see \&quot;#{@user.name}\&quot;&quot;<br />
&nbsp; Then &quot;I should see \&quot;#{@user.company}\&quot;&quot;<br />
end</p>
<p>When /I fill in my new password details/ do<br />
&nbsp; When &quot;I fill in \&quot;old_password\&quot; with \&quot;#{@user.password}\&quot;&quot;<br />
&nbsp; When &#8216;I fill in &quot;password&quot; with &quot;test_123&quot;&#8217;<br />
&nbsp; When &#8216;I fill in &quot;password_confirmation&quot; with &quot;test_123&quot;&#8217;<br />
end </p>
<p>When /I fill in an incorrect old password/ do<br />
&nbsp; When &quot;I fill in \&quot;old_password\&quot; with \&quot;#{@user.password + &#8216;xyz&#8217;}\&quot;&quot;<br />
&nbsp; When &#8216;I fill in &quot;password&quot; with &quot;test_123&quot;&#8217;<br />
&nbsp; When &#8216;I fill in &quot;password_confirmation&quot; with &quot;test_123&quot;&#8217;<br />
end </p>
<p>When /I fill in an incorrect password confirmation/ do<br />
&nbsp; When &quot;I fill in \&quot;old_password\&quot; with \&quot;#{@user.password}\&quot;&quot;<br />
&nbsp; When &#8216;I fill in &quot;password&quot; with &quot;test_123&quot;&#8217;<br />
&nbsp; When &#8216;I fill in &quot;password_confirmation&quot; with &quot;test_1234&quot;&#8217;<br />
end </p>
<p>When /I fill in my new account details/ do<br />
&nbsp; When &#8216;I fill in &quot;user_name&quot; with &quot;Fred Flintstone&quot;&#8217;<br />
&nbsp; When &#8216;I fill in &quot;user_company&quot; with &quot;Acme Rocks&quot;&#8217;<br />
&nbsp; When &#8216;I select &quot;(GMT+10:00) Canberra&quot; from &quot;user_time_zone&quot;&#8217;<br />
end </p>
<p>Then /my password should be changed/ do<br />
&nbsp; SiteUser.find_by_id(@user.id).authenticated?(&#8217;test_123&#8242;).should == true<br />
end</p>
<p>Then /my password should not be changed/ do<br />
&nbsp; SiteUser.find_by_id(@user.id).authenticated?(&#8217;test_123&#8242;).should == false<br />
end</p>
<p>Then /my account details should be changed/ do<br />
&nbsp; u = SiteUser.find_by_id(@user.id)<br />
&nbsp; u.name.should == &#8216;Fred Flintstone&#8217;<br />
&nbsp; u.company.should == &#8216;Acme Rocks&#8217;<br />
&nbsp; u.time_zone.should == &#8216;Canberra&#8217;<br />
end</p>
<p>When /I fill in my new email address/ do<br />
&nbsp; When &#8216;I fill in &quot;email&quot; with &quot;test@isp.com&quot;&#8217;<br />
&nbsp; When &#8216;I fill in &quot;email_confirmation&quot; with &quot;test@isp.com&quot;&#8217;<br />
end </p>
<p>When /I fill in an incorrect email confirmation/ do<br />
&nbsp; When &#8216;I fill in &quot;email&quot; with &quot;test@isp.com&quot;&#8217;<br />
&nbsp; When &#8216;I fill in &quot;email_confirmation&quot; with &quot;test123@isp.com&quot;&#8217;<br />
end </p>
<p>Then /my email should be changed/ do<br />
&nbsp; SiteUser.find_by_id(@user.id).email.should == &#8216;test@isp.com&#8217;<br />
end</p>
<p>Then /my email should not be changed/ do<br />
&nbsp; SiteUser.find_by_id(@user.id).email.should_not == &#8216;test@isp.com&#8217;<br />
end&nbsp; </font></p>
</blockquote>
<p><strong><font size="3">Feature Writing Style</font></strong></p>
<p><font size="2">There seems to be two styles that you can use when writing your features, &quot;Imperative&quot; and &quot;Declarative&quot; which is described in detail in the article <a href="http://www.benmabey.com/2008/05/19/imperative-vs-declarative-scenarios-in-user-stories/" onclick="javascript:urchinTracker ('/outbound/article/www.benmabey.com');">Imperative vs Declarative Scenarios in User Stories</a> written by Ben Mabey. </font>I understand the extreme cases as demonstrated by the examples given by Ben, but what about a feature such as this one, can this be classed as being written using the Imperative style?</p>
<blockquote>
<p><font size="2">Scenario: Allow me to change my password<br />
&nbsp; Given I am logged in as a SiteUser <br />
&nbsp; When I follow &quot;Account&quot; <br />
&nbsp;&nbsp;&nbsp; And I follow &quot;Change Password&quot;<br />
&nbsp;&nbsp;&nbsp; And I fill in my new password details<br />
&nbsp;&nbsp;&nbsp; And I press &quot;Change your password&quot;<br />
&nbsp; Then my password should be changed<br />
&nbsp;&nbsp;&nbsp; And I should see &quot;Account&quot;<br />
&nbsp;&nbsp;&nbsp; And I should see &quot;Password successfully updated&quot;</font></p>
</blockquote>
<p>Does the Imperative style dictate that all steps appear in the feature, the example above do have some steps that are defined in the steps file, but there are a few other details that could be moved to the steps file as well. So if the one above is Imperative does this modified version make it declarative?</p>
<blockquote>
<p><font size="2">Scenario: Allow me to change my password<br />
&nbsp; Given I am logged in as a SiteUser <br />
&nbsp; When I go to the &quot;Change Password&quot; page<br />
&nbsp;&nbsp;&nbsp; And I fill in my new password details<br />
&nbsp; Then my password details should be changed<br />
</font></p>
</blockquote>
<p>At this stage I&#8217;m not sure, for now I will stay with the first style as it provides details that may be important to someone reading the feature but hides the non-essential detail in the steps file.</p>
]]></content:encoded>
			<wfw:commentRss>http://itsignals.cascadia.com.au/?feed=rss2&amp;p=30</wfw:commentRss>
		</item>
		<item>
		<title>Rails and Sybase Adapative Server Anywhere (SQLAnywhere) - Part 3</title>
		<link>http://itsignals.cascadia.com.au/?p=29</link>
		<comments>http://itsignals.cascadia.com.au/?p=29#comments</comments>
		<pubDate>Mon, 05 Jan 2009 22:28:15 +0000</pubDate>
		<dc:creator>etienne</dc:creator>
		
		<category><![CDATA[Database]]></category>

		<category><![CDATA[Rails]]></category>

		<category><![CDATA[Ruby]]></category>

	<!-- AutoMeta Start -->
	<category>odbc</category>
	<category>dbmsname</category>
	<category>adapter</category>
	<category>sqlanywhere</category>
	<category>instantrails</category>
	<category>adaptiveserveranywhere</category>
	<category>line</category>
	<category>sybaseasa</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://itsignals.cascadia.com.au/?p=29</guid>
		<description><![CDATA[For anyone struggling to get SQL Anywhere working with Rails there is some good news, I&#8217;ve received and email from Eric Farrar from Sybase to let me know that he has been doing a lot of work on developing a new adaptor for SQL Anywhere. I&#8217;ve included the content of his email below for anyone [...]]]></description>
			<content:encoded><![CDATA[<p><font face="Verdana" size="2">For anyone struggling to get SQL Anywhere working with Rails there is some good news, I&#8217;ve received and email from </font><font face="Verdana" size="2">Eric Farrar from Sybase to let me know that he has been doing a lot of work on developing a new adaptor for SQL Anywhere. I&#8217;ve included the content of his email below for anyone interested.</font></p>
<blockquote dir="ltr" style="margin-right: 0px;">
<p><font face="Verdana" size="2">There is now a ActiveRecord adapter specifically for SQL Anywhere. It is available on RubyForge at&nbsp;<a href="http://sqlanywhere.rubyforge.org/" onclick="javascript:urchinTracker ('/outbound/article/sqlanywhere.rubyforge.org');">sqlanywhere.rubyforge.org/</a>. The source is hosted on GitHub and is available at&nbsp;<a href="http://github.com/sqlanywhere" onclick="javascript:urchinTracker ('/outbound/article/github.com');">github.com/sqlanywhere</a>. This driver does not go through ODBC, but instead uses the new C API library to directly interface with SQL Anywhere databases. Please note that this driver can only be used with SQL Anywhere 10 and greater.</font></p>
</blockquote>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://itsignals.cascadia.com.au/?feed=rss2&amp;p=29</wfw:commentRss>
		</item>
		<item>
		<title>Rails and Sybase Adapative Server Anywhere (SQLAnywhere) - Part 2</title>
		<link>http://itsignals.cascadia.com.au/?p=26</link>
		<comments>http://itsignals.cascadia.com.au/?p=26#comments</comments>
		<pubDate>Tue, 20 May 2008 00:26:29 +0000</pubDate>
		<dc:creator>etienne</dc:creator>
		
		<category><![CDATA[Database]]></category>

		<category><![CDATA[Rails]]></category>

		<category><![CDATA[Ruby]]></category>

	<!-- AutoMeta Start -->
	<category>odbc</category>
	<category>dbmsname</category>
	<category>adapter</category>
	<category>sqlanywhere</category>
	<category>instantrails</category>
	<category>adaptiveserveranywhere</category>
	<category>line</category>
	<category>sybaseasa</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://itsignals.cascadia.com.au/?p=26</guid>
		<description><![CDATA[As discussed in the Rails and Sybase Adapative Server Anywhere (SQLAnywhere)&#160;article I had to modify the odbc_adapter.rb code to allow the adapter to be used with my SybaseASA DB. Making the change to the adapter code directly is not an acceptable solution and until the developers of the adapter apply the change I had to [...]]]></description>
			<content:encoded><![CDATA[<p><font face="Verdana" size="2">As discussed in the </font><a href="http://itsignals.cascadia.com.au/?p=25"rel="bookmark"  ><font face="Verdana" size="2">Rails and Sybase Adapative Server Anywhere (SQLAnywhere)</font></a><font face="Verdana" size="2">&nbsp;article I had to modify the odbc_adapter.rb code to allow the adapter to be used with my SybaseASA DB. Making the change to the adapter code directly is not an acceptable solution and until the developers of the adapter apply the change I had to come up with an alternate solution.</font></p>
<p><font face="Verdana" size="2">The solution I came up with was to monkey-patch the method responsible for checking the DB type to allow SybaseASA to be seen as a valid DB. I added the following code to my environment.rb:</font></p>
<blockquote dir="ltr" style="margin-right: 0px">
<p><font face="Verdana" size="2"># Monkeypatch the ODBC Adapter so that it will work with SybaseASA<br />
# see </font><a href="http://odbc-rails.rubyforge.org/index.html" onclick="javascript:urchinTracker ('/outbound/article/odbc-rails.rubyforge.org');"><font face="Verdana" size="2">http://odbc-rails.rubyforge.org/index.html</font></a><br />
<font face="Verdana" size="2">module ActiveRecord<br />
&nbsp; module ConnectionAdapters<br />
&nbsp;&nbsp;&nbsp; class ODBCAdapter &lt; AbstractAdapter&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alias :orig_dbmsNameToSym :dbmsNameToSym</font></p>
<p><font face="Verdana" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def dbmsNameToSym(dbmsName, dbmsVer)&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Call original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; symbl = orig_dbmsNameToSym(dbmsName, dbmsVer)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rescue ActiveRecord::ActiveRecordError<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Catch exception if db not found in existing list, check<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # if SybaseASA, if not raise exception<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if dbmsName =~ /adaptiveserveranywhere/i<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; symbl = :sqlanywhere<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; raise ActiveRecord::ActiveRecordError, &quot;ODBCAdapter: Unsupported database (#{dbmsName})&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return symbl<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end</font></p>
<p><font face="Verdana" size="2">&nbsp;&nbsp;&nbsp; end<br />
&nbsp; end<br />
end</font></p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://itsignals.cascadia.com.au/?feed=rss2&amp;p=26</wfw:commentRss>
		</item>
		<item>
		<title>Rails and Sybase Adapative Server Anywhere (SQLAnywhere)</title>
		<link>http://itsignals.cascadia.com.au/?p=25</link>
		<comments>http://itsignals.cascadia.com.au/?p=25#comments</comments>
		<pubDate>Mon, 19 May 2008 03:13:23 +0000</pubDate>
		<dc:creator>etienne</dc:creator>
		
		<category><![CDATA[Database]]></category>

		<category><![CDATA[Rails]]></category>

		<category><![CDATA[Ruby]]></category>

	<!-- AutoMeta Start -->
	<category>odbc</category>
	<category>dbmsname</category>
	<category>adapter</category>
	<category>sqlanywhere</category>
	<category>instantrails</category>
	<category>adaptiveserveranywhere</category>
	<category>line</category>
	<category>sybaseasa</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://itsignals.cascadia.com.au/?p=25</guid>
		<description><![CDATA[In a previous article (Sybase DB Adapter)&#160;I wrote how I tried to install the Sybase adapter in an attempt to get access to an existing SybaseASA 9.0.2 DB. After doing some research I found that this adapter only works for the Enterprise edition of Sybase (i.e. SybaseASE).
So I needed to find an alternative that would [...]]]></description>
			<content:encoded><![CDATA[<p><font face="Verdana" size="2">In a previous article (</font><a href="http://itsignals.cascadia.com.au/?p=23" ><font face="Verdana" size="2">Sybase DB Adapter</font></a><font face="Verdana" size="2">)&nbsp;I wrote how I tried to install the Sybase adapter in an attempt to get access to an existing SybaseASA 9.0.2 DB. After doing some research I found that this adapter only works for the Enterprise edition of Sybase (i.e. SybaseASE).</font></p>
<p><font face="Verdana" size="2">So I needed to find an alternative that would work with SybaseASA or SQLAnywhere. After a lot of searching I came across a </font><a href="http://groups.google.com/group/ruby-on-rails-sql-anywhere-developers" onclick="javascript:urchinTracker ('/outbound/article/groups.google.com');"><font face="Verdana" size="2">group</font></a><font face="Verdana" size="2"> dedicated to this task, at this stage there is not a lot of activity. One of the postings from Bryan Lahartinger proved very helpful, in the article he mentions &quot;odbc-rails&quot;. I did a google search and found there is a Ruby project </font><a href="http://rubyforge.org/projects/odbc-rails" onclick="javascript:urchinTracker ('/outbound/article/rubyforge.org');"><font face="Verdana" size="2">ODBC Adapter for Ruby on Rails / Active Record</font></a><font face="Verdana" size="2">&nbsp;that has been developing an ODBC adapter for use with Rails.</font></p>
<p><font face="Verdana" size="2">The latest release has added support for SQLAnywhere so I dowloaded and installed it. There is a </font><a href="http://odbc-rails.rubyforge.org/" onclick="javascript:urchinTracker ('/outbound/article/odbc-rails.rubyforge.org');"><font face="Verdana" size="2">home</font></a><font face="Verdana" size="2"> page for this project which provides detailed installation instructions. I do my Rails development on Windows using InstantRails, a quick check confirmed that </font><a href="http://ch-werner.de/rubyodbc/" onclick="javascript:urchinTracker ('/outbound/article/ch-werner.de');"><font face="Verdana" size="2">Christian Werner&#8217;s ODBC</font></a><font face="Verdana" size="2"> module comes preloaded with InstantRails so I did not have to install it separately. I downloaded the gem file for V2.0 from </font><a href="http://rubyforge.org/frs/?group_id=1865" onclick="javascript:urchinTracker ('/outbound/article/rubyforge.org');"><font face="Verdana" size="2">rubyforge</font></a><font face="Verdana" size="2"> and installed it using:</font></p>
<blockquote dir="ltr" style="margin-right: 0px">
<p><font face="Verdana" size="2">gem install -l activerecord-odbc-adapter-2.0.gem &#8211;include-dependencies</font></p>
</blockquote>
<p><font face="Verdana" size="2">I setup my database.yml file to use the DSN I had previously defined to access the DB, i.e.</font></p>
<blockquote dir="ltr" style="margin-right: 0px">
<p><font face="Verdana" size="2">development:<br />
&nbsp; adapter: odbc<br />
&nbsp; dsn:&nbsp;mydatabase<br />
&nbsp; username:&nbsp;uid<br />
&nbsp; password: pwd</font></p>
</blockquote>
<p><font face="Verdana" size="2">I started my server which loaded without any&nbsp;problem but when I tried to run my application I got the following error:</font></p>
<blockquote dir="ltr" style="margin-right: 0px">
<p><font face="Verdana" size="2">ODBCAdapter: Unsupported database (adaptiveserveranywhere)</font></p>
</blockquote>
<p><font face="Verdana" size="2">As SybaseASA is the same as SQLAnywhere I changed the following line in odbc_adapter.rb (line #:1585) to get me going from:</p>
<p>elsif dbmsName =~ /SQLAnywhere/i </p>
<p>to:</p>
<p>elsif dbmsName =~ /SQLAnywhere/i or dbmsName =~ /adaptiveserveranywhere/i</font></p>
<p><font face="Verdana" size="2">So far everything seems to working without any problems, I&#8217;ve asked if it will be possible to get this change added to the gem, if not I will need to monkeypatch the source. Next I will attempt to do an install under Suse Linux as this is where the application will ultimately reside.</font></p>
<p><font face="Verdana" size="2"><em>Update: I&#8217;ve now added the monkey-patch to my application see </em><a href="http://itsignals.cascadia.com.au/?p=26" rel="bookmark" ><em>Rails ODBC Adapter with Sybase Adaptive Server Anywhere (SybaseASA)</em></a></font></p>
]]></content:encoded>
			<wfw:commentRss>http://itsignals.cascadia.com.au/?feed=rss2&amp;p=25</wfw:commentRss>
		</item>
		<item>
		<title>Sybase DB Adapter</title>
		<link>http://itsignals.cascadia.com.au/?p=23</link>
		<comments>http://itsignals.cascadia.com.au/?p=23#comments</comments>
		<pubDate>Thu, 15 May 2008 02:26:38 +0000</pubDate>
		<dc:creator>etienne</dc:creator>
		
		<category><![CDATA[gems]]></category>

		<category><![CDATA[Database]]></category>

		<category><![CDATA[Rails]]></category>

		<category><![CDATA[Ruby]]></category>

	<!-- AutoMeta Start -->
	<category>sybase</category>
	<category>adapter</category>
	<category>ruby</category>
	<category>rails</category>
	<category>gems</category>
	<category>activerecord</category>
	<category>install</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://itsignals.cascadia.com.au/?p=23</guid>
		<description><![CDATA[&#160;Update: This adapter only works with the enterprise edition of Sybase (i.e. Sybase ASE) not with SQLAnywhere (Sybase ASA)
One of my Rails projects require me to connect to a Sybase ASA database, I quickly figured out that I needed to install the sybase adapter as in Rails 2.0.2 these and some of the other databases [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;<font face="Verdana" size="2"><em>Update: This adapter only works with the enterprise edition of Sybase (i.e. Sybase ASE) not with SQLAnywhere (Sybase ASA)</em></font></p>
<p><font face="Verdana" size="2">One of my Rails projects require me to connect to a Sybase ASA database, I quickly figured out that I needed to install the sybase adapter as in Rails 2.0.2 these and some of the other databases have been pulled out of Rails core. According to the information in this <a href="http://weblog.rubyonrails.org/2007/10/1/adapter-gems-available" onclick="javascript:urchinTracker ('/outbound/article/weblog.rubyonrails.org');">article</a> you can achieve this by using this command:</font></p>
<blockquote dir="ltr" style="margin-right: 0px">
<p><font face="Verdana" size="2">gem install activerecord-sybase-adapter </font></p>
</blockquote>
<p><font face="Verdana" size="2">When I tried this I got the following error:</font></p>
<blockquote dir="ltr" style="margin-right: 0px">
<p><font face="Verdana" size="2">ERROR:&nbsp; could not find activerecord-database-adapter locally or in a repository</font></p>
</blockquote>
<p><font face="Verdana" size="2">The only way I got it to work was to use the -s option (&quot;Use URL as the remote source for gems&quot;), i.e.</font></p>
<blockquote dir="ltr" style="margin-right: 0px">
<p><font face="Verdana" size="2">gem install activerecord-sybase-adapter -s </font><a href="http://gems.rubyonrails.org" onclick="javascript:urchinTracker ('/outbound/article/gems.rubyonrails.org');"><font face="Verdana" size="2">http://gems.rubyonrails.org</font></a></p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://itsignals.cascadia.com.au/?feed=rss2&amp;p=23</wfw:commentRss>
		</item>
		<item>
		<title>refresh_to plugin rspec matcher</title>
		<link>http://itsignals.cascadia.com.au/?p=22</link>
		<comments>http://itsignals.cascadia.com.au/?p=22#comments</comments>
		<pubDate>Thu, 14 Feb 2008 12:00:10 +0000</pubDate>
		<dc:creator>etienne</dc:creator>
		
		<category><![CDATA[rspec]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[Rails]]></category>

		<category><![CDATA[Ruby]]></category>

	<!-- AutoMeta Start -->
	<category>refresh_to</category>
	<category>rspec</category>
	<category>matcher</category>
	<category>ruby</category>
	<category>rails</category>
	<category>plugin</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://itsignals.cascadia.com.au/?p=22</guid>
		<description><![CDATA[We have been using the refresh_to plugin in one of our projects. For those who do not know, the refresh_to plugin adds a refresh_to method to the ActionController::Base which allows us to avoid the IE security warnings when moving from a secure SSL page to an insecure page.
We are using rspec for our testing and [...]]]></description>
			<content:encoded><![CDATA[<p><font face="Verdana" size="2">We have been using the </font><a href="http://refresh-to.rubyforge.org/" onclick="javascript:urchinTracker ('/outbound/article/refresh-to.rubyforge.org');"><font face="Verdana" size="2">refresh_to</font></a><font face="Verdana" size="2"> plugin in one of our projects. For those who do not know, the refresh_to plugin adds a refresh_to method to the ActionController::Base which allows us to avoid the IE security warnings when moving from a secure SSL page to an insecure page.</font></p>
<p><font face="Verdana" size="2">We are using </font><a href="http://rspec.info/" onclick="javascript:urchinTracker ('/outbound/article/rspec.info');"><font face="Verdana" size="2">rspec</font></a><font face="Verdana" size="2"> for our testing and when I went to write some tests to test some code that uses the refresh_to method I found out that the standard redirect_to rspec matcher does not work with refresh_to. The same problem exist for the standard test method assert_response :redirect and assert_redirected_to my_url, but the plugin does supply replacement tests for these methods. The problem is that it does not supply a replacement for the rspec matcher so I had to write my own.</font>&nbsp;</p>
<blockquote dir="ltr" style="margin-right: 0px">
<p># The standard rspec redirect_to matcher does not work with the refresh_to <br />
# plugin methods, i.e. refresh_to and refresh_back_or_default.<br />
# This is also the case with the with the standard Rails functional <br />
# tests - assert_response :redirect and assert_redirected_to my_url.<br />
# The plugin has replacement test methods for these but they do not <br />
# have an rspec replacement for redirect_to so I&#8217;ve had to write my own.<br />
#<br />
module Spec<br />
&nbsp; module Rails<br />
&nbsp;&nbsp;&nbsp; module Matchers<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class RefreshTo&nbsp; #:nodoc:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def initialize(controller, expected)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @expected = expected<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @controller = controller<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def matches?(response)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; match_data = response.body.match(/&lt;meta http-equiv=&quot;refresh&quot; content=&quot;0;url=([\S]+)&quot;&gt;/)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false if (!match_data)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; parts = match_data[1].split(&quot;<a href="http://test.host" onclick="javascript:urchinTracker ('/outbound/article/test.host');">http://test.host</a>&quot;)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @actual = parts.last<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return match()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def match<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case @expected.class.to_s<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; when &#8216;String&#8217;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; parts = @expected.split(&quot;<a href="http://test.host" onclick="javascript:urchinTracker ('/outbound/article/test.host');">http://test.host</a>&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @expected = parts.last<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return @actual == @expected<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; when &#8216;Hash&#8217;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @expected = @controller.url_for(@expected)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return match()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def failure_message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return %Q{expected redirect to <a href="mailto:#{@expected.inspect">#{@expected.inspect</a>}, got redirect to <a href="mailto:#{@actual.inspect">#{@actual.inspect</a>}}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def negative_failure_message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return %Q{expected not to be redirected to <a href="mailto:#{@expected.inspect">#{@expected.inspect</a>}, but was}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def description<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;redirect to <a href="mailto:#{@actual.inspect">#{@actual.inspect</a>}&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # :call-seq:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; response.should refresh_to(url)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; response.should refresh_to(:action =&gt; action_name)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; response.should refresh_to(:controller =&gt; controller_name, :action =&gt; action_name)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; response.should_not refresh_to(url)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; response.should_not refresh_to(:action =&gt; action_name)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; response.should_not refresh_to(:controller =&gt; controller_name, :action =&gt; action_name)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Passes if the response is a redirect to the url, action or controller/action.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Useful in controller specs (integration or isolation mode).<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # == Examples<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; response.should refresh_to(&quot;path/to/action&quot;)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; response.should refresh_to(&quot;<a href="http://test.host/path/to/action" onclick="javascript:urchinTracker ('/outbound/article/test.host');">http://test.host/path/to/action</a>&quot;)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; response.should refresh_to(:action =&gt; &#8216;list&#8217;)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def refresh_to(opts)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RefreshTo.new(controller, opts)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
&nbsp;&nbsp;&nbsp; end</p>
<p>&nbsp; end<br />
end&nbsp;</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://itsignals.cascadia.com.au/?feed=rss2&amp;p=22</wfw:commentRss>
		</item>
		<item>
		<title>SMERF Homepage Finished</title>
		<link>http://itsignals.cascadia.com.au/?p=21</link>
		<comments>http://itsignals.cascadia.com.au/?p=21#comments</comments>
		<pubDate>Fri, 11 Jan 2008 04:17:53 +0000</pubDate>
		<dc:creator>etienne</dc:creator>
		
		<category><![CDATA[designer]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[builder]]></category>

		<category><![CDATA[questionnaire]]></category>

		<category><![CDATA[survey]]></category>

		<category><![CDATA[plugins]]></category>

	<!-- AutoMeta Start -->
	<category>SMERF</category>
	<category>meta</category>
	<category>rails</category>
	<category>ruby</category>
	<category>form</category>
	<category>survey</category>
	<category>builder</category>
	<category>designer</category>
	<category>questionnaire</category>
	<category>survey</category>
	<category>questionnaire</category>
	<category>builder</category>
	<category>surveys</category>
	<category>easy</category>
	<category>rails</category>
	<category>designer</category>
	<category>yaml</category>
	<category>ruby</category>
	<category>classes</category>
	<category>objects</category>
	<category>Rails</category>
	<category>survey</category>
	<category>builder</category>
	<category>ror</category>
	<category>rails</category>
	<category>questionnaire</category>
	<category>designer</category>
	<category>dynamic</category>
	<category>form</category>
	<category>user</category>
	<category>responses</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://itsignals.cascadia.com.au/?p=21</guid>
		<description><![CDATA[I&#8217;ve now completed the SMERF web site. On the site you will find details about SMERF including documentation, download information and so on. To go to the site now click on this link.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve now completed the SMERF web site. On the site you will find details about SMERF including documentation, download information and so on. To go to the site now click on this <a href="http://smerf.cascadia.com.au" >link</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://itsignals.cascadia.com.au/?feed=rss2&amp;p=21</wfw:commentRss>
		</item>
		<item>
		<title>SMERF Released!</title>
		<link>http://itsignals.cascadia.com.au/?p=20</link>
		<comments>http://itsignals.cascadia.com.au/?p=20#comments</comments>
		<pubDate>Wed, 09 Jan 2008 07:21:48 +0000</pubDate>
		<dc:creator>etienne</dc:creator>
		
		<category><![CDATA[builder]]></category>

		<category><![CDATA[designer]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[questionnaire]]></category>

		<category><![CDATA[survey]]></category>

		<category><![CDATA[Rails]]></category>

		<category><![CDATA[plugins]]></category>

		<category><![CDATA[Ruby]]></category>

	<!-- AutoMeta Start -->
	<category>SMERF</category>
	<category>meta</category>
	<category>rails</category>
	<category>ruby</category>
	<category>form</category>
	<category>survey</category>
	<category>builder</category>
	<category>designer</category>
	<category>questionnaire</category>
	<category>survey</category>
	<category>questionnaire</category>
	<category>builder</category>
	<category>surveys</category>
	<category>easy</category>
	<category>rails</category>
	<category>designer</category>
	<category>yaml</category>
	<category>ruby</category>
	<category>classes</category>
	<category>objects</category>
	<category>Rails</category>
	<category>survey</category>
	<category>builder</category>
	<category>ror</category>
	<category>rails</category>
	<category>questionnaire</category>
	<category>designer</category>
	<category>dynamic</category>
	<category>form</category>
	<category>user</category>
	<category>responses</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://itsignals.cascadia.com.au/?p=20</guid>
		<description><![CDATA[&#160;
Update 11 January 2008: SMERF web site completed.
I&#8217;m happy to announce the release&#160;of SMERF&#160;V0.0.1!
I&#8217;m still in the process of setting up the official web site but the source is now available for download. The README file contains a lot of information about the plugin including installation and configuration notes. You can also checkout the documentation [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p><font face="Verdana" size="3"><font size="2"><strong><font color="#ff0000">Update 11 January 2008</font>:</strong> SMERF <a href="http://smerf.cascadia.com.au" >web site</a> completed.</font></font></p>
<p><strong><font face="Verdana" size="3">I&#8217;m happy to announce the release&nbsp;of SMERF&nbsp;V0.0.1!</font></strong></p>
<p><font face="Verdana" size="2">I&#8217;m still in the process of setting up the official web site but the source is now available for download. The README file contains a lot of information about the plugin including installation and configuration notes. You can also checkout the documentation in the rdoc directory which includes the API docs and the README in a more readable format.</font></p>
<p><font face="Verdana" size="2">There are several ways to download SMERF:</font></p>
<h4>Direct download</h4>
<p><font face="Verdana" size="2">Get it from <a href="http://rubyforge.org/frs/?group_id=5260" onclick="javascript:urchinTracker ('/outbound/article/rubyforge.org');">RubyForge</a></font></p>
<h4>Subversion</h4>
<p><font face="Verdana" color="#ff0000" size="2">**Create a new smerf directory in your /vendor/plugins directory and change into the new directory</font></p>
<h5>Check out the stable release</h5>
<p><font face="Verdana" size="2">svn checkout </font><a href="http://smerf.rubyforge.org/svn/stable" onclick="javascript:urchinTracker ('/outbound/article/smerf.rubyforge.org');"><font face="Verdana" size="2">http://smerf.rubyforge.org/svn/stable</font></a><font face="Verdana" size="2"> .</font></p>
<h5>or Check out a particular release</h5>
<p><font face="Verdana" size="2"><font face="Verdana" size="2">svn checkout </font><a href="http://smerf.rubyforge.org/svn/stable" onclick="javascript:urchinTracker ('/outbound/article/smerf.rubyforge.org');"><font face="Verdana" size="2">http://smerf.rubyforge.org/svn/tags/REL-0.0.1</font></a> <font face="Verdana" size="2">.</font></font></p>
<h5>or Check out the development code</h5>
<p><font face="Verdana" size="2">svn checkout </font><a href="http://smerf.rubyforge.org/svn/tags/%7BREL_0.0.1%7D" onclick="javascript:urchinTracker ('/outbound/article/smerf.rubyforge.org');"><font face="Verdana" size="2">http://smerf.rubyforge.org/svn/trunk</font></a><font face="Verdana" size="2"> .</font></p>
<p><font face="Verdana" size="2">See the README for details of how to install and configure the plugin. </font></p>
<p><font face="Verdana" size="2">Until I get my bug tracker sorted out if you have any problems please feel free to contact me on smerf at cascadia dot com dot au.</font></p>
<p><font face="Verdana" size="2">Enjoy!</font></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://itsignals.cascadia.com.au/?feed=rss2&amp;p=20</wfw:commentRss>
		</item>
		<item>
		<title>Announcing SMERF - Simple MEta Rails Form</title>
		<link>http://itsignals.cascadia.com.au/?p=19</link>
		<comments>http://itsignals.cascadia.com.au/?p=19#comments</comments>
		<pubDate>Wed, 02 Jan 2008 08:18:23 +0000</pubDate>
		<dc:creator>etienne</dc:creator>
		
		<category><![CDATA[builder]]></category>

		<category><![CDATA[designer]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[questionnaire]]></category>

		<category><![CDATA[survey]]></category>

		<category><![CDATA[Rails]]></category>

		<category><![CDATA[forms]]></category>

		<category><![CDATA[Ruby]]></category>

	<!-- AutoMeta Start -->
	<category>SMERF</category>
	<category>meta</category>
	<category>rails</category>
	<category>ruby</category>
	<category>form</category>
	<category>survey</category>
	<category>builder</category>
	<category>designer</category>
	<category>questionnaire</category>
	<category>survey</category>
	<category>questionnaire</category>
	<category>builder</category>
	<category>surveys</category>
	<category>easy</category>
	<category>rails</category>
	<category>designer</category>
	<category>yaml</category>
	<category>ruby</category>
	<category>classes</category>
	<category>objects</category>
	<category>Rails</category>
	<category>survey</category>
	<category>builder</category>
	<category>ror</category>
	<category>rails</category>
	<category>questionnaire</category>
	<category>designer</category>
	<category>dynamic</category>
	<category>form</category>
	<category>user</category>
	<category>responses</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://itsignals.cascadia.com.au/?p=19</guid>
		<description><![CDATA[&#160;
Update 11 January 2008: SMERF web site completed.
Update 9 January 2008: SMERF Released!&#160;
Update 8 January 2008: I&#8217;ve completed the documentation and testing. I&#8217;ve created a project on RubyForge which is waiting approval. If this is not ready by tomorrow I will make an alternate link available for download, so&#160;if all goes well I should have [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p><font face="Verdana" size="2"><font color="#ff0000"><strong>Update 11 January 2008</strong><font color="#000000"><strong>:</strong> SMERF </font><a href="http://smerf.cascadia.com.au" >web site</a></font><font color="#000000"> completed.</font></font></p>
<p><font face="Verdana" size="2"><font color="#ff0000"><strong>Update 9 January 2008:</strong></font> </font><a href="http://itsignals.cascadia.com.au/?p=20" ><font face="Verdana" size="2">SMERF Released!</font></a>&nbsp;</p>
<p><font face="Verdana" size="2"><font color="#ff0000"><strong>Update 8 January 2008:</strong></font> I&#8217;ve completed the documentation and testing. I&#8217;ve created a project on RubyForge which is waiting approval. If this is not ready by tomorrow I will make an alternate link available for download, so&nbsp;if all goes well I should have a download available tomorrow.</font></p>
<p><font face="Verdana" size="2">I am putting the final touches to a new plugin called SMERF which stands for <u>S</u>imple <u>ME</u>ta <u>R</u>ails <u>F</u>orm. The plugin is a result of me extracting the code I used for one of my projects which I discussed in an earlier article </font><a href="http://itsignals.cascadia.com.au/?p=12" ><font face="Verdana" size="2">Ruby on Rails Survey Builder</font></a><font face="Verdana" size="2">.</font></p>
<p><font face="Verdana" size="2">I&#8217;ve spend the past few weeks rewriting parts of it to make it more generic so that it can be used for all sorts of things including survey&#8217;s, questionnaires, data collection forms and so on. Some of the important changes I&#8217;ve made include</font></p>
<ul>
<li><font face="Verdana" size="2">Allow question validations to be written using Ruby code. You can now create your own validation methods as required, there are also a couple of standard system validation methods that come with the plugin. You can specify any number of validation methods for a question by comma separating each method name, e.g. validation: validate_mandatory_question, validate_date_format</font></li>
<li><font face="Verdana" size="2">User responses are now stored in a DB table allowing you to perform analysis on the question responses using SQL.</font></li>
</ul>
<p><font face="Verdana" size="3">ToDo V0.2</font></p>
<ul>
<li><font face="Verdana" size="2">Currently there are no tests</font></li>
<li><font face="Verdana" size="2">Allow forms to be broken into smaller forms, currently you get all questions on a single form</font></li>
<li><font face="Verdana" size="2">Allow the save of user responses as you move from form to form</font></li>
</ul>
<p><font face="Verdana" size="2">I&#8217;m currently writing a plugin generator that will make installation of the plugin easier, hopefully I&#8217;ll have this done very soon. I then need to finish the documentation which is mostly done. </font></p>
<p><font face="Verdana" size="2">I will keep you informed and let you know when the plugin will be available.</font></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://itsignals.cascadia.com.au/?feed=rss2&amp;p=19</wfw:commentRss>
		</item>
	</channel>
</rss>
