Isaac Sloan - Modern Gem Crafting in Ruby
Banner700

Modern Gem Crafting in Ruby

Here is the most modern approach to gem crafting with Bundler:

bundle gem your_gem
cd your_gem

edit your_gem.gemspec and add description, summary and optional website. Add required gems such as rspec to the Gemfile.

rspec --init 
touch spec/your_gem_spec.rb

Write good tests. Add your code to lib/your_gem.rb. When you're finished its time to build and push to rubygems.org:

gem build your_gem.gemspec
gem push your_gem-0.0.1.gem

And thats it. Next time you make a change be sure to change the version number in version.rb.

May 25, 2013
rubyrailsgem
comments powered by Disqus