This application is a example about how to create a gem on Ruby, the repo contains the example and the readme file the steps to create it. A ruby gem is a library to add some functionality to the ruby language.
- Make sure you have installed the ruby language.
- Make sure you have installed the bundler gem. (gem install bundler)
- Make sure to have a rubygems account
bundle gem <name>
(To add more functionalities, check the bundle gem documentation)cd <name>
bundle install
- Make changes on
lib/<name>.rb
- Once you made changes, you can change the version on
lib/<name>/version.rb
- To add test, add the test file on
spec/spec_<name>.rb
gem build <name>.gemspec
(on this part, you could have some warnings on<name>.gemspec
, just solve them all)
- Test the gem installing on your ruby local system, using
gem install <name>-<version>.gem
- Once the local gem is installes, open an
irb
session and test the gem, usingrequire '<name>'
- If you want to use the test files, use
rspec spec
on the command line
gem push <name>-<version>.gem
- Open the page and check if the gem is published
- To install the remote gem, first we need to uninstall the actual gem using
gem uninstall <name>
- On command line, go to root and use
gem install <name>
👤 Victor Pacheco
Contributions, issues and feature requests are welcome!
Give a ⭐️ if you like this project!
Thanks to Drifting Ruby for the video about Ruby gems
This project is MIT licensed.