Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Gemcutting 101

Gemcutting 101

An overview of the steps to making and publishing your own Ruby gem

tdumitrescu

January 14, 2014
Tweet

Other Decks in Programming

Transcript

  1. carvin’ it out: basics of gemcutting ted dumitrescu signal creative

    [email protected] http://cmme.org/tdumitrescu http://github.com/tdumitrescu http://signalcreative.co
  2. extracting ¡ write the code before making the gem sample repo:

    https://github.com/tdumitrescu/gemex ¡ bootstrap the project: http://bundler.io/v1.5/bundle_gem.html bundle gem old_yeller ¡ edit gemspec ¡ code in lib/ ted dumitrescu: basics of gemcutting | http://cmme.org/tdumitrescu
  3. testing ¡ automated testing! ¡ with rspec: .gemspec: spec.add_development_dependency "rspec", "~> 2.14"


    bundle
 bundle exec rspec --init
 spec/old_yeller_spec.rb bundle exec rspec" ¡ manual testing: loading local gems Gemfile: gem "old_yeller", path: [path to gem] ted dumitrescu: basics of gemcutting | http://cmme.org/tdumitrescu
  4. publishing ¡ on rubygems: http://guides.rubygems.org/make-your-own-gem/ ¡ build gem locally: gem build old_yeller.gemspec"

    ¡ push to rubygems: gem push old_yeller-0.0.1.gem ¡ don’t forget to publish the code (try Github!) ted dumitrescu: basics of gemcutting | http://cmme.org/tdumitrescu
  5. some further topics ¡ versioning ¡ configuration patterns ¡ using datastores and complex

    services ¡ integration with Rails (engines) ¡ personal examples: https://github.com/tdumitrescu/feature_guard https://github.com/lumoslabs/scripterator ted dumitrescu: basics of gemcutting | http://cmme.org/tdumitrescu