Dr Nic

What’s a hoe?

The New Gem Generator rocks. Type newgem <gem_name> and you get all standard scaffolding for a gem. They look just like plugins, or vice versa. And the -b option bangs out new command line apps. Sweet.

It also generates a Rakefile for you filled with rakey goodness. You just need to setup a few values – author, description, etc – and then you can repackage your gem, install it, and upload it to Rubyforge as much as you like.

But on the other side of the InterWeb, there is a man intent on gifting your gems with more Rake commands than you could poke a stick at. Or a rake, perhaps. A man so over exposed to raw rakedness that it would be folly for the New Gem Generator to ignore his raked presence.

The man: Ryan Davis. The rakey loveliness: hoe.

So, you might ask: What’s a hoe?

To get the latest newgem and hoe do:

> gem install newgem \-\-include-dependencies

Simply, your new gems are now imbued with more Rake tasks than you could poke a hoe at. As of hoe-1.1.4, you get:

> rake -T
rake announce         # Generate email announcement file and post to rubyforge.
rake audit            # Run ZenTest against the package
rake check_manifest   # Verify the manifest
rake clean            # Remove any temporary products. / Clean up all the extras
rake clobber          # Remove any generated file.
rake clobber_docs     # Remove rdoc products
rake clobber_package  # Remove package products
rake debug_gem        # Show information about the gem.
rake default          # Run the default tasks
rake docs             # Build the docs HTML Files
rake email            # Generate email announcement file.
rake install          # Install the package. Uses PREFIX and RUBYLIB
rake install_gem      # Install the package as a gem
rake multi            # Run the test suite using multiruby
rake package          # Build all the packages
rake post_news        # Post announcement to rubyforge.
rake publish_docs     # Publish RDoc to RubyForge
rake redocs           # Force a rebuild of the RDOC files
rake release          # Package and upload the release to rubyforge.
rake repackage        # Force a rebuild of the package files
rake ridocs           # Generate ri locally for testing
rake test_deps        # Show which test files fail when run alone.
rake test             # Run the test suite. Use FILTER to add to the command line.
rake uninstall        # Uninstall the package.

Have things changed because of Hoe?

Yes, now pay attention.

Note, with support from hoe, when you add additional command line apps to your bin folder, you do not need to update your Rakefile. All files in bin are assumed to be executable apps. [1]

Additionally, the files you want bundled into the gem must now be added into the Manifest.txt file. Your initial Manifest file is generated for you, you need to update it for any additional files.

[1] The railties gem is an anti-example: its bin folder is filled with template executables; only the rails script is actually an executable (this is the script you use to create your initial rails application scaffolding; similar to the newgem executable for gems).

Related posts:

  1. Future proofing your Ruby code. Ruby 1.9.1 is coming. Bugger. I’m a Ruby monogamist. I use the Ruby...
  2. newgem 1.0.0 all thanks to Cucumber The New Gem Generator (newgem) was exciting, moderately revolutionary, and...
  3. Unit Testing iPhone apps with Ruby: rbiphonetest Everything to love about Ruby: the concise, powerful language;...
  4. Writing C extensions in RubyGems using newgem generators (plus a free TextMate bundle) Already know C extensions in RubyGems? Cool – then just...
  5. NewGem Generator – now with script/generate The New Gem Generator (0.13.0)’s newgem command now behaves like...

One Response to “What’s a hoe?”

  1. sockmonk says:

    The change in newgem seems great for creating a new rubyforge project, but what about the other target audience, those of us packaging gems for internal company use? Any chance of being able to generate plain old gems again?

    Or, maybe better, being able to specify the gem server, probably leaving rubyforge as the default?

    Thanks,

    Wes

Leave a Reply