<?xml version="1.0" encoding="UTF-8"?>

<rss version='2.0'
     xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">
    <channel>
        <!-- This XML Feed shows details for the page Ruby, Rails and Related -->
        <creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.5/
          </creativeCommons:license>
        <title>Ruby, Rails and Related</title>
        <description>&lt;p&gt;I&amp;#8217;ve been messing around with Ruby and Rails lately, and generally liking what I&amp;#8217;ve found.  In many ways, this is really the nicest framework I&amp;#8217;ve ever used for solving the types of problems it aims to solve&amp;#8230;  Here are some notes made along the way.&lt;/p&gt;
</description>
                <category>Web</category>
        <category>Ajax</category>
        <category>Ruby</category>
        <category>Rails</category>
        <category>Programming</category>
        <category>user:jerryk</category>

        <pubDate>Tue, 10 Jan 2006 08:57:55 -0800</pubDate>
        <lastBuildDate>Sun, 05 Mar 2006 18:14:28 -0800</lastBuildDate>
            
        <item>
            <title>RGL:  A Ruby Graph Library on OS X</title>
            <link>http://swik.net/User:jerryk/Ruby%2C+Rails+and+Related/RGL%3A++A+Ruby+Graph+Library+on+OS+X/cw8x</link>
            <description>&lt;p&gt;After instaling the ruby gem for this handy looking library, I noticed that it wouldn&amp;#8217;t actually produce rendered pictures of any of my graphs to a file as the documentation&amp;#8217;s example shows.  A quick look into the code revealed a dependency on the &amp;#8216;dot&amp;#8217; utility from GraphViz.  RPMs of this are widely available for Red Hat Linux, and if you using Darwin Ports on &lt;span class=&quot;caps&quot;&gt;OS X&lt;/span&gt; a simple &amp;#8216;sudo port install graphviz&amp;#8217; will get you going&amp;#8230;&lt;/p&gt;
</description>
            
            <pubDate>Tue, 28 Mar 2006 15:17:45 -0800</pubDate>
        </item>
            
        <item>
            <title>Log4r::RollingFileOutputter Isn&#039;t (Quite)</title>
            <link>http://swik.net/User:jerryk/Ruby%2C+Rails+and+Related/Log4r%3A%3ARollingFileOutputter+Isn%27t+%28Quite%29/cuo0</link>
            <description>&lt;p&gt;While fiddling with the RollingFileOutputter in Log4r, I somehow got the idea, possibly from misreading either the documentation or somebody else&amp;#8217;s commentary somewhere, that the options hash to the constructor took a parameter called &amp;#8216;count&amp;#8217; along with &amp;#8216;maxsize&amp;#8217; and all the other usual things you&amp;#8217;d expect a rolling log system to want.&lt;/p&gt;


	&lt;p&gt;It doesn&amp;#8217;t.  Perusing the source code for RollingFileOutputter shows that although there&amp;#8217;s an instance variable called &amp;#8216;count&amp;#8217; that&amp;#8217;s used to figure out what to name the next log file, the only things that ever happen to this variable are its zeroing out at initialize-time, and its being incremented whenever a rollover condition (current file size or age) is hit.&lt;/p&gt;


	&lt;p&gt;As such you can&amp;#8217;t expect to automatically rotate through four log files &amp;#8216;mycrummy-00000.log&amp;#8217;, &amp;#8216;mycrummy-00001.log&amp;#8217;, etc., with rollover back to 00000 at the end&amp;#8230;  If you run long enough you&amp;#8217;ll eventually end up looking at &amp;#8216;mycrummy-867530.log&amp;#8217; (or whatever) which probably isn&amp;#8217;t quite what you&amp;#8217;re after.&lt;/p&gt;


	&lt;p&gt;This should be pretty straightforward to fix, and depending on how active Log4r is, I&amp;#8217;d be happy to submit a patch, although I&amp;#8217;m still new to Ruby and probably not as appropriately efficient and idiomatic in its use as I ought to be.  Either way, I remain curious as to whether the current behavior is an oversight, a by-design intention, or just incompatibility with a deranged and unreasonable personal fetish of mine about how rolling log files should work.  I&amp;#8217;d be happy to find out, and will freely bear any necessary culpability for whatever deranged and unreasonable personal fetishes I may have.&lt;/p&gt;


	&lt;p&gt;Anybody out there know?&lt;/p&gt;
</description>
            
            <pubDate>Sat, 25 Mar 2006 15:16:04 -0800</pubDate>
        </item>
            
        <item>
            <title>What is With The Rails Community?</title>
            <link>http://swik.net/User:jerryk/Ruby%2C+Rails+and+Related/What+is+With+The+Rails+Community%3F/ci2a</link>
            <description>&lt;p&gt;Having played with Rails for a couple of months, I&amp;#8217;ve noticed something really strange about the Rails community&amp;#8230;  something rare enough that I&amp;#8217;m not used to seeing it in Developer World.&lt;/p&gt;


	&lt;p&gt;They&amp;#8217;re &lt;em&gt;nice&lt;/em&gt;.&lt;/p&gt;


	&lt;p&gt;And &lt;em&gt;helpful&lt;/em&gt;.&lt;/p&gt;


	&lt;p&gt;Above all, many folks in the Rails community are nice and helpful in such a &lt;em&gt;conspicuously generous&lt;/em&gt; way that it makes working with Ruby and Rails, something that&amp;#8217;s already intriguing, fun and pleasant, even more so.&lt;/p&gt;


	&lt;p&gt;I don&amp;#8217;t know what exactly made them this way.  Is it something about the experience of working with these technologies that brings out more pleasantness in people, or inspires great reductions in obnoxious behavior?  Is it a function of the type of people attracted to this environment?  Or is it just that the initial core of the community has been so manifestly non-dickheaded that it&amp;#8217;s managed to inspire others to emulate a positive ideal rather than an unpleasant one?&lt;/p&gt;


	&lt;p&gt;Things I haven&amp;#8217;t seen much of:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Flame wars&lt;/li&gt;
		&lt;li&gt;Unimaginative name calling&lt;/li&gt;
		&lt;li&gt;Badgering and condescension about newcomers&amp;#8217; misunderstandings and blind spots.  Perhaps the environment&amp;#8217;s cleanliness makes for less of &lt;a href=&quot;http://blogs.msdn.com/oldnewthing/archive/2006/03/02/542115.aspx&quot;&gt;this kind of obvious&lt;/a&gt;  (namely the kind of obvious that is just &lt;em&gt;so&lt;/em&gt; obvious that it seems to entail multiple pages of painstaking explanation, delivered with maximal sanctimoniousness and profuse patronizing)&lt;/li&gt;
		&lt;li&gt;Automatically vicious and defensive reactions to people&amp;#8217;s problems and questions, where every question is interpreted by default as a personal attack.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;They&amp;#8217;re weird.  Weird I tell you.  But it&amp;#8217;s a good kind of weird.&lt;/p&gt;
</description>
            
            <pubDate>Sun, 12 Mar 2006 18:03:37 -0800</pubDate>
        </item>
            
        <item>
            <title>My Rails flash text is stuck!??!?!</title>
            <link>http://swik.net/User:jerryk/Ruby%2C+Rails+and+Related/My+Rails+flash+text+is+stuck%21%3F%3F%21%3F%21/cdcd</link>
            <description>&lt;p&gt;The following is a brief description of a problem I recently encountered while working on a Rails project.  I haven&amp;#8217;t had time to fully research what happened, so some of what appears here may be tantamount to a &lt;a href=&quot;http://www.unmuseum.org/yeti.htm&quot;&gt;yeti&lt;/a&gt; sighting.  Any Rails cluelessness, general ineptitude, or incalculable ignorance demonstrated below are solely my fault.  It&amp;#8217;s my hope that if someone googles around trying to solve a similar problem, they may stumble across this and find it modestly useful.&lt;/p&gt;


	&lt;p&gt;The problem was as follows.  I had a Rails app that had been working correctly for several weeks.  During deployment I had to switch from filesystem backed session storage to database session storage to deal with the fact that the application was being served by multiple web servers lying behind a load balancer.  I altered my environments.rb in the usual recommended manner, created a sessions table in MySQL, and was off to the races.  Or so I thought&amp;#8230;&lt;/p&gt;


	&lt;p&gt;The app proceeded to basically work&amp;#8230;  except the flash text I was using to communicate status text &lt;em&gt;never went away&lt;/em&gt;.  There it was&amp;#8230; haunting me from page to page&amp;#8230;  &amp;#8220;Login successful!&amp;#8221;  Thank you, but I got it the first time.  Begone, dam-ned unsightly green box that looked fine the first time, but that doesn&amp;#8217;t still need to besmirch my otherwise pristine browser window!&lt;/p&gt;


	&lt;p&gt;Switching back to filesystem sessions made the problem go away, and the flash returned to behaving as usual.  Going back to the database restored the problem.&lt;/p&gt;


	&lt;p&gt;My configuration was Rails 1.0.0, Ruby 1.8.4, and the 2.7 mysql gem.  I was running a 4.1.x series MySQL, and I tried this on both a Mac &lt;span class=&quot;caps&quot;&gt;OS X&lt;/span&gt; system, and two Red Hat Enterprise Linux servers with the same results.&lt;/p&gt;


	&lt;p&gt;After I groveled in puzzlement in the rubyonrails &lt;span class=&quot;caps&quot;&gt;IRC&lt;/span&gt; channel for a while, Jeremy Durham and Marcel Molina both suggested switching to &lt;a href=&quot;http://wiki.rubyonrails.com/rails/pages/EdgeRails&quot;&gt;edge rails&lt;/a&gt; with &amp;#8216;rake freeze_edge&amp;#8217;.  Given that time was running short, the problem appeared persistent, and I&amp;#8217;m a newcomer to the source code of Rails itself and not yet entirely confident at my ability to troubleshoot apparent oddities in it (or even yeti sightings), I did this&amp;#8230;&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;... and the problem utterly went away.&lt;/em&gt;   This leads me to suspect (although remember, I may have seen the yeti here somewhere) that something was a bit amiss in or around the 1.0.0 Rails gem involving database backed sessions, and that this problem has been remedied since then in the Rails subversion tree.  Everything else appears to not have suffered in any way from switching to the trunk version of rails.&lt;/p&gt;


	&lt;p&gt;In summary, as much for any search engines indexing this page as for any human readers my problem was:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Rails flash text got &amp;#8220;stuck&amp;#8221; on my display, as if the underlying session data wasn&amp;#8217;t getting rid of it automatically as it&amp;#8217;s supposed to, and the problem only occurred when I was using database-stored sessions (with MySQL, on both &lt;span class=&quot;caps&quot;&gt;OS X&lt;/span&gt; and RedHat Enterprise Linux)&lt;/li&gt;
		&lt;li&gt;Switching back to filesystem-stored sessions restored the normal behavior; it could be re-induced at any point by going back to db-sessions.&lt;/li&gt;
		&lt;li&gt;Switching to edge rails with &amp;#8216;rake freeze_edge&amp;#8217; seems to solve the problem.&lt;/li&gt;
	&lt;/ul&gt;
</description>
            
            <pubDate>Sun, 05 Mar 2006 18:13:02 -0800</pubDate>
        </item>
            
        <item>
            <title>More on Rails Testing Changes</title>
            <link>http://swik.net/User:jerryk/Ruby%2C+Rails+and+Related/More+on+Rails+Testing+Changes/bs51</link>
            <description>&lt;p&gt;Mike Clark has written an interesting &lt;a href=&quot;http://www.clarkware.com/cgi/blosxom/2005/10/24&quot;&gt;blog post&lt;/a&gt; on the changes to Rails unit testing in Rails 1.0.  He includes some justification and performance measurements.&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;ve been reading &lt;a href=&quot;http://pragmaticprogrammer.com/titles/rails/index.html&quot;&gt;Agile Development In Rails&lt;/a&gt;, then this will save you a little bit of confusion by making some sections of chapter 12 work properly.&lt;/p&gt;
</description>
            
            <pubDate>Tue, 10 Jan 2006 11:52:57 -0800</pubDate>
        </item>
            
        <item>
            <title>A Surprising Change in Rails 1.0 Involving Test Fixtures and Transactions</title>
            <link>http://swik.net/User:jerryk/Ruby%2C+Rails+and+Related/A+Surprising+Change+in+Rails+1.0+Involving+Test+Fixtures+and+Transactions/bs20</link>
            <description>&lt;p&gt;While following the discussion in chapter 12 of &lt;a href=&quot;http://pragmaticprogrammer.com/titles/rails/index.html&quot;&gt;Agile Web Development in Rails&lt;/a&gt; , using &lt;a class=&quot;wikilink&quot; href=&quot;http://swik.net/MySQL&quot;&gt;MySQL&lt;/a&gt; as my database, I had a few frustrating moments with test fixtures.&lt;/p&gt;


	&lt;p&gt;I found that the database contents specified in my test fixture were &lt;em&gt;not&lt;/em&gt; being restored between the runs of individual test cases, thereby causing every test after the first one that removed something from the database to fail.&lt;/p&gt;


	&lt;p&gt;Some digging around seemed to show that the behavior had changed in Rails 1.0 and that the text of my printing of the book seems to be, understandably, a bit out of date.&lt;/p&gt;


	&lt;p&gt;It seems that Rails now, by default, relies on database transactions to restore the database to its pre-test-run state.  If your MySQL setup is using the defaut MyISAM engine for its tables, transactions aren&amp;#8217;t supported, and the database will &lt;em&gt;not&lt;/em&gt; be returned to its initial state in this scheme.&lt;/p&gt;


	&lt;p&gt;To deal with this problem you have two options:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;Use MySQL Transactions:&lt;/strong&gt;  Create your database tables using the transaction-supporting InnoDB engine.  There&amp;#8217;s a good chance you want to do this for other reasons anyway.&lt;/li&gt;
		&lt;li&gt;&lt;strong&gt;Change Rails&amp;#8217; Behavior to that of pre-1.0:&lt;/strong&gt;  Edit &lt;pre&gt;test/test_helper.rb&lt;/pre&gt; in your Rails project to disable transactional fixtures to set &lt;pre&gt;use_transactional_fixtures=false&lt;/pre&gt; and &lt;pre&gt;use_instantiated_fixtures=true&lt;/pre&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;This gets things behaving as the book (which &lt;span class=&quot;caps&quot;&gt;BTW&lt;/span&gt; is very good) would lead you believe they would.&lt;/p&gt;
</description>
            
            <pubDate>Tue, 10 Jan 2006 09:02:13 -0800</pubDate>
        </item>
            
    </channel>
</rss>
