OSDN Git Service

Regular updates
[twpd/master.git] / rubygems.md
1 ---
2 title: Rubygems
3 category: Ruby
4 layout: 2017/sheet
5 intro: |
6   A quick reference to common [rubygems](https://rubygems.org) CLI commands.
7 ---
8
9 ### Building and publishing
10
11 ```sh
12 gem build *.gemspec         # Build a gem
13 gem install *.gem           # Install locally
14 gem push *.gem              # Upload to rubygems.org
15 gem yank foogem -v 0.0.1    # Take it back
16 ```
17
18 ### Querying
19
20 ```sh
21 gem owner foogem -a rico@ricostacruz.com
22
23 gem list                    # List local gems
24 gem which rake              # Point to where lib/rake.rb is
25 gem search -r rails         # [remote] Search for gems
26 ```
27
28 ### Opening a gem
29
30 ```sh
31 # https://github.com/fnando/gem-open
32 gem open foogem
33 GEM_EDITOR="vim" gem open foogem
34 ```
35
36 ### Changing to a directory
37
38 ```sh
39 cd $(basename `gem which rake`)  # Go to a gem's path
40 ```