Monthly Archives: October 2006

Better API with Ruby

I was building an API to automate MS Access and started with VBScript, because I tough it would be more simple. Even with no built-in include support, no true test framework, the code was pretty simple. The problem emerged at the time of using the resulting API…

VBScript:

GetControl(GetForm(myApp, "Contact"), "Name").Value = "test"

= ugly

Now with the help of ruby win32ole module and some magic…

Ruby:

my_app.contact.name = "test"

= beautiful

If you haven’t given ruby a try yet, I suggest you do ASAP with anything: test, build script, code generation, just one time and I guaranty you’ll be amazed.

3 Comments

Filed under ruby

migrate NAnt task

Just added an NAnt task to the migrator project. So if you would like to use it without the Castle Generator you could use this simple NAnt task on your own super projects:

<loadtasks assembly=".../Migrator.NAnt.dll" />
<target name="migrate" description="Migrate the database" depends="build">
  <property name="version" value="-1" overwrite="false" />
  <migrate
    provider="MySql|PostgreSQL|SqlServer"
    connectionstring="Database=MyDB;Data Source=localhost;User Id=;Password=;"
    migrations="bin/MyProject.dll"
    to="${version}" />
</target>

Note that this version of the Migrator as not yet been updated in the Castle Generator libs because some work is still in progress for next release (something like SQLite support and other cool stuff) so you have to get the source and build it yourself from http://code.macournoyer.com/svn/migrator/trunk/.

Thanks to all people supporting the project!

5 Comments

Filed under Migrator