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

Seven Habits of Highly Effective Gems

Mat Brown
November 15, 2015

Seven Habits of Highly Effective Gems

(From RubyConf 2015)

These days, publishing a Ruby Gem is incredibly easy—but publishing a good one isn’t. By following a few best practices when you release your code to the open source community, you can make your library stand out from the crowd. We’ll lay out some basic principles, touching on both code design and build tooling, that will have other programmers clamoring to use and contribute to your project, guaranteeing that you will become a code celebrity practically overnight.

Mat Brown

November 15, 2015
Tweet

Other Decks in Programming

Transcript

  1. Seven Habits 1. The Quick Start is the only thing

    that matters
 (other than these six other things) 2. There is no length limit on READMEs 3. Breaking changes are almost never worth it 4. Your users are probably still on Rails 3 5. One programmer’s abstraction is another’s prison 6. It’s easy to make it easy to run the test suite 7. Use robots, not conventions, to enforce consistent style
  2. • @abstract • @api • @!attribute • @deprecated • @example

    • @!method • @note • @option • @param • @private • @raise • @return • @since • @yield
  3. Vagrantfile Vagrant.configure("2") do |config|
 config.vm.box = "precise32"
 
 config.vm.provision :shell,

    inline: <<-SH
 apt-get install postgresql
 SH
 
 config.vm.network :forwarded_port,
 guest: 5432, host: 5432
 end
  4. • Style/BlockDelimiters • Style/CollectionMethods • Style/DotPosition • Style/HashSyntax • Style/SignalException

    • Style/StringLiterals • Lint/AssignmentInCondition • Lint/UnusedMethodArgument
  5. Seven Habits 1. The Quick Start is the only thing

    that matters
 (other than these six other things) 2. There is no length limit on READMEs 3. Breaking changes are almost never worth it 4. Your users are probably still on Rails 3 5. One programmer’s abstraction is another’s prison 6. It’s easy to make it easy to run the test suite 7. Use robots, not conventions, to enforce consistent style