Skip to content

howto-ruby/rubygems-style-guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 

Repository files navigation

The RubyGems Development Style Guide

So, you're writing a RubyGem. Wouldn't it be great if there were a place you could reference which contains all the shared wisdom and experience of gem authors and maintainers? Well, here you are.

What is this?

A set of community-driven set of best practices, conventions, and gotchas for gem authors and maintainers. It is meant to augment and supplement the RubyGems Guides, and perhaps serve as a sounding-board for ideas before they go into the Guide.

Inspired by Bozhidar's Ruby Style Guide

Translations of the guide are available in the following languages:

Table of Contents

Source Code Layout

  • top-level directories:
    • app
    • bin
    • cert
    • checksum
    • config
    • doc
    • ext
    • features
    • lib
    • spec
    • tasks
    • templates
    • test
    • tmp
    • vendor
  • what goes in lib?
  • what directories are under lib?
  • top-level files:
    • README.md
    • CHANGELOG.md
    • DEVELOPERS.md
    • TODO.md
    • LICENSE
    • AUTHORS
    • gemspec
    • Gemfile
    • dotfile opts

Naming

  • foo-bar -> foo/bar
  • foo_bar -> foo_bar

Gemspec

  • files to specify
  • specifying included files
  • post_install
  • security

Platform

Documentation

  • What it is
  • Basic Usage
  • Examples of more usage
  • How to develop
  • Communication: bugs, questions, code
  • Version control policies

Tests

  • How to run

Configuration

  • Specifying an interface for users to configure your gem
    • as a library
    • as a command-line tool

Dependency Management

  • Runtime dependencies
    • hard, at install
    • soft, e.g. platform issues
  • Development dependencies
    • required to run tests vs. used in development

Exceptions

  • What exceptions can the lib raise?
  • How are they handled within the lib?

Extensions

  • how to extend or change functionality
  • how it loads plugins, how to configure
  • hooks

RubyGems Extensions

  • rubygems_plugin

Handling IO

  • logging
  • stdout, stdin, stderr
  • warnings

Maintenance

  • security
  • deprecations
  • semver
  • issue tracking
  • communication
  • abandoning

Misc

Tools

  • git
  • bundler
  • gli
  • irc
  • mailing lists
    • rubygems-developers
  • rake
  • homebrew

External Resources

Contributing

  • Fork this repo, checkout a branch, commit changes, submit a pull request
  • Tweet @hazula

License

Creative Commons License This work is licensed under a Creative Commons Attribution 3.0 Unported License

Spread the Word

  • This is very alpha. Any help or thoughts are appreciated.

About

A (very pre-alpha) Rubygems development style guide

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published