Skip to content

Updating The Gem

CoderDonohoe edited this page Dec 7, 2021 · 1 revision

If anyone ever needs to update the Ruby gem, I am following the official guidelines here: https://guides.rubygems.org/make-your-own-gem/

  1. Make your changes (to the code, or to the gemspec file to have the listing on the RubyGem page altered (https://rubygems.org/gems/urlbox))
  2. Update the version number in the gemspec file (https://github.com/urlbox/urlbox-ruby/blob/main/urlbox.gemspec#L6)
  3. Build the gem: gem build urlbox.gemspec
  4. To test any changes locally:

gem install ./urlbox-NEW_VERSION_NUMBER

irb

>> require urlbox

>> urlbox_client = Urlbox::Client.new(api_key: ...)

>> urlbox_client.get(...)

  1. Assuming you have set up RubyGems authentication

Download https://rubygems.org/api/v1/api_key.yaml

save it as "~/.gem/credentials", and run:

chmod 0600 ~/.gem/credentials )

...then you can just push the new version up to RubyGems: gem push urlbox-NEW_VERSION_NUMBER

  1. Make sure your code/gemspec changes are also pushed up to Github.
Clone this wiki locally