I want to download the code for a gem, but the author didn't give a link to a Github repository (or anything else) to download it from directly. For now, did gem install
and copied the directory under "ruby/gems/...", where the source is located. Is there an easier way of doing this (a one-liner)?
You can gem unpack gem_name
, which will unpack the gem in the current working directory. If it is already installed the local version will be used, otherwise it will be fetched first:
→ gem unpack datamapper
Fetching: datamapper-1.2.0.gem (100%)
Unpacked gem: '/Users/michi/datamapper-1.2.0'
You can use gem-open, a gem that once installed you can use to open gems in your editor: https://github.com/fnando/gem-open