must_be and dynamic_variable Ruby Gems

I’ve jeweled my first public RubyGems. must_be provides runtime assertions library with RSpec inspired thoroughness. dynamic_variable lets you use dynamically scoped variables for context specific calculations.

Jeweler made the process positively pleasant. Allow me to share a few lessons with you in the hopes that your gem crafting experience will be even more smooth than mine.

Jeweler makes it easy to coordinate GitHub and RubyGems.

  • For GitHub, use a README.md or README.markdown to have a nicely Markdown formatted introduction.
  • Jeweler generates a VERSION file to keep track of the version of your gem. The file just contains the version number followed by a newline. Jeweler provides several Rake tasks for managing the version: version, version:bump:major, version:bump:minor, version:bump:patch, version:write. When you bump the version, Jeweler automatically commits the version and tags it for you.
  • Remember the Jeweler::GemcutterTasks.new line to enable Jeweler to release your gems.
  • .gitignore should not ignore .gemspec files.
  • When you try to pull from your GitHub repository, git may complain that you, “you asked me to pull without telling me which branch you want to merge with”. The easy way to tell git is to edit your .git/config as follows

I hope those hints help you on your way.