<?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>Peter Krantz &#187; Rails</title>
	<atom:link href="http://www.peterkrantz.com/category/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.peterkrantz.com</link>
	<description></description>
	<lastBuildDate>Sat, 04 Feb 2012 09:57:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Rails vs Grails vs Django models</title>
		<link>http://www.peterkrantz.com/2009/rails-grails-django-models/</link>
		<comments>http://www.peterkrantz.com/2009/rails-grails-django-models/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 16:58:47 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[domain modeling]]></category>
		<category><![CDATA[grails]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/?p=281</guid>
		<description><![CDATA[Coming back to Rails after being away from some time in Django land I discovered a huge difference in how Rails and Django treats your models...]]></description>
			<content:encoded><![CDATA[<p>Coming back to Rails after being away from some time in Django land I discovered a huge difference in how Rails, Grails and Django treats your models. <span id="more-281"></span>In Django and Grails you can look at a model class and see all the properties it has:</p>
<pre class="brush: python; title: ; notranslate">
class Organization(models.Model):
    name = models.CharField(max_length=255)
    url = models.URLField(verify_exists=False)
    orgtype = models.ForeignKey(OrgType)
</pre>
<p>The same model class in Rails typically looks like this:</p>
<pre class="brush: ruby; title: ; notranslate">
class Organization &lt; ActiveRecord::Base
    belongs_to :OrgType
end
</pre>
<p>&#8230;and in Grails it is more specific like Django:</p>
<pre class="brush: groovy; title: ; notranslate">
class Organization {
  String name
  String url
  static belongsTo = OrgType
  OrgType orgtype
}
</pre>
<p>It took me a while to remember that in Rails, parts of the model design is actually stored in the database schema instead of in the Ruby code. Peculiar don&#8217;t you think, given that everything else in a Rails app is nicely declared in Ruby code? There are of course benefits to both approaches, but I have started adding comments in the Rails model classes to be able to remember what properties they have without peeking in the Db. Typically I have a number of half-baked projects on my laptop and from time to time I forget what they do and these comments help me remember.</p>
<p>Check out more examples here:</p>
<ul>
<li><a href="http://docs.djangoproject.com/en/dev/topics/db/models/#topics-db-models">Django models</a></li>
<li><a href="http://www.tutorialspoint.com/ruby-on-rails/rails-models.htm">Rails models</a></li>
<li><a href="https://www.ibm.com/developerworks/java/library/j-grails02128/">Grails models</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2009/rails-grails-django-models/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Software architects as management deadwood</title>
		<link>http://www.peterkrantz.com/2008/software-architects/</link>
		<comments>http://www.peterkrantz.com/2008/software-architects/#comments</comments>
		<pubDate>Sat, 02 Feb 2008 19:31:55 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Trends]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2008/software-architects/</guid>
		<description><![CDATA[Two interesting quotes from Dietrich Kappe: So no, we don&#8217;t hire architects. We hire developers. In a ...]]></description>
			<content:encoded><![CDATA[<p>Two interesting quotes from <a href="http://blogs.pathf.com/agileajax/2008/02/but-where-are-a.html">Dietrich Kappe</a>:</p>
<blockquote><p>So no, we don&#8217;t hire architects. We hire developers. In a small team, there is no room for management deadwood.</p></blockquote>
<p>I agree completely. My view is that the title &#8220;Software architect&#8221; is a misnomer for what most architects in the software industry do, or at least what they should be doing. </p>
<p>It is part of the weird trend that career advancement means getting away from actual programming for some reason. Maybe that is part of a bigger problem when the only way to get a higher pay is to become a manager of some sort? A couple of years ago, most programmers I knew aimed for a project management position. Programming was a dirty job that you had to put up with during the first years in consulting.</p>
<p>When my title was &#8220;business analyst&#8221; I tried to do as much programming I could and I haven&#8217;t regretted that for a moment. In fact, I believe that more people from the business side should get involved in programming to get a better understanding of the fundamental principles. For example, it would be great if business people could write their own acceptance tests and with the booming trend of DSL:s you will probably get involved anyway. </p>
<blockquote><p>If you&#8217;ve made the transition from a hierarchical environment to an agile, self-organizing team, you know what I&#8217;m saying. You won&#8217;t ever want to go back.</p></blockquote>
<p>Absolutely. It is the same thing as discovering things like Ruby/Python/Rails: it makes you wonder what the hell you were doing earlier. In many ways I feel sorry for young software developers that go straight into Rails or similar frameworks today. They are not as appreciative as the rest of us:-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2008/software-architects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Will Rails ever run on IronRuby?</title>
		<link>http://www.peterkrantz.com/2008/rails-on-ironruby/</link>
		<comments>http://www.peterkrantz.com/2008/rails-on-ironruby/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 22:23:14 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2008/rails-on-ironruby/</guid>
		<description><![CDATA[I met Ola Bini at the local Geeknight the other day and we had a brief chat ...]]></description>
			<content:encoded><![CDATA[<p>I met Ola Bini at the local Geeknight the other day and we had a brief chat about platforms, Ruby and RDF among other things. Ola mentioned that he wasn&#8217;t sure that Rails wuld run on <a href="http://www.ironruby.net/">IronRuby</a> &#8211; Microsoft&#8217;s implementation of Ruby for the CLR.</p>
<p>I have been following what John Lam has been writing about their progress (and I correctly <a href="http://www.peterkrantz.com/2006/using-ruby-as-a-net-language/">predicted him joining Microsoft</a>:-) and it appears that running Rails is a goal of the IronRuby project. But, will that be of interest to Microsoft? MS recently launched the first version of an <a href="http://weblogs.asp.net/scottgu/archive/2007/10/14/asp-net-mvc-framework.aspx">MVC framework for the ASP.NET platform</a>. This seems like an attempt to satisfy the curiosity of .net developers that have seen screen casts and office mates develop apps in Ruby on Rails.  The framework is part of the Visual Studio 2008 offerings.</p>
<p>If you were able to deploy a Rails app by dropping a DLL on a Windows web server I can see Rails popularity exploding. The .net platform seems to occupy a mid-level segment of application hosting operations, right where Rails development seem to be.</p>
<p>Only time will tell I guess.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2008/rails-on-ironruby/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Prism &#8211; web apps as desktop apps</title>
		<link>http://www.peterkrantz.com/2007/prism-web-desktop-apps/</link>
		<comments>http://www.peterkrantz.com/2007/prism-web-desktop-apps/#comments</comments>
		<pubDate>Mon, 24 Dec 2007 11:58:35 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Trends]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2007/prism-web-desktop-apps/</guid>
		<description><![CDATA[When people started making applications available in the browser a number of interaction challenges appeared. How do ...]]></description>
			<content:encoded><![CDATA[<p>When people started making applications available in the browser a number of interaction challenges appeared. How do you launch a web app compared to a desktop app? How do you prevent people from navigating away from your app? The <a href="http://starkravingfinkle.org/blog/2007/10/webrunner-becomes-prism-a-mozilla-labs-project/">Mozilla people</a> have been hard t work with <a href="http://wiki.mozilla.org/Prism">Prism</a> &#8211; basically a customized version of Firefox, which lets you create desktop apps pre-configured to load a certain URL at startup. The desktop app is launched like any other application. Pretty sweet as the user experience becomes more consistent. You can also customize the application icon and <a href="http://wiki.mozilla.org/Prism/Config">other parameters</a>.<span id="more-124"></span></p>
<p>I have been running the beta version of <a href="http://mailplaneapp.com/">MailPlane</a> which provides at desktop version of Gmail (using Webkit). Apart from keeping Gmail in a separate branded window it also provides standard mac shortcut keys as well as desktop integration for screenshots and other file related things. Pretty sweet.</p>
<p>I was interested to see if Prism could provide a similar experience. Prism is currently an early beta at version 0.8 so it isn&#8217;t fair to expect too much of it. The <a href="http://wiki.mozilla.org/Prism#Wishlist">feature wish list</a> looks great.</p>
<p>Launching prism and creating a Gmail app worked great. However, Prism currently has some issues:</p>
<ul>
<li>It consumes close to 100% of a CPU core on my MacBook which makes it unusable for now.</li>
<li>Font size can not be adjusted (should be a parameter?).</li>
<li>There is a white space at the bottom of the app screen which reduce valuable screen estate. <img class="illustration" src="http://www.peterkrantz.com/wp-content/uploads/2007/12/prism-whitespace.png" alt="prism 0.8 white space bug" /></li>
</ul>
<p>I would also like to see an option to map access keys to native OS keys (e.g. Prism forwards ⌘+r as alt+r to the web app). This would allow users to work with the application in a way indistinguishable from a desktop application. also, if there was a way to interact with files (drag and drop etc) à la MailPlane I could see how Prism could be the preferred choice of many application developers in the future.</p>
<p>Couple it with a stand alone Ruby on Rails app (by using <a href="http://joyeur.com/2007/03/22/joyent-slingshot">Joyent&#8217;s Slingshot</a>) and you have a whole new way of developing applications that work offline, online and in a coherent way with other desktop apps. The future is bright!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2007/prism-web-desktop-apps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>When PHP makes sense</title>
		<link>http://www.peterkrantz.com/2007/when-php-makes-sense/</link>
		<comments>http://www.peterkrantz.com/2007/when-php-makes-sense/#comments</comments>
		<pubDate>Sat, 08 Sep 2007 20:42:31 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2007/when-php-makes-sense/</guid>
		<description><![CDATA[I have been looking into development frameworks for a web based software product. I want the product to be able to be installed on a variety of platforms, including Windows server with IIS. First I was looking at creating the app in ASP.NET and make it run under Mono. Unfortunately I can't find an <a href="http://www.peterkrantz.com/2007/aspnet-mvc-frameworks/">MVC framework for ASP.NET</a> that works the way I want. Ruby on Rails has really lowered the threshold of what I can put up with in the form of configuration and learning curve. Damn you DHH and your rapid web framework:-)]]></description>
			<content:encoded><![CDATA[<p>I have been looking into development frameworks for a web based software product. I want the product to be able to be installed on a variety of platforms, including Windows server with IIS. First I was looking at creating the app in ASP.NET and make it run under Mono. Unfortunately I can&#8217;t find an <a href="http://www.peterkrantz.com/2007/aspnet-mvc-frameworks/">MVC framework for ASP.NET</a> that works the way I want. Ruby on Rails has really lowered the threshold of what I can put up with in the form of configuration and learning curve. Damn you DHH and your rapid web framework:-)</p>
<p>Ruby on Rails runs happily on Linux and in Java environments thanks to JRuby. It does not work well with IIS yet (until IronRuby is here I guess). There is, however, interesting work being done in the <a href="http://www.codeplex.com/RORIIS">RORIIS project</a> (also see Dorje McKinnon&#8217;s <a href="http://dorjem.blogspot.com/2007/02/to-setup-rails-on-iis-and-enable-it-for.html">Set up Rails on IIS blog post</a>). The only problem I have is that I have heard a lot of reports where Rails under IIS isn&#8217;t working properly and that the RORIIS bundles several components that Windows server managers may find scary.</p>
<p>Django and Turbogears does not seem to work well under IIS either. For <a href="http://code.djangoproject.com/wiki/DjangoOnWindowsWithIISAndSQLServer">Django, the PyISAPI is required</a> and apparently it hasen&#8217;t been actively developed for a while leading to bugs in the latest version of Django (you also have to run Python 2.4 instead of 2.5).</p>
<p><a href="http://turbogears.org/">Turbogears</a> seems to be <a href="http://docs.turbogears.org/1.0/BehindIIS">close to work on IIS</a>. Only problem is that it requires a <a href="http://www.saltypickle.com/Home/16">reverse proxy filter</a> that hasen&#8217;t been actively developed since 2005 which makes me wary about using it.</p>
<p>So, looking at <a href="http://www.symfony-project.com/">Symfony, the Rails inspired PHP framework</a>, I am beginning to wonder if that would be the best choice right now. The <a href="http://www.symfony-project.com/cookbook/1_0/web_server_iis">installation instructions for Windows/IIS</a> seem straightforward. Symfony recommends the <a href="http://www.isapirewrite.com/">commercial ISAPIRewrite filter</a> (lite version os free). For IIS7 it looks like Microsoft is stepping up to the plate with a <a href="http://blogs.iis.net/bills/archive/2006/10/31/PHP-on-IIS.aspx">decent Fast CGI module</a>. Performance seems to be adequate too. </p>
<p>So, right now, Symfony/PHP seems like a decent choice for this app if I can live with the <a href="http://www.bitstorm.org/edwin/en/php/">intricacies of PHP</a>. Who would have thought&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2007/when-php-makes-sense/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Looking for ASP.NET MVC Frameworks&#8230;</title>
		<link>http://www.peterkrantz.com/2007/aspnet-mvc-frameworks/</link>
		<comments>http://www.peterkrantz.com/2007/aspnet-mvc-frameworks/#comments</comments>
		<pubDate>Sat, 18 Aug 2007 15:37:09 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2007/aspnet-mvc-frameworks/</guid>
		<description><![CDATA[I have been looking for an open source alternative to the default way of buildig web sites ...]]></description>
			<content:encoded><![CDATA[<p>I have been looking for an open source alternative to the default way of buildig web sites in ASP.NET with Visual Studio. After having build a couple of applications with Ruby on Rails it hard to go back to the <a href="http://martinfowler.com/eaaCatalog/pageController.html">Page Controller pattern</a> that Microsoft introduced in ASP.NET. Coming back to the ASP.NET page event model makes it clear that they created it for VB6 application developers that were used to Windows forms-centered development. Apparently they didn&#8217;t want to those developers to have to learn about HTTP and HTML to be able to write applications.<span id="more-101"></span></p>
<p>I guess from a marketing persepective it may have been the right choice (for Microsoft), but right now it feels like a horrible mess for me. So, I spent a couple of hours researching the alternatives. There are a number of commercial packages available (LLBLGen et al) but I only found three that looked interesting for my purposes:</p>
<ol>
<li><a href="http://www.castleproject.org/">MonoRail</a>: The Ruby on Rails-inspired framework with an ActiveRecord component based on NHibernate.</li>
<li><a href="http://www.springframework.net/">Spring.NET: A port of the Spring framework for Java.</a></li>
<li><a href="http://www.codeplex.com/PixelDragonsMVC">PixelDragons MVC</a>: this looks promising but seems to lack real world use? Requires further investigation.</li>
</ol>
<p>Looking at the <a href="http://www.springframework.net/docs/1.1-RC1/reference/html/quickstarts.html">quickstart documentation for Spring.NET</a> I decided that it was way too much configuration involved to get things running. Ruby on Rails has definitely lowered my tolerance for lengthy project setups.</p>
<p>The <a href="http://www.castleproject.org/monorail/gettingstarted/">getting started tutorial for MonoRail</a> looked much more pleasant. The MonoRail framework comes with a nice MSI installer and a <a href="http://www.castleproject.org/castle/vsintegration.html">custom project wizard</a> to quickly set up a project skeleton in Visual Studio 2005. There is even an option to create an associated test project from the start.</p>
<p>After some initial problems with getting the application talking to my SQL Server 2005 database (Microsoft has drastically increased security for the 2005 version resulting in a number of configuration steps to be able to talk to the db at all) I had a sample app going. Users of Ruby on Rails will feel at home since you can do nice stuff like:</p>
<pre class="brush: csharp; title: ; notranslate">
public void CreateUser()
{
      User owner = new User();
      owner.FirstName = &quot;Peter&quot;;
      owner.LastName = &quot;Krantz&quot;;
      owner.Create();
}
</pre>
<p>Then I wanted to try a TDD approach and this is where I am currently stuck. The MonoRail project wizard creates a sample test project with a sample test of a controller. However, according to people in the forum that approach is deprecated and a different way of testing controllers is described on the MonoRail wiki. But that approach does not work for testing your model classes and there is no information on how to get an application context to do that. Or maybe I have missed it when Googling for a solution.</p>
<h2>Can I have just the O/RM please?</h2>
<p>So, if I go back to the Page Controller pattern, can I please have an open source persistence framework that allows me to write code like above? I was happy to find this <a href="http://csharp-source.net/open-source/persistence">rather extensive list of persistence frameworks</a>. The only problem is that most of them are not actively developed anymore. Or, they have simply disappeared as Microsoft is <a href="http://www.gotdotnet.com/workspaces/default.aspx">shutting down the GotDotNet website</a> where many of them are/were hosted.</p>
<p>If you stick to the default pattern in ASP.NET you have a wealth of excellent tutorials and documentation from Microsoft and others. Going off the beaten track seems more difficult though. Hopefully the MonoRail issue will be solved and I can use it for my product idea.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2007/aspnet-mvc-frameworks/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Checking for Model Classes Before Using Them in Rails Migrations</title>
		<link>http://www.peterkrantz.com/2007/models-in-migrations-tip/</link>
		<comments>http://www.peterkrantz.com/2007/models-in-migrations-tip/#comments</comments>
		<pubDate>Thu, 07 Jun 2007 11:39:27 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2007/models-in-migrations-tip/</guid>
		<description><![CDATA[If you are using model objects in migrations (e.g. for inserting data) you should make sure that ...]]></description>
			<content:encoded><![CDATA[<p>If you are using model objects in migrations (e.g. for inserting data) you should make sure that the migration works even if that model class is removed. I discovered this when setting up a new development environment and running all migrations in an empty database.</p>
<p>Let&#8217;s say you have the following migration code:</p>
<p>class InsertCounties < ActiveRecord::Migration<br />
  def self.up<br />
    County.create :code => &#8217;10&#8242;, :name => &#8216;Blekinge&#8217;<br />
    County.create :code => &#8217;20&#8242;, :name => &#8216;Dalarna&#8217;<br />
  end<br />
end</p>
<p>This assumes that the County model is available when the migration is run. If you checked out the most recent version of your code from svn it is possible that it doesn&#8217;t contain the County model and the migration will fail. To check if County is available before trying to use it <a href="http://redhanded.hobix.com/inspect/methodCheckDefined.html">we can use Ruby&#8217;s defined?</a> like this:</p>
<p><strong>Update:</strong> No we can&#8217;t. defined? always returns false inside an ActiveRecord migration for some reason (maybe the class isn&#8217;t loaded before the actual call?). We have to use a begin&#8230;rescue&#8230;end block instead:</p>
<p>class InsertCounties < ActiveRecord::Migration<br />
  def self.up<br />
    begin<br />
      County.create :code => &#8217;10&#8242;, :name => &#8216;Blekinge&#8217;<br />
      County.create :code => &#8217;20&#8242;, :name => &#8216;Dalarna&#8217;<br />
    rescue<br />
      puts &#8220;Could not add data&#8230;&#8221;<br />
    end<br />
  end<br />
end</p>
<p>This way the rest of the migrations will run.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2007/models-in-migrations-tip/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bringing Ruby to the .NET environment</title>
		<link>http://www.peterkrantz.com/2007/bringing-ruby-to-the-net-environment/</link>
		<comments>http://www.peterkrantz.com/2007/bringing-ruby-to-the-net-environment/#comments</comments>
		<pubDate>Tue, 05 Jun 2007 09:04:15 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Trends]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2007/bringing-ruby-to-the-net-environment/</guid>
		<description><![CDATA[Things are heating up in the Ruby-as-a-dotnet-language area. Martin Fowler voiced his concerns on Microsoft not being ...]]></description>
			<content:encoded><![CDATA[<p>Things are heating up in the Ruby-as-a-dotnet-language area. <a href="http://martinfowler.com/bliki/RubyMicrosoft.html">Martin Fowler voiced his concerns</a> on Microsoft not being able to look at source code and therefore having trouble implementing Ruby properly. Microsoft, with <a href="http://www.iunknown.com/">John Lam</a> in the cockpit, is implementting Ruby for the .net platform (if you have been reading my previous blog posts I predicted way <a href="http://www.peterkrantz.com/2006/using-ruby-as-a-net-language/">back in february 2006</a> that John Lam would get scooped up my Microsoft:-).</p>
<p><a href="http://ola-bini.blogspot.com/2007/06/there-can-be-only-one-tale-about-ruby.html">Ola Bini is also concerned</a> about Microsoft not letting ther developers look at the Ruby implementation. If you remember the whole SCO debacle I guess it isn&#8217;t that strange. Microsoft is in the position where software they develop potentially may end up in millions of computers. Apparently the US legal system awards damages in proportion to this. Thus, any issues with a Ruby implementation on .net can quickly become costly.</p>
<p>It is all quite bizarre. Does this mean that the Microsoft version of the Ruby language is different from the &#8220;original&#8221; Ruby? I guess we will never know. Developers will probably write a lot of Ruby code that runs happily on the CLR. Rails applications will be deployed. But I am sure that there will be &#8220;special cases&#8221; where IronRuby will differ from &#8220;original&#8221; Ruby.</p>
<p>Therefore is was refreshing to see that Queensland University of Technology are progressing steadily with <a href="http://plas2003.fit.qut.edu.au/Ruby.NET/">their Ruby.NET implementation</a>. Currently you can actually compile a Ruby script into a .NET 2.0 assembly that other CLR languages can talk to. This may be the spearhead into the <a href="http://www.peterkrantz.com/2007/enterprise-rails-deployment/">other half of enterprise deployment options</a>.</p>
<p>All in all the future of software development looks bright. Will developers that invested a lot of time in Java or C# switch? Or will they move on to maintaining applications?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2007/bringing-ruby-to-the-net-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with UTF-8 in PDF::Writer and Ruby on Rails</title>
		<link>http://www.peterkrantz.com/2007/utf8-in-pdf-writer/</link>
		<comments>http://www.peterkrantz.com/2007/utf8-in-pdf-writer/#comments</comments>
		<pubDate>Thu, 31 May 2007 14:26:00 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2007/utf8-in-pdf-writer/</guid>
		<description><![CDATA[Googling for information on how to use PDF::Writer shows that there are many european developers frustrated with ...]]></description>
			<content:encoded><![CDATA[<p>Googling for information on how to use <a href="http://ruby-pdf.rubyforge.org/pdf-writer/index.html">PDF::Writer</a> shows that there are many european developers frustrated with the lack of UTF-8 support in PDF::Writer. As Ruby on Rails works great with UTF-8 these days this can be a bit of an issue. </p>
<p>Part of the problem lies in the fact that the PDF specification (at least up to 1.6) does not support UTF-8 (you can use UTF-16 if you like). I had the misfortune of plowing thorugh it a couple of years ago when developing a PDF form filler library for a customer (don&#8217;t ask).</p>
<p>In Ruby on Rails, this is easy to solve as long as you only use Latin characters with diacritics. The solution is to switch encoding back to <a href="http://en.wikipedia.org/wiki/ISO_8859-15">ISO-8859-15</a> for text strings you feed to PDF::Writer. </p>
<p>A simple extension to the String class will do the trick:</p>
<pre class="brush: ruby; title: ; notranslate">
class String
  require 'iconv'
  def to_iso
    c = Iconv.new('ISO-8859-15','UTF-8')
    c.iconv(self)
  end
end
</pre>
<p>If you are working in Rails you can put this code in the lib folder (I usually call the file string_extensions.rb). </p>
<p>Then, when you call the text method on your PDF::Writer intance you can easily pass a correctly encoded string.</p>
<h2>Overriding PDF::Writer text method</h2>
<p>A much cleaner approach, as Aníbal describes in the comment below, is to override PDF::Writer&#8217;s text method.</p>
<p>Put the following code in a file called pdfwriter_extensions.rb (or whatever you choose to call it) in your lib directory:</p>
<pre class="brush: ruby; title: ; notranslate">
CONVERTER = Iconv.new( 'ISO-8859-15//IGNORE//TRANSLIT', 'utf-8')

module PDF
	class Writer
		alias_method :old_text, :text

		def text(textto, options = {})
			old_text(CONVERTER.iconv(textto), options)
		end

	end
end
</pre>
<p>In your controller that handles the PDF output you add:</p>
<pre class="brush: ruby; title: ; notranslate">
  require 'pdf/writer'
  require 'pdfwriter_extensions'
</pre>
<p>&#8230;after which you can use PDF::Writer like in the tutorial:</p>
<pre class="brush: ruby; title: ; notranslate">
    pdf = PDF::Writer.new
    pdf.select_font &quot;Helvetica&quot;, :encoding =&gt; nil
    pdf.text &quot;User name: &lt;b&gt;#{@user.name}&lt;/b&gt;&quot;, :font_size =&gt; 16, :justification =&gt; :left
    send_data pdf.render, :disposition =&gt; 'inline', :filename =&gt; &quot;user_details.pdf&quot;, :type =&gt; &quot;application/pdf&quot;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2007/utf8-in-pdf-writer/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Enterprise Rails Deployment Getting Closer (thanks to Ola Bini and the JRuby team)&#8230;</title>
		<link>http://www.peterkrantz.com/2007/enterprise-rails-deployment/</link>
		<comments>http://www.peterkrantz.com/2007/enterprise-rails-deployment/#comments</comments>
		<pubDate>Mon, 07 May 2007 19:21:43 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Trends]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2007/enterprise-rails-deployment/</guid>
		<description><![CDATA[Let&#8217;s forget about that for a while. Ola Bini and the JRuby team is quickly moving forward ...]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s forget about that for a while. <a href="http://ola-bini.blogspot.com/">Ola Bini</a> and the JRuby team is quickly moving forward with something I would consider a breakthrough in Rails deployment options. In fact, it could well mean a breakthrough in Rails adoption in many organizations.<span id="more-80"></span></p>
<h2>Why (some) IT-managers like Rails but don&#8217;t like deploying it</h2>
<p>When I was a consultant I talked to many IT-managers that had heard about Ruby on Rails. They were intrigued by the fact that Ruby and Rails were created for developers rather than machines. Most of them realized that developer time costs more than computer performance today (although some of them were still spending money at developers writing unnecessarily complicated code to run fast on hardware that costs less than 20 developer hours).</p>
<p>However, these IT-managers weren&#8217;t too keen on deploying Rails applications in their environment. You see, if you spent the last five years creating a homogenous server environment it is likely that you have invested a lot in it. The following typically applies in this type of environment:</p>
<ul>
<li>You have specialized server administrators that know how to deploy, run and monitor aplications in the environment.</li>
<li>One or more large vendors have sold you expensive software in which you run your applications.</li>
<li>The same vendors have sent you a lot of marketing material telling you how lucky you are to be running their software and that your competitors are running the same thing.</li>
<li>Developing software for the environment requires expensive consultants. This, obviously, means that you get professionals.</li>
<li>Software typically runs fine in the environment.</li>
</ul>
<p>The environment may be Java or .NET. The investment is typically bigger if it is Java.</p>
<p>And then Rails developers come to you and say that your investment in this homogenous environment should be thrown away. You staff should be retrained and deployment no longer takes a week. Obviously these developers must be lying.</p>
<h2>Why Ola Bini and the Jruby team may increase Rails adoption</h2>
<p>Any day now it will be possible to wrap up your <a href="http://headius.blogspot.com/2006/12/another-step-toward-rails-war-files.html">Rails app in a WAR-file</a> and put it right into a Java server environment. It may already work for all I know. Server administrators may not even see the difference between a Rails app and a regular Java app.</p>
<p>When this is easy to do I believe that Rails will se a much larger adoption in larger organizations (with these types of environments). And from there it will only get better. Thoughtworks seem to be in on <a href="http://studios.thoughtworks.com/2007/5/7/mingle-to-run-on-jruby">the same track</a>.</p>
<p>I guess both Sun and Microsoft realized the importance of being able to run Rails applications in existing environments. Sun is supporting JRuby and Microsoft <a href="http://www.iunknown.com/">hired John Lam</a> to make Ruby run on the CLR (they already had <a href="http://blogs.msdn.com/hugunin/archive/2004/10/11/240841.aspx">Jim Hugunin</a> make it possible to run Python code fast on the CLR).</p>
<p><strong>Interesting times are ahead!</strong></p>
<p>I guess we will have to thank Ola and the JRuby team for that&#8230;</p>
<p>Update: I was just told that <a href="http://flickr.com/photos/x180/245186478/">James DD snapped a picture of me</a> sitting next to Ola at Railsconf London. It is a small world after all.</p>
<p>Update 2: And here are instructions on how to <a href="http://letsgetdugg.com/view/How_to_deploy_a_self_contained_Rails_application_on_Tomcat,_painlessly">create a WAR file of a Rails app</a> for deployment in Tomcat.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2007/enterprise-rails-deployment/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Why Accessibility in Rails is a Non-issue</title>
		<link>http://www.peterkrantz.com/2006/rails-accessibility/</link>
		<comments>http://www.peterkrantz.com/2006/rails-accessibility/#comments</comments>
		<pubDate>Fri, 15 Sep 2006 13:16:57 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2006/rails-accessibility/</guid>
		<description><![CDATA[Maybe a better title for this post would be &#8220;Why Accessibility in Rails is Currently a Non-issue&#8221;. ...]]></description>
			<content:encoded><![CDATA[<p>Maybe a better title for this post would be &#8220;Why Accessibility in Rails is <em>Currently</em> a Non-issue&#8221;. Last night was the <a href="http://europe.railsconf.org/pages/schedule">core team panel discussion at RailsConf</a> and there was a question about what the core team was doing to increase accessibility in Rails.</p>
<p>Someone in the core team answered rather vaguely (or maybe I misunderstood the answer) how they had used Rails in a project that required high accessibility. My view is that for the Rails framework accessibility is currently a non-issue. Here is why:</p>
<p>As long as the developer has control over the view code (HTML and CSS) it will always be possible to create an application that is accessible. What happens if you remove that control? Microsoft tried to remove that control in the first incarnations of ASP.NET with the result that some really <a href="http://www.standards-schmandards.com/index.php?2005/08/16/17-accessibility-in-aspnet">crappy (and inaccessible) HTML</a> was genereated on the server.</p>
<h2>Potential risks?</h2>
<p><abbr title="David Heinemeier Hansson">DHH</abbr> presented an upcoming <a href="http://dev.rubyonrails.org/changeset/5019">plugin: simply_helpful</a>. This plugin will provide convenience methods to create markup in your views. Currently it provides an excellent support to do standard stuff. As long as this plugin doesn&#8217;t go haywire with regards to semantics Rails will continue to be an excellent framework for accessible applications.</p>
<p>Could something be made better in the current version of Rails? If scaffolding should be a way to show best practices in accessibility there is a small detail that could be changed right now. Add a lang attribute to the html element (lang=&#8221;en&#8221;) to indicate the natural language. But, I guess it is up to me and other accessibility advocates to submit as a patch.</p>
<p>Maybe it could be the smallest patch (9 bytes) ever submitted?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2006/rails-accessibility/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Deploying Rails in Amazon&#8217;s Elastic Compute Cloud</title>
		<link>http://www.peterkrantz.com/2006/rails-in-the-elastic-compute-cloud/</link>
		<comments>http://www.peterkrantz.com/2006/rails-in-the-elastic-compute-cloud/#comments</comments>
		<pubDate>Thu, 24 Aug 2006 19:30:05 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2006/rails-in-the-elastic-compute-cloud/</guid>
		<description><![CDATA[Here is a cool thing which I didn&#8217;t hear of until today. Amazon provides a service where ...]]></description>
			<content:encoded><![CDATA[<p>Here is a cool thing which I didn&#8217;t hear of until today. Amazon <a href="http://www.amazon.com/gp/browse.html?node=201590011">provides a service</a> where you can upload a machine image (think VMWare), deploy it to as many instances you need and pay Amazon 10 cents for every hour you use it and 20 cents for each Gb data transfer. This will allow you to instantly scale an application if your demand temporarily increases.</p>
<p>With the risk of sounding like an Amazon marketing droid here are some highlights of what you get for those 10 cents:</p>
<ul>
<li>Self-scaling: You can commission one, hundreds or even thousands of server instances simultaneously. This is all controlled with web service APIs, your application can automatically scale itself up and down depending on its needs.</li>
<li>Complete control of your instances. You have root access to each one, and you can interact with them as you would any machine. Each instance provides the equivalent of a system with a 1.7Ghz Xeon CPU, 1.75GB of RAM, 160GB of local disk, and 250Mb/s of network bandwidth.</li>
<li>Easily hook up to the S3 storage service.</li>
</ul>
<p>The cool thing is that it seems relatively simple to deploy a machine. So, it would be easy to create a Linux image with your great Rails mashup application, deploy it and just switch on more instances as customers start arriving.</p>
<p>When I think about applications I have created earlier in my career I can see how nicely several of them would fit  this business model. Who will be the first to report of a Rails deployment to the Elastic Cloud? Oh, <a href="http://domu-12-31-33-00-04-9c.usma1.compute.amazonaws.com/">someone already did it</a>.</p>
<p>For more details see <a href="http://www.amazon.com/gp/browse.html?node=201590011">Amazon Elastic Compute Cloud (Amazon EC2)</a> and <a href="http://overstimulate.com/articles/2006/08/24/amazon-does-it-again.html">how to set up a VM in the cloud</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2006/rails-in-the-elastic-compute-cloud/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Optimizing Rails template helper methods</title>
		<link>http://www.peterkrantz.com/2006/optimizing-rails-template-helper-methods/</link>
		<comments>http://www.peterkrantz.com/2006/optimizing-rails-template-helper-methods/#comments</comments>
		<pubDate>Tue, 15 Aug 2006 21:46:02 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2006/optimizing-rails-template-helper-methods/</guid>
		<description><![CDATA[Stefan Kaes is at it again with some interesting code to optimize Rails template helper methods. I ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://railsexpress.de/">Stefan Kaes</a> is at it again with some interesting code to optimize Rails template helper methods. I have always wondered about some of the helper methods e.g. &#8220;< %= end_form_tag %>&#8220;. Why would you need that when it is easier to write &#8220;&#8221;?</p>
<p>Anyway, Stefan has shown that there is a cost to using many of the helper methods and that optimizing them may give you a performance increase. Methods involving routes are the worst performers.</p>
<p>By evaluating many of the methods only once (at template compile time) performance is increased. To see how your Rails application can be improved have a look at &#8220;<a href="http://railsexpress.de/blog/articles/2006/08/15/rails-template-optimizer-beta-test">Rails Template Optimizer Beta Test</a>&#8220;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2006/optimizing-rails-template-helper-methods/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiple annoyances with Rails (more than one security issue)</title>
		<link>http://www.peterkrantz.com/2006/rails-security-issues/</link>
		<comments>http://www.peterkrantz.com/2006/rails-security-issues/#comments</comments>
		<pubDate>Thu, 10 Aug 2006 13:27:44 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2006/rails-security-issues/</guid>
		<description><![CDATA[There have been a number of issues with Rails popping up yesterday and today. First there was ...]]></description>
			<content:encoded><![CDATA[<p>There have been a number of issues with Rails popping up yesterday and today. First there was the <a href="http://weblog.rubyonrails.org/2006/8/9/rails-1-1-5-mandatory-security-patch-and-other-tidbits">announcement that Rails 1.1.4 had a security issue</a>. Discussions emerged on why the core team did not disclose the details of the vulnerability. Evan Weaver had a quick look at the <a href="http://blog.evanweaver.com/articles/2006/08/10/explanation-of-the-rails-security-vulnerability-in-1-1-4-others">diff between 1.1.4 and 1.1.5 and described the problem</a>:</p>
<blockquote><p>It looks like, for example, that if your Rails installation is in /www/rails/, passing a string such as /www/rails/../../tmp/ would pass the old validation, and if you had managed to upload a file such as hax_controller.rb to /tmp/, a route request to /hax/ would force Rails to run your arbitrary code.</p></blockquote>
<p>Nice. I updated a sample app to 1.1.5 and though I was safe until I read <a href="http://www.ruby-forum.com/topic/76671">this discussion over at Ruby Forum</a>:</p>
<blockquote><p>One more for 1.1.5:<br />
Two subsequent calls:</p>
<p>http://127.0.0.1:3000/builder/blankslate</p>
<p>http://127.0.0.1:3000/active_support/dependencies</p>
<p>&#8230;put server to errors &#8220;SystemStackError (stack level too deep)&#8221;<br />
constantly for all further requests.</p></blockquote>
<p>Nice. I guess this is part of life for early adopters of new frameworks. Hopefully the community will be able to resolve these issues quickly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2006/rails-security-issues/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Speaking at RailsConf Europe</title>
		<link>http://www.peterkrantz.com/2006/railsconf-talk-accessibility/</link>
		<comments>http://www.peterkrantz.com/2006/railsconf-talk-accessibility/#comments</comments>
		<pubDate>Tue, 01 Aug 2006 21:14:01 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2006/railsconf-talk-accessibility/</guid>
		<description><![CDATA[I received an interesting email from the organizers of the european Rails conference yesterday. My talk proposal ...]]></description>
			<content:encoded><![CDATA[<p>I received an interesting email from the organizers of the <a href="http://europe.railsconf.org/">european Rails conference</a> yesterday. My talk proposal &#8220;Building Accessible Web Sites on Rails&#8221; was accepted and I will be giving a talk with the following description:</p>
<blockquote><p>As an agile Rails developer you are expected to know a bit of everything in the <abbr title="Model, view, controller">MVC</abbr> paradigm. The V (View) is typically considered the least attractive area as it is &#8220;only HTML&#8221; and is best taken care of &#8220;by someone else&#8221;. Accessibility often becomes a burden or is simply ignored.</p>
<p>In this session I will try to improve your skills with regards to accessible web interfaces. We will have a pragmatic look at why and how you increase accessibility. Without getting into too much theory we will have a look at some demographics and then move quickly into some scary examples of how you can fail miserably. I will show you how to use <a href="http://raakt.rubyforge.org/">RAAKT (the Ruby Accessibility Analysis Kit)</a> in your Rails testing framework (to make sure your team does the right thing) and how to fix some of the more commonly found accessibility issues. Thus, this session is for experienced Rails developers as well as beginners.</p></blockquote>
<p>If you have any specific areas you would like me to cover, please create a comment below and I&#8217;ll try to fit it in.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2006/railsconf-talk-accessibility/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Automated accessibility tests in Ruby on Rails</title>
		<link>http://www.peterkrantz.com/2006/accessibility-in-rails-with-raakt/</link>
		<comments>http://www.peterkrantz.com/2006/accessibility-in-rails-with-raakt/#comments</comments>
		<pubDate>Fri, 14 Jul 2006 09:42:47 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2006/accessibility-in-rails-with-raakt/</guid>
		<description><![CDATA[A couple of days ago I released RAAKT &#8211; The Ruby Accessibility Analysis Kit gem (I know, ...]]></description>
			<content:encoded><![CDATA[<p>A couple of days ago I released <a href="http://rubyforge.org/projects/raakt">RAAKT &#8211; The Ruby Accessibility Analysis Kit gem</a> (I know, it really needs a better name). RAAKT is a gem that can be used independently of Rails and my plan was to make a Rails plugin that would add a custom assert method that did the check. It turns out that it only takes five lines of code so there is no need for a plugin. So let&#8217;s see how you can integrate accessibility checks into your current Rails application.</p>
<h2>Install the RAAKT gem</h2>
<p>This is a simple step. If you have installed rubygems all you need to do is <kbd>gem install raakt</kbd>. This will install the latest version of RAAKT (currently 0.3).</p>
<h2>Add the custom assertion</h2>
<p>Open the file test_helper.rb in the test folder in your Rails application. Add the following method to the class Test::Unit::TestCase:</p>
<p>def assert_basic_accessibility<br />
  rt = Raakt::Test.new(@response.body)<br />
  result = rt.all<br />
  assert result.length == 0, result.collect { |msg| &#8220;n&#8221; + msg.text + &#8220;n&#8221; }<br />
end</p>
<p>Make sure the raakt module is required by adding &#8220;require &#8216;raakt&#8217;&#8221; in the top of the file. No we can use assert_basic_accessibility in our functional tests (where view output is available).</p>
<h2>Test your views</h2>
<p>By adding assert_basic_accessibility to all functional tests that render a complete HTML document you can make sure you don&#8217;t create any of the fundamental accessibility errors that plague many applications.</p>
<p>Currently the RAAKT module will do the following tests on your markup:</p>
<ol>
<li><strong>check_document_structure</strong>: Verify that headings are correctly structured (h1 -> h2 etc)</li>
<li><strong>check_tables</strong>: Verify that all tables have headers (th elements).</li>
<li><strong>check_for_formatting_elements</strong>: Make sure no font, b, i, blink or marquee elements have been used.</li>
<li><strong>check_has_heading</strong>: Verify that the document has at least one h1 heading.</li>
<li><strong>check_form</strong>: Verifies that all form input fields (except hidden fields) have a corresponding label element.</li>
<li><strong>check_link_text</strong>: Verifies that all link elements are unambiguous (two links with different targets should not have the same link text. Yes, that means all your &#8220;Edit&#8221; links). Use the title attribute to separate links.</li>
<li><strong>check_title</strong>: Verify that a non-empty title element is available.</li>
<li><strong>check_frames</strong>: If frames are used, verify that each frame has a descriptive title attribute.</li>
<li><strong>check_images</strong>: Verify that all images have an alt attribute.</li>
<li><strong>check_refresh</strong>: Make sure that no client-side meta refresh is present.</li>
<li><strong>check_for_nested_tables</strong>: Verify that no nested tables are present.</li>
<li><strong>check_for_language_info</strong>: Make sure the html element has a lang attribute indicating what language your document is in.</li>
</ol>
<p>Sometime soon I will create documentation on each of the errors that you may recieve and what you can do to correct them. Suggestions and feedback are always welcome on the <a href="http://rubyforge.org/tracker/?group_id=1861">RAAKT project page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2006/accessibility-in-rails-with-raakt/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Porting the Python Accessibility Analysis Kit to Ruby</title>
		<link>http://www.peterkrantz.com/2006/ruby-accessibility-analysis-kit/</link>
		<comments>http://www.peterkrantz.com/2006/ruby-accessibility-analysis-kit/#comments</comments>
		<pubDate>Thu, 29 Jun 2006 13:53:46 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2006/ruby-accessibility-analysis-kit/</guid>
		<description><![CDATA[At RailsConf in Chicago I realized that it would be a good idea to port PAAKT to ...]]></description>
			<content:encoded><![CDATA[<p>At RailsConf in Chicago I realized that it would be a good idea to port <a title="Python Accessibility Analysis Kit" href="/projects/paakt">PAAKT</a> to Ruby and make sure it can be used for automatic accessibility tests in the Rails testing framework. Work has begun and I hope to release it at the end of this summer if all goes well. The project is registered at Rubyforge. Now, all I need is a good name. Maybe RAAKT? Suggestions are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2006/ruby-accessibility-analysis-kit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rapid prototyping makes usability testing easier</title>
		<link>http://www.peterkrantz.com/2006/agile-rails/</link>
		<comments>http://www.peterkrantz.com/2006/agile-rails/#comments</comments>
		<pubDate>Wed, 28 Jun 2006 12:16:00 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Methodology]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2006/agile-rails/</guid>
		<description><![CDATA[In an article over at Dancingmango Marc McNeill writes about how new web development frameworks such as ...]]></description>
			<content:encoded><![CDATA[<p>In an article over at Dancingmango Marc McNeill writes about how new web development frameworks such as Ruby on Rails will have an impact on usability testing practices (<a href="http://www.dancingmango.com/blog/?p=59">&#8220;What&#8217;s the point of usability testing&#8221;</a>). The only real reason to test a mockup instead of a real application is of course that it used to be more expensive and time consuming to create an application. With Rails there is no such barrier anymore and usability tests can (and should) be using the real application instead. It is likely that this will lead to a better understanding of how users behave in e.g. a task based system.</p>
<p>Coupled with the extremely short feedback cycle realized by using dynamically typed languages such as Ruby, Rails may have a deeper impact on software development practices than I previously thought.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2006/agile-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Two additional problems for Rails: eat SOAP and connect to MSSQL</title>
		<link>http://www.peterkrantz.com/2006/two-additional-problems-for-rails-eat-soap-and-connect-to-mssql/</link>
		<comments>http://www.peterkrantz.com/2006/two-additional-problems-for-rails-eat-soap-and-connect-to-mssql/#comments</comments>
		<pubDate>Sat, 24 Jun 2006 12:46:16 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2006/two-additional-problems-for-rails-eat-soap-and-connect-to-mssql/</guid>
		<description><![CDATA[At the opening keynote here at RailsConf in Chicago Dave Thomas (of Pragmatic Programmer fame) presented three ...]]></description>
			<content:encoded><![CDATA[<p>At the opening keynote here at <a href="http://railsconf.org/">RailsConf</a> in Chicago Dave Thomas (of Pragmatic Programmer fame) presented three problems for the Rails community to solve. His idea was that these would help Rails become more popular in organizations. I would like to add two more: a SOAP library and an improved MSSQL-server driver.</p>
<p>Judging from the amount of Microsoft-bashing going on here I would venture to guess that these aren&#8217;t on the top of the list for most Rails developers. However, I believe they would make it a lot easier to implement Rails applications in the corporate world and increase the Rails adoption rate.</p>
<ol>
<li>A SOAP library that at least can consume other SOAP services (including bastardized interfaces returning .net datasets) would ease the adoption of Rails in internal CRUD applications. Rails isn&#8217;t alone in the world and while it is easy to say that other people&#8217;s SOAP interfaces are crap the reality is that they are there and there is little you can do about it. Changing existing web service interfaces is a tricky task as it may invlove a lot of other applications.</li>
<li>The MSSQL driver is necessary to remove another obstacle in the decision process of selecting Rails. Most companies standardize on their production server platforms. This means they will typically have a cluster with a specific database engine somewhere which other applications share. Brian Hogan has done some excellent work in showing how <a href="http://www.napcs.com/howto/rails/deploy/">Rails can be deployed in a Windows Server environment</a>. From what I hear  the <a href="http://wiki.rubyonrails.org/rails/pages/HowtoConnectToMicrosoftSQLServer">current incarnation of the MSSQL-server driver</a> for Ruby isn&#8217;t up to par with the rest of the pack.</li>
</ol>
<p>I believe that being able to deploy Rails in your existing Microsoft environment using MSSQL-server would make it easier for managers to give a go ahead for Rails projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2006/two-additional-problems-for-rails-eat-soap-and-connect-to-mssql/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Improving Session Performance in Rails</title>
		<link>http://www.peterkrantz.com/2006/rails-session-performance/</link>
		<comments>http://www.peterkrantz.com/2006/rails-session-performance/#comments</comments>
		<pubDate>Mon, 29 May 2006 16:41:21 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2006/rails-session-performance/</guid>
		<description><![CDATA[Stefan Kaes provides a 5-minute solution to improved session handling in Ruby on Rails. Here are some minor adjustments to make it work with Rails 1.1.2. ]]></description>
			<content:encoded><![CDATA[<p>Ruby on Rails includes some options for handling sessions (see <a href="http://railsexpress.de/blog/files/slides/rubyenrails2006.pdf">overview by Stefan Kaes (PDF)</a>). Unfortunately the default ActiveRecord session handler is relatively slow which may have a big impact on your application (sessions tend to accumulate quickly). Fortunately for all of us, Stefan has created an alternative MySQL session handler whith hard coded SQL statements. His version is much quicker.</p>
<p>If your application uses the standard session handler there is really no reason not to implement Stefan&#8217;s solution. However, to make it work with the default session table created by Rails 1.1.2 you have to do some minor modifications (at least in version 0.2):</p>
<ol>
<li>Download and install <a href="http://railsexpress.de/downloads/">Stefan&#8217;s session handler files</a> into your application&#8217;s lib directory.</li>
<li>If you haven&#8217;t created the session table for your application, run &#8220;rake create_sessions_table&#8221;. The will add a new migration file in the db/migrate folder.</li>
<li>Update the migration file to make sure the created_at column is included. You can append it by adding &#8220;t.column :created_at, :datetime&#8221;.</li>
<li>Open lib/sql_session_store.rb and modify the SQL statements containing a reference to the sessid column. In Rails 1.1.2 this should be called &#8220;session_id&#8221;.</li>
<li>Update your config/environment.rb by appending the following lines at the end of the file:</li>
</ol>
<pre>
<pre class="brush: plain; title: ; notranslate">cmVxdWlyZSAnc3FsX3Nlc3Npb25fc3RvcmUnDQpyZXF1aXJlICdteXNxbF9zZXNzaW9uJw0KQWN0aW9uQ29udHJvbGxlcjo6Q2dpUmVxdWVzdDo6REVGQVVMVF9TRVNTSU9OX09QVElPTlMudXBkYXRlKDpkYXRhYmFzZV9tYW5hZ2VyID0+IFNRTFNlc3Npb25TdG9yZSkNClNRTFNlc3Npb25TdG9yZS5zZXNzaW9uX2NsYXNzID0gTXlzcWxTZXNzaW9u</pre>
</pre>
<p>Restart your web server and you have improved session performance a lot. For more details see:</p>
<ul>
<li><a href="http://railsexpress.de/blog/articles/2005/12/19/roll-your-own-sql-session-store">Roll your own SQL session store.</a></li>
<li><a href="http://weblog.textdrive.com/article/196/on-rails-sessions">On Rails session accumulation &#8211; Textdrive</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2006/rails-session-performance/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: www.peterkrantz.com @ 2012-02-04 11:16:07 -->
