The redesigned minitest_visible gem (v0.1.0)

Just because code works, doesn’t mean it’s the correct code. A case in point is my own minitest_visible gem. This little bit of Ruby code adds simple progress tracking to the testing process. In any programming, and especially in a  dynamic language like Ruby, testing is vital. So is having faith in those tests.

Now the standard minitest testing system is awesome! It is full of helpful methods for confirming the correctness of code. It is however a little terse regarding progress. That is where minitest_visible comes in. When used, it lets you know the version of minitest being used and prints out the name of each test file as it is processed.

A fairly simple task. Yet, when I came up with the first version of this code, it was clunky and ugly, but it worked. I suppose I had other matters pressing at the time, but I let things stand at “good enough”

Recently, I began to think that there must be a way to make the code better, cleaner, and easier to use. It seems that I have indeed learned some stuff in the last year because I am now writing about a new version that is far simpler and streamlined.

OK, let’s be clear: The old way of doing things is still supported, but prints out a message about the needed changes. Test still pass though so disruption and panic should be minimal.

The new minitest_visible can be found https://rubygems.org/gems/minitest_visible and the source code is at https://github.com/PeterCamilleri/minitest_visible.

Yours Truly

Peter Camilleri (aka Squidly Jones)

A Double Bill!

Having just announced format_engine version 0.4.0, things seem to be speeding along as I now announce format_engine version 0.5.1 and ruby_sscanf version 0.1.1.

These two gems are rather tightly coupled. The ruby_sscanf gem uses the capabilities of the format_engine to create a Ruby translation of the POSIX ‘C’ sscanf routine. This allows a formatted string to be processed into the data elements contained within. The new version of the format_engine is required to add some features required by the ruby_sscanf gem.

I thought a great deal about the idea of merging the ruby_sscanf gem into the format_engine, but in the end, concluded that they did different things despite the high degree of coupling. Further, ruby_sscanf modifies (or monkey patches) the base String class, and that was something that might not always be desired. So two separate gems.

These may be found at:

format_engine gem, format_engine source code

ruby_sscanf gem, ruby_sscanf source code 

I hope all Ruby programmers find these programming tools to be useful.

Yours Truly

Peter Camilleri (aka Squidly Jones)

Format Engine Version 0.4.0

I am pleased to announce the new version of the format_engine gem. This blog has been highly remiss in keeping up with the releases of new code. So, we are skipping ahead from version 0.0.2 to 0.4.0. After a hiatus of six months, the new version has improvements, mostly to the parser side of the engine.

  1. Parsed spaces may match zero or more input spaces so that it is no longer necessary to predict the exact number of spaces between data elements.
  2. The parser now supports strings with regular expression sub-sets like %[abc] which matches the input in the set “a”, “b”, and “c”. Also supported is exclusion sub-sets like %[^abc] which matches the input not in the set “a”, “b”, and “c”.
  3. Improved documentation in the README.md file.

The gem may be found at Ruby Gems and the source code at GitHub.

Yours Truly

Peter Camilleri (aka Squidly Jones)