You can use bundle open gem to view the gem source

run bundle open <gem_name> to open the gem source in your $EDITOR

this opens only the files that the gem ships, i.e. the lib folder