Last active
March 22, 2021 20:31
-
-
Save jmmastey/2c463816f0276c45ece7239ba8a3a5db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add these to your ~/.zshrc to expose them in any console. Both commands use the same | |
# general API. Navigate to a project that has a Gemfile (prolly mealhand), and run the command. It'll grab | |
# the correct version of the gem automatically! | |
# navigates your shell to the ~/.gem/ruby-2.6.1/whatever path where the gem lives | |
function bcd() { cd $(bundle info "$@" | grep -e "Path: [^\S]*" | sed -e 's/^[^/]*//') ;} | |
# opens up the "homepage" for the gem in your browser. typically github | |
function bweb() { | |
curl https://rubygems.org/api/v1/gems/"$@".json 2>/dev/null > /tmp/bweb | |
url=`jq -r '.source_code_uri // .homepage_uri' /tmp/bweb` | |
open $url | |
;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment