<?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>confabulus</title>
	<atom:link href="http://blog.confabulus.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.confabulus.com</link>
	<description>rails, coding, and the goings on at confabulus</description>
	<lastBuildDate>Fri, 19 Feb 2010 22:08:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Simplicity Itself</title>
		<link>http://blog.confabulus.com/2010/02/18/simplicity-itself/</link>
		<comments>http://blog.confabulus.com/2010/02/18/simplicity-itself/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 03:33:41 +0000</pubDate>
		<dc:creator>gaffo</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[OpenGL|ES]]></category>
		<category><![CDATA[Palm Pre]]></category>

		<guid isPermaLink="false">http://blog.confabulus.com/?p=159</guid>
		<description><![CDATA[ I just wanted to share what it took to draw a simple yellow triangle on a black background in OpenGL&#124;ES. I hope it will give my Ruby friends and Haskell friends an aneurysm. 
To show this:

I had to do this:

//The headers
#include &#60;SDL/SDL.h&#62;
#include &#60;SDL/SDL_opengles.h&#62;

//Screen attributes
const int SCREEN_WIDTH = 480;
const int SCREEN_HEIGHT = 320;
const int SCREEN_BPP [...]]]></description>
			<content:encoded><![CDATA[<p> I just wanted to share what it took to draw a simple yellow triangle on a black background in OpenGL|ES. I hope it will give my Ruby friends and Haskell friends an aneurysm. </p>
<p>To show this:<br />
<img src="http://blog.confabulus.com/wp-content/uploads/2010/02/HelloTriangle1.png" alt="Hello Triangle" /></p>
<p>I had to do this:</p>
<pre class="brush: cpp">
//The headers
#include &lt;SDL/SDL.h&gt;
#include &lt;SDL/SDL_opengles.h&gt;

//Screen attributes
const int SCREEN_WIDTH = 480;
const int SCREEN_HEIGHT = 320;
const int SCREEN_BPP = 32;

SDL_Event event;
GLuint programObject;

GLuint LoadShader ( GLenum type, const char *shaderSrc )
{
   GLuint shader;
   GLint compiled;

   // Create the shader object
   shader = glCreateShader ( type );

   if ( shader == 0 )
   	return 0;

   // Load the shader source
   glShaderSource ( shader, 1, &amp;amp;amp;amp;amp;amp;shaderSrc, NULL );

   // Compile the shader
   glCompileShader ( shader );

   // Check the compile status
   glGetShaderiv ( shader, GL_COMPILE_STATUS, &amp;amp;amp;amp;amp;amp;compiled );

   return shader;

}

bool init_GL() {

	const char* vShaderStr = &quot;attribute vec4 vPosition;    \n&quot;
		&quot;void main()                  \n&quot;
		&quot;{                            \n&quot;
		&quot;   gl_Position = vPosition;  \n&quot;
		&quot;}                            \n&quot;;

	const char* fShaderStr = &quot;precision mediump float;\n&quot;
		&quot;void main()                                  \n&quot;
		&quot;{                                            \n&quot;
		&quot;  gl_FragColor = vec4 ( 1.0, 1.0, 0.0, 1.0 );\n&quot;
		&quot;}                                            \n&quot;;

	GLuint vertexShader;
	GLuint fragmentShader;
	GLint linked;

	// Load the vertex/fragment shaders
	vertexShader = LoadShader(GL_VERTEX_SHADER, vShaderStr);
	fragmentShader = LoadShader(GL_FRAGMENT_SHADER, fShaderStr);

	// Create the program object
	programObject = glCreateProgram();

	if (programObject == 0)
		return 0;

	glAttachShader(programObject, vertexShader);
	glAttachShader(programObject, fragmentShader);

	// Bind vPosition to attribute 0
	glBindAttribLocation(programObject, 0, &quot;vPosition&quot;);

	// Link the program
	glLinkProgram(programObject);

	// Check the link status
	glGetProgramiv(programObject, GL_LINK_STATUS, &amp;amp;amp;amp;amp;amp;linked);

	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	return true;
}

bool init() {
	//Initialize SDL
	if (SDL_Init(SDL_INIT_EVERYTHING) &lt; 0) {
//		return false;
	}

	//Create Window
	if (SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_OPENGL)
			== NULL) {
		return false;
	}

	//Initialize OpenGL
	if (init_GL() == false) {
		return false;
	}

	//Set caption
	SDL_WM_SetCaption(&quot;OpenGL Test&quot;, NULL);

	return true;
}

void clean_up() {
	//Quit SDL
	SDL_Quit();
}

void Draw() {
	GLfloat vVertices[] = { 0.0f, 0.5f, 0.0f, -0.5f, -0.5f, 0.0f, 0.5f, -0.5f,
			0.0f };

	// Set the viewport
	glViewport(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);

	// Clear the color buffer
	glClear(GL_COLOR_BUFFER_BIT);

	// Use the program object
	glUseProgram(programObject);

	// Load the vertex data
	glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, vVertices);
	glEnableVertexAttribArray(0);

	glDrawArrays(GL_TRIANGLES, 0, 3);
}

int main(int argc, char *argv[]) {
	//Quit flag
	bool quit = false;

	//Initialize
	if (init() == false) {
		return 1;
	}

	//Wait for user exit
	while (quit == false) {

		//While there are events to handle
		while (SDL_PollEvent(&amp;amp;amp;amp;amp;amp;event)) {
			//Handle key presses

			if (event.type == SDL_QUIT) {
				quit = true;
			}
		}
		Draw();
		SDL_GL_SwapBuffers();
	}

	//Clean up
	clean_up();

	return 0;
}
</pre>
<p>You will all be happy to know that one of the first things I did (after re-learning make) was dive into google test and get a testing framework working. My last several projects have been with Ruby and Java, and in my spare time I have been building Palm Pre apps in Javascript and messing around with Erlang.</p>
<p>So I thought it was funny that many of my friends have been going to more and more abstract languages, while I, oddly, have decided to go lower. I have been playing around with doing OpenGL|ES and C++ lately in my spare time, hopefully in prep of the release of the Native SDK (PDK) for the Palm Pre.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.confabulus.com/2010/02/18/simplicity-itself/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>updating embedded jruby gems with ant</title>
		<link>http://blog.confabulus.com/2009/12/08/updating-embedded-jruby-gems-with-ant/</link>
		<comments>http://blog.confabulus.com/2009/12/08/updating-embedded-jruby-gems-with-ant/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 20:05:17 +0000</pubDate>
		<dc:creator>gaffo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.confabulus.com/?p=149</guid>
		<description><![CDATA[Recently I have been using cuke4duke on a java project (which I&#8217;ll discuss in a later article). We have jruby running from jruby-lib/jruby-complete.jar. Our gems are embedded in the project with the GEM_HOME/GEM_PATH being set to jruby-lib/gems. All of this is under source control. We don&#8217;t have jruby installed at all on the system, it [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have been using cuke4duke on a java project (which I&#8217;ll discuss in a later article). We have jruby running from jruby-lib/jruby-complete.jar. Our gems are embedded in the project with the GEM_HOME/GEM_PATH being set to jruby-lib/gems. All of this is under source control. We don&#8217;t have jruby installed at all on the system, it is only in this project. I&#8217;ve mainly been the one on the team (of 4 total) who has been maintaining the jruby stuff as none of the other devs have jruby experience.</p>
<p>So one of the problems I had recently was how to update the gems that are checked into source. One of the other devs wanted to use multi-line strings in cucumber and found that it didn&#8217;t work with cuke4duke until cucumber-0.4.4. We had 0.4.2. So what I needed was an easy way for the other devs to be able to update the gems without relying on jruby being &#8220;installed&#8221; on the machine. Since these are java guys, ant seemed the best solution.</p>
<p>Here is the ant task I used:</p>
<pre class="brush: xml">
&lt;path id=&quot;jruby.classpath&quot;&gt;
	&lt;fileset dir=&quot;jruby-lib&quot;&gt;
		&lt;include name=&quot;**/*.jar&quot; /&gt;
		&lt;exclude name=&quot;gems/*&quot; /&gt;
	&lt;/fileset&gt;
&lt;/path&gt;
&lt;target name=&quot;update.gems&quot; description=&quot;update the installed gems&quot;&gt;
	&lt;!-- this updates the gems on the system --&gt;
	&lt;java classname=&quot;org.jruby.Main&quot; fork=&quot;true&quot; failonerror=&quot;true&quot;&gt;
		&lt;classpath refid=&quot;jruby.classpath&quot; /&gt;
		&lt;env key=&quot;GEM_PATH&quot; value=&quot;jruby-lib/gems&quot; /&gt;
		&lt;env key=&quot;GEM_HOME&quot; value=&quot;jruby-lib/gems&quot; /&gt;
		&lt;arg value=&quot;-S&quot; /&gt;
		&lt;arg value=&quot;gem&quot; /&gt;
		&lt;arg value=&quot;update&quot; /&gt;
	&lt;/java&gt;
	&lt;!-- this removes any obsoleted / previous version of all gems --&gt;
	&lt;java classname=&quot;org.jruby.Main&quot; fork=&quot;true&quot; failonerror=&quot;true&quot;&gt;
		&lt;classpath refid=&quot;jruby.classpath&quot; /&gt;
		&lt;env key=&quot;GEM_PATH&quot; value=&quot;jruby-lib/gems&quot; /&gt;
		&lt;env key=&quot;GEM_HOME&quot; value=&quot;jruby-lib/gems&quot; /&gt;
		&lt;arg value=&quot;-S&quot; /&gt;
		&lt;arg value=&quot;gem&quot; /&gt;
		&lt;arg value=&quot;cleanup&quot; /&gt;
	&lt;/java&gt;
&lt;/target&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.confabulus.com/2009/12/08/updating-embedded-jruby-gems-with-ant/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Testing WebOS Applications Made Easy with jasmine_webos gem</title>
		<link>http://blog.confabulus.com/2009/09/21/testing-webos-applications-made-easy-with-jasmine_webos-gem/</link>
		<comments>http://blog.confabulus.com/2009/09/21/testing-webos-applications-made-easy-with-jasmine_webos-gem/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 16:00:48 +0000</pubDate>
		<dc:creator>gaffo</dc:creator>
				<category><![CDATA[Jasmine]]></category>
		<category><![CDATA[WebOS]]></category>

		<guid isPermaLink="false">http://blog.confabulus.com/?p=128</guid>
		<description><![CDATA[TDD for WebOS applications is still in its early stages, but the guys over at Pivotal Labs have made some great strides in the low level tooling. The Jasmine javascript testing framework provides a dom-less testing implementation which works well in the MVC environment of a WebOS application.
Pivotal is also hard at work at Pockets [...]]]></description>
			<content:encoded><![CDATA[<p>TDD for WebOS applications is still in its early stages, but the guys over at <a href="http://pivotallabs.com/">Pivotal Labs</a> have made some great strides in the low level tooling. The <a href="http://github.com/pivotal/jasmine">Jasmine</a> javascript testing framework provides a dom-less testing implementation which works well in the MVC environment of a WebOS application.</p>
<p>Pivotal is also hard at work at Pockets (not yet released) which provides on emulator testing and integration of Jasmine into your WebOS application. However, as of now (2009/09/21), this has not been released owing to major changes in the debuging environment in the WebOS SDK.</p>
<p>To help with the transition, I have released my initial version of <a href="http://github.com/gaffo/jasmine_webos">jasmine_webos</a>, which facilitates testing your webos application with Jasmine. Jasmine_webos requires ruby and rubygems as well as the json and thin gems. To install jasmine_webos, simply do:<br />
<code><br />
sudo gem source -a http://gemcutter.org<br />
sudo gem install jasmine_webos<br />
</code></p>
<p>Jasmine_webos provides a generator to create the directories it expects (spec/javascript/spec and spec/javascript/matchers) as well as an example spec so that you can make sure that it is working. This is accessed by running the following from the root of your WebOS Application:<br />
<code>jasmine_webos -g</code></p>
<p>You can then run the test server (dynamically builds up suites for testing) with:<br />
<code>jasmine_webos -s</code>. You can then run your tests by hitting http://localhost:8888 with any capable browser.</p>
<p>Jasmine_webos server will include any javascript files in your app directory, all matchers in your spec/javascript/matchers, and all tests in your spec/javascript/spec folder. Jasmine_webos keeps the jasmine files contained in the gem so that as new features for jasmine are released, you can get easy access to them by updating the gem. This also keeps you from having to copy jasmine into each of your apps.</p>
<p>In the future I am looking at implementing:<br />
* A config file for additional directories and requirements<br />
* celerity for command line testing / integrated builds<br />
* including mojo framework libraries for fuller stack testing.</p>
<p>Please report any bugs to the <a href="http://github.com/gaffo/jasmine_webos/issues">github bugs page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.confabulus.com/2009/09/21/testing-webos-applications-made-easy-with-jasmine_webos-gem/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Announcing Mainline</title>
		<link>http://blog.confabulus.com/2009/01/30/125/</link>
		<comments>http://blog.confabulus.com/2009/01/30/125/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 02:26:02 +0000</pubDate>
		<dc:creator>gaffo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.confabulus.com/?p=125</guid>
		<description><![CDATA[
Mainline is a rails plugin which exposes your rails app via webrick to allow
testing with browser automators such as Selenium or Watir. Mainline allows
your rails actions to run in the same transaction as your unit tests so you
can use fixtures, factories, or whatever.
Basically you can now test selenium in your same transaction and don&#8217;t have [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>
Mainline is a rails plugin which exposes your rails app via webrick to allow<br />
testing with browser automators such as Selenium or Watir. Mainline allows<br />
your rails actions to run in the same transaction as your unit tests so you<br />
can use fixtures, factories, or whatever.</p></blockquote>
<p>Basically you can now test selenium in your same transaction and don&#8217;t have to worry about rolling back your fixtures or factories.</p>
<p>Grab it from <a href="http://github.com/gaffo/mainline.git">Github</a><br />
Bug Reports at <a href="http://gaffo.lighthouseapp.com/projects/24578-mainline/overview">Lighthouse</a><br />
Docs at <a href="http://rdocul.us/repos/mainline/master/index.html">RDocul.us</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.confabulus.com/2009/01/30/125/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making your Plugin or Gem configurable</title>
		<link>http://blog.confabulus.com/2008/12/30/making-your-plugin-or-gem-configurable/</link>
		<comments>http://blog.confabulus.com/2008/12/30/making-your-plugin-or-gem-configurable/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 02:41:32 +0000</pubDate>
		<dc:creator>gaffo</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[test::unit]]></category>

		<guid isPermaLink="false">http://blog.confabulus.com/?p=105</guid>
		<description><![CDATA[Recently I added a configuration mechanism to Webrat. It was surprisingly easy, and mainly copied from rails core. I would suggest adding somthing like this to any plugin that has more than a few features or ones that users have asked to have turned off.
First off you&#8217;re going to have to create the actual configuration [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I added a configuration mechanism to Webrat. It was surprisingly easy, and mainly copied from rails core. I would suggest adding somthing like this to any plugin that has more than a few features or ones that users have asked to have turned off.</p>
<p>First off you&#8217;re going to have to create the actual configuration object. There are a few good ways to do this. One is to use a <a href="http://toolmantim.com/article/2007/5/18/consolidating_your_apps_constants">config module</a>, another is to create a configuration object that is accessible via a singleton method.</p>
<p>I&#8217;m going to go with the second one, a configuration object.</p>
<p>Toss this one in lib/configuration.rb (A simplification of <a href="http://github.com/brynary/webrat/tree/2c51d908301e23a8594eda49f0d64ce197b3e842/lib/webrat/core/configuration.rb">Code</a> | <a href="http://rdocul.us/repos/webrat/master/classes/Webrat/Configuration.html">RDoc</a>) </p>
<pre class="brush: ruby">
module Plugin

  # Configures Plugin.
  def self.configure(configuration = Plugin::Configuration.new)
    yield configuration if block_given?
    @@configuration = configuration
  end

  def self.configuration # :nodoc:
    @@configuration ||= Plugin::Configuration.new
  end

  # Plugin can be configured using the Plugin.configure method. For example:
  #
  #   Plugin.configure do |config|
  #     config.show_whiny_errors = false
  #   end
  class Configuration

    # Should whiny error messages be shown?
    attr_writer :show_whiny_errors

    def initialize # :nodoc:
      # set your defaults in here
      self.show_whiny_errors = true
      # put as much as you want in here
    end

    # some syntactic sugar for you, the coder
    def show_whiny_errors? #:nodoc:
      @show_whiny_erorrs ? true : false
    end

  end

end
</pre>
<p>Okay, now we need to test the config object itself. This is why it&#8217;s nice to make an object just to house the config, it&#8217;s easy to test. What do we test? Well defaults and accessors for two!</p>
<p>(The following lifted from <a href="http://github.com/brynary/webrat/tree/2c51d908301e23a8594eda49f0d64ce197b3e842/spec/webrat/core/configuration_spec.rb">Code</a>) (sorry this is in rspec, it&#8217;s not hard to do in test::unit)</p>
<pre class="brush: ruby">
require File.expand_path(File.dirname(__FILE__) + &#039;/../../spec_helper&#039;)

describe Plugin::Configuration do
  # define matchers for testing
  predicate_matchers[:show_whiny_errors] = :show_whiny_errors?

  it &#039;should show whiny errors by default&#039; do
    config = Plugin::Configuration.new
    config.should show_whiny_errors?
  end

  it &#039;should be configurable with a block&#039; do
    Plugin.configure do |config|
      config.show_whiny_errors = false
    end

    config = Plugin.configuration
    config.should_not show_whiny_errors?
  end

end
</pre>
<p>Now we need to do some stuff to make it nicer for our other users to test. Put the following in your test_helper or spec helper. It will allow you to clear your config after each test. Nice to have to to avoid messy test issues.</p>
<p>(The following lifted from <a href="http://github.com/brynary/webrat/tree/2c51d908301e23a8594eda49f0d64ce197b3e842/spec/spec_helper.rb">Code</a>)</p>
<pre class="brush: ruby">
module Plugin
  @@previous_config = nil

  def self.cache_config_for_test
    @@previous_config = Plugin.configuration.clone
  end

  def self.reset_for_test
    @@configuration = @@previous_config if @@previous_config
  end
end

# configure your test runner / spec runner to always clear the config
Spec::Runner.configure do |config|

  config.before :each do
    Plugin.cache_config_for_test
  end

  config.after :each do
    Plugin.reset_for_test
  end
end
</pre>
<p>This last bit is somewhat hard to do in test::unit as it is harder to hook into the setup (you only get one in the call chain). I&#8217;m willing to take some help on cleaning this one up for test::unit. Currently I have just been putting it in the setup / teardown for each test file.</p>
<p>Finally you need to make use of this in tests, fortunately that is quite easy. Just:</p>
<pre class="brush: ruby">
describe SomeObject do
    it &#039;it shouldn&#039;t do it when whiny nils are off&#039; do
      Plugin.configure do |config|
        config.show_whiny_errors = false
      end
      object.should_not_receive(:log)

      object.do_somthing_that_usually_complains
    end
end
</pre>
<p>Finally, anywhere in your plugin that you think somthing is whiny, just check the config before using it like this:</p>
<pre class="brush: ruby">
log(&amp;quot;you should really fix this&amp;quot;) if Plugin.configuration.show_whiny_errors?
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.confabulus.com/2008/12/30/making-your-plugin-or-gem-configurable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>chicken and egg</title>
		<link>http://blog.confabulus.com/2008/12/27/chicken-and-egg/</link>
		<comments>http://blog.confabulus.com/2008/12/27/chicken-and-egg/#comments</comments>
		<pubDate>Sun, 28 Dec 2008 00:54:56 +0000</pubDate>
		<dc:creator>gaffo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.confabulus.com/?p=56</guid>
		<description><![CDATA[I can&#8217;t believe this still hapens. Unzip software that is zipped. I was trying to unzip a file off of the web to install on my palm and they had zipped the 15k zip prc file to save those few extra bytes on the web making it impossible to actually download and use the software [...]]]></description>
			<content:encoded><![CDATA[<p>I can&#8217;t believe this still hapens. Unzip software that is zipped. I was trying to unzip a file off of the web to install on my palm and they had zipped the 15k zip prc file to save those few extra bytes on the web making it impossible to actually download and use the software without a full computer.</p>
<p>Ugh.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.confabulus.com/2008/12/27/chicken-and-egg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>generator_missing plugin release</title>
		<link>http://blog.confabulus.com/2008/12/22/generator_missing-plugin-release/</link>
		<comments>http://blog.confabulus.com/2008/12/22/generator_missing-plugin-release/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 16:16:27 +0000</pubDate>
		<dc:creator>gaffo</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.confabulus.com/?p=95</guid>
		<description><![CDATA[I just posted my initial cut of my generator_missing plugin. This plugin is meant to be a repository of additional generators to help workflow. The current ones are:

Library: Generates a non active record ruby object and a test class.

lib/library_name.rb
test/unit/library_name_test.rb


Module: Generates a basic module under lib and its tests.

lib/module_name.rb
test/unit/module_name_test.rb, with a mock class that mixes in [...]]]></description>
			<content:encoded><![CDATA[<p>I just posted my initial cut of my generator_missing plugin. This plugin is meant to be a repository of additional generators to help workflow. The current ones are:</p>
<ul>
<li>Library: Generates a non active record ruby object and a test class.
<ul>
<li>lib/library_name.rb</li>
<li>test/unit/library_name_test.rb</li>
</ul>
</li>
<li>Module: Generates a basic module under lib and its tests.
<ul>
<li>lib/module_name.rb</li>
<li>test/unit/module_name_test.rb, with a mock class that mixes in the library</li>
</ul>
</li>
<li>Base Generator: Generates a generator (mmm meta) with a template, usage and manifest.
<ul>
<li>lib/generators/generator_name/generator_name_generator.rb</li>
<li>lib/generators/generator_name/USAGE</li>
<li>lib/generators/generator_name/templates</li>
</ul>
</li>
</ul>
<p>The plugin is at: <a href="http://github.com/gaffo/generator_missing">http://github.com/gaffo/generator_missing</a> / git://github.com/gaffo/generator_missing.git<br />
Lighthouse at <a href="http://gaffo.lighthouseapp.com/projects/21321-generator_missing/overview">http://gaffo.lighthouseapp.com/projects/21321-generator_missing/overview</a>.</p>
<p>I am currently taking both suggestions and pull requests for generators that should be added.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.confabulus.com/2008/12/22/generator_missing-plugin-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RDocul.us launch</title>
		<link>http://blog.confabulus.com/2008/11/24/rdoculus-launch/</link>
		<comments>http://blog.confabulus.com/2008/11/24/rdoculus-launch/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 02:42:11 +0000</pubDate>
		<dc:creator>gaffo</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[rdocul.us]]></category>
		<category><![CDATA[launch]]></category>

		<guid isPermaLink="false">http://blog.confabulus.com/?p=88</guid>
		<description><![CDATA[I was tired of not having up to date docs for the rails gems and plugins that I use, so I created RDocul.us. Bascially, anyone is free to submit any github based rails plugin or gem and it will be kept up to date on RDocul.us. Once it&#8217;s approved it will be automatically updated within [...]]]></description>
			<content:encoded><![CDATA[<p>I was tired of not having up to date docs for the rails gems and plugins that I use, so I created <a href="http://rdocul.us">RDocul.us</a>. Bascially, anyone is free to submit any github based rails plugin or gem and it will be kept up to date on RDocul.us. Once it&#8217;s approved it will be automatically updated within four hours of any commit to github.</p>
<p>Currently there is a delay for as I am manually vetting and configuring the libraries. Unfortunately not everyone is creating the .documentation file or using the same rake task (rdoc, doc, docs) or doc directory (rdoc, doc, docs) so I have to give it a quick once over.</p>
<p>Please let check it out and let me know what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.confabulus.com/2008/11/24/rdoculus-launch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>testing named scopes</title>
		<link>http://blog.confabulus.com/2008/11/24/testing-named-scopes/</link>
		<comments>http://blog.confabulus.com/2008/11/24/testing-named-scopes/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 02:33:58 +0000</pubDate>
		<dc:creator>gaffo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://blog.confabulus.com/?p=80</guid>
		<description><![CDATA[Named scopes are a nice feature that came out in rails 2.1, however, testing them is not very obvious.
Say we have a named scope in our member object which looks like this:

class Member &#60; ActiveRecord::Base
  named_scope :active, {:conditions =&#62; {:status =&#62; Member::STATUS_ACTIVE}}
end

There are 2 things we need to do to test them. 
First would [...]]]></description>
			<content:encoded><![CDATA[<p>Named scopes are a nice feature that came out in rails 2.1, however, testing them is not very obvious.</p>
<p>Say we have a named scope in our member object which looks like this:</p>
<pre class="brush: ruby">
class Member &lt; ActiveRecord::Base
  named_scope :active, {:conditions =&gt; {:status =&gt; Member::STATUS_ACTIVE}}
end
</pre>
<p>There are 2 things we need to do to test them. </p>
<p>First would be to make sure that the conditions are the same as we think they are. This one is open for debate a bit as it is somewhat tying the implementation directly to the test.</p>
<p>Second, we actually have to USE the scope. Just calling Member.active does not actually use the scope. This is because named scopes can be cascaded. If I had recent scope on a member that only showed me those that signed up recently, I could actually do Member.active.recent, and it would not execute against database, it would just nest the conditions.</p>
<p>So how do I use the scope? Use any collection method on them. I like size, but I&#8217;m completely open to suggestions. So below is how I am testing named scopes.</p>
<pre class="brush: ruby">
class MemberTest &lt; ActiveRecord::TestCase
  context &#039;named scope active&#039; do
    setup do
      @scoped_find = Member.active
    end

    should &quot;have condition active&quot; do
      expected_conditions  = {:conditions =&gt; [&quot;member.status == #{Member::STATUS_ACTIVE}&quot;]}
      assert_equal expected_conditions, @scoped_find.proxy_options
    end

    should &quot;have results&quot; do
      assert_not_nil(scoped.active.size)
    end
  end
end
</pre>
<p>The first test does part 1, the 2nd, part 2.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.confabulus.com/2008/11/24/testing-named-scopes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql issue with rails and antivirus on windows</title>
		<link>http://blog.confabulus.com/2008/10/31/mysql-issue-with-rails-and-antivirus-on-windows/</link>
		<comments>http://blog.confabulus.com/2008/10/31/mysql-issue-with-rails-and-antivirus-on-windows/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 19:40:12 +0000</pubDate>
		<dc:creator>gaffo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.confabulus.com/?p=78</guid>
		<description><![CDATA[
abstract_adapter.rb:150:in log': Mysql::Error: Can't create/write to file 'C:\MySQL5\tmp\#sql_190_0.MYI' (Errcode: 13)
I had been getting this issue quite a bit recently. The cause actually turned out to be a conflict between McAfee and MySQL. What was happening is that McAfee scans any file that is recently written to, especially those in tmp directories. McAfee reading the file [...]]]></description>
			<content:encoded><![CDATA[<p><code><br />
abstract_adapter.rb:150:in log': Mysql::Error: Can't create/write to file 'C:\MySQL5\tmp\#sql_190_0.MYI' (Errcode: 13)</code></p>
<p>I had been getting this issue quite a bit recently. The cause actually turned out to be a conflict between McAfee and MySQL. What was happening is that McAfee scans any file that is recently written to, especially those in tmp directories. McAfee reading the file causes the above issue to MySQL. The fix is 2 fold. First, if you have not already, move the location of the MySQL tmp file. You can do this by editing my.ini in your MySQL directory. For Example:<br />
<code><br />
tmpdir="C:/Program Files/MySQL/tmp/"<br />
</code></p>
<p>You may also have to add an exception to your antivirus so that it will no longer scan this file. I had to do this because I was using corporate antivirus. You may have to get your Sysadmin to do this.</p>
<p><a href="http://forums.mysql.com/read.php?24,169274,178492">Here is a post on mysql&#8217;s forums describing this issue as well</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.confabulus.com/2008/10/31/mysql-issue-with-rails-and-antivirus-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
