January 2007 Archives

OOPS! I released again!

| | Comments (0)

I totally forgot to blog this!

ParseTree version 1.6.4 has been released!

http://rubyforge.org/projects/parsetree

ParseTree is a C extension (using RubyInline) that extracts the parse tree for an entire class or a specific method and returns it as a s-expression (aka sexp) using ruby's arrays, strings, symbols, and integers.

  • 1 minor enhancement:
    • Switched short if/unless to 1 line expressions.
  • 2 bug fixes:
    • Fixed the nested case/when bug. YAY!
    • Added dasgncurr and defnrescue test cases.

ruby2ruby version 1.1.4 has been released!

http://rubyforge.org/projects/seattlerb

ruby2ruby provides a means of generating pure ruby code easily from ParseTree's Sexps. This makes making dynamic language processors much easier in ruby than ever before.

Changes:

  • 4 minor enhancements:
    • Added some extra rewriting code and tests for various bmethods.
      Ugh.
    • Added support for splatted block args.
    • Refactored class/module and dsym/dstr.
    • Short if/unless statements are now post-conditional expressions.
  • 4 bug fixes:
    • Finally fixed eric's nebulous proc code-in-goalposts bug.
    • Fixed dasgn_curr so block's dasgn vars decl goes away (bug 7420).
    • Fixed dmethod. I think the tests were bogus before.
    • Fixed improper end in method rescues (bug 7396).

heckle version 1.2.0 has been released!

http://www.rubyforge.org/projects/seattlerb by Ryan Davis and Kevin Clark

This one is huge. Heckle is turning into the test tool I always wanted for ruby.

Heckle is a mutation tester. It modifies your code and runs your
tests to make sure they fail. The idea is that if code can be changed
and your tests don't notice, either that code isn't being covered or
it doesn't do anything.

  • 2 major enhancements:
    • Timeout for tests set dynamically and overridable with -T
    • Class method support with "self.method_name"
  • 3 minor enhancements:
    • -b allows heckling of branches only
    • Restructured class heirarchy and got rid of Base and others.
    • Revamped the tests and reduced size by 60%.
  • 1 bug fix:
    • Fixed the infinite loop caused by syntax errors

FreeImage on OSX

| | Comments (3)

If you develop on OSX and want to try out image_science, things just got even easier:

  % sudo port selfupdate
  % sudo port install freeimage
  % sudo gem install image_science

I welcome any and all help on the linux side to get freeimage packaged up in their various packaging systems. It'll make it easier to get freeimage accepted on various ISPs/ASPs.

FreeBSD already has a port. It is a bit old but I think it should actually be compatible.

If you happen to be hit by Ticket #5704: Bug in ActiveRecord::Base when mixing STI and abstract models, and you're seeing failures to find STI instances intermittently in development mode, try the following:

class MyAbstractModel < ActiveRecard::Base
  self.abstract_class = false
  # ...
end

-----

class MySTIModel < MyAbstractModel
  TYPES = %w(Sub1 Sub2 Sub3)
  def self.inherited(cls)
    super
    raise "not in #{self.class}::TYPES: #{cls}" unless TYPES.include? cls.name
  end
end

MySTIModel::TYPES.each do |f|
  require_dependency f.underscore
end

-----

class Sub1 < MySTIModel; end
class Sub2 < MySTIModel; end
class Sub3 < MySTIModel; end

It is a stupid bug and I can't do much about it, but the above workaround seems to be a nice tradeoff between horrible hack and maintainability. By pushing the list of subclasses up to the TYPES array, you keep it visible and near the top of the file. By having the inherited hook, you keep slipups in maintainability as visible as possible.

UPDATED: All of the classes in my actual use were single word classes. Kevin Clark pointed out that my code doesn't work with camel-cased/multiple-word class names. The code above has been updated to fix that.

image_science 1.1.0 Released

| | Comments (1)

image_science version 1.1.0 has been released!

sudo gem install image_science

http://rubyforge.org/projects/seattlerb

ImageScience is a clean and happy Ruby library that generates thumbnails -- and kicks the living crap out of RMagick. Oh, and it doesn't leak memory like a sieve. :) For more information including build steps, see http://seattlerb.rubyforge.org/

Changes:

1.1.0 / 2007-01-05

  • 3 major enhancements:
    • Added resize(width, height)
    • Added save(path)
    • All thumbnail and resize methods yield instead of saving directly.
  • 1 minor enhancement:
    • Will now try to use FreeImage from ports if /opt/local exists.
  • 2 bug fixes:
    • Fixed the linker issue on PPC.
    • Rakefile will now clean the image files created by bench.rb

http://rubyforge.org/projects/seattlerb

been quiet lately

| | Comments (0)

I've been quiet lately, both bloggy and email (sorry if I haven't gotten back to you!). I think I'm hitting information overload and my brain is pushing back. That said, I'm going to try to actively fix this. I have a bunch of stuff to release and even more stuff sitting around that could be blog-fodder. Hopefully from here on I'll be publishing daily at least until I'm through my current blog-fodder queue and the releases...

2006 in Review

| | Comments (1)

As I semi-jokingly stated for _why's Year in Review, 2006 for me could best be summed up by: "release lecture release consult release overwhelmed release conference release".