1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2025-10-16 07:28:25 +02:00
cheatsheets/rubygems.md
Rico Sta. Cruz 511de900ba
Formatting updates (#2133)
- Update some sheets which have very long sections
- Remove `layout: 2017/sheet` (everything has the same layout now)
- Remove outdated sheets
2024-04-03 18:30:24 +11:00

787 B

title, category, intro
title category intro
Rubygems Ruby A quick reference to common [rubygems](https://rubygems.org) CLI commands.

Building and publishing

gem build *.gemspec         # Build a gem
gem install *.gem           # Install locally
gem push *.gem              # Upload to rubygems.org
gem yank foogem -v 0.0.1    # Take it back

Querying

gem owner foogem -a rico@ricostacruz.com

gem list                    # List local gems
gem which rake              # Point to where lib/rake.rb is
gem search -r rails         # [remote] Search for gems

Opening a gem

# https://github.com/fnando/gem-open
gem open foogem
GEM_EDITOR="vim" gem open foogem

Changing to a directory

cd $(basename `gem which rake`)  # Go to a gem's path