Skip to content

A working Ruby gem that has all the required information (builds without warnings)

License

Notifications You must be signed in to change notification settings

vassilevsky/minimum-viable-ruby-gem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minimum viable Ruby gem

A working Ruby gem that has all the required information (builds without warnings).

Why

Many people who program in Ruby are afraid to make gems because they think that this is complex.

When they run bundle gem to create a gem template, the generated template is quite complex.

This project shows that a Ruby gem is a simple thing.

How it works

RubyGems has nice guides on how to build gems. Start with this one:

https://guides.rubygems.org/make-your-own-gem/

You don't have to use Bundler to build gems. You can write a gemspec and build it by hand.

An excellent, in-depth article about writing gem specification by hand:

https://piotrmurach.com/articles/writing-a-ruby-gem-specification/

Testing

rspec

Building

gem build thing.gemspec

Usage

require 'thing'

thing = Thing.new
thing.size

Disadvantages

  • No single command (bundle exec rake release) that would do all this:
    • Add a tag with version to the Git repository
    • Push it (and commits as well) to the remote repository
    • Build the gem
    • Push it to RubyGems

Contributing

Please send me a pull request if you can remove something and make the gem even smaller :) Preferably it should still build and work without warnings.

About

A working Ruby gem that has all the required information (builds without warnings)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages