• You know how to install a gem already.
• You probably have a ton of them installed.
• But have you ever thought of writing one?
• Isn't it time to share your own coding
brilliance with the Ruby community?
• But what are the steps for that?
3. Making a Gem
• Run and audit your tests
• Layout your ﬁles into the proper directories
• Create a manifest of ﬁles in the gem
• Create a Gem Speciﬁcation ﬁle
• Run gem build on your gem speciﬁcation
• Release the gem to your Rubyforge account
• Dump rdocs for your gem
• Upload to your website on Rubyforge
4. Fight Administrivia
• Those are a lot of manual steps there
• Worse still, you need to repeat them for
every gem you want to write
• Hoe can automate that administrivia for you
• More time for coding
• Faster releases
• Less mistakes
• More likely you'll actually write that gem
5. What Is Hoe?
• Very useful tool by Ryan Davis and Eric
Hodel of the Seattle Ruby Brigade.
• Hoe deﬁnes a set of useful rake tasks that
makes gem building simple.
• It also includes the sow script to create a
gem skeleton for you.
• Spade, trowel, shovel, plow, and till are all still
available for your naming needs.
6. Making Gems With Hoe
• gem install hoe ‐‐include‐dependencies
• Setup rubyforge gem
• sow your gem directory.
• Write your code and tests
• Use rake to test, build docs, release, etc.
• Think about the next gem you'll write
7. Amazon Hacks
• Introducing our contrived example...
• It's simple, but it's my ﬁrst gem.
• It's also my ﬁrst Hoe gem.
• So, what exactly does it do?
• Pardon me for a little self-promotion...
23. Don't Forget Testing
• rake audit - run ZenTest against your code
• rake multi - run tests against multiple versions
• rake test - run your tests
• rake test_deps - verify there are no hidden
dependencies in your tests
25. Further References
• A list of hoe‐built gems
• gem unpack any hoe-built gem and read
the code yourself
• and of course, rake ‐T in any hoe gem