"ruby_block" is a Chef resource that allows you to execute your favorite ruby code as a separate resource.

You can always drop to regular, plain Ruby, anywhere you like.