As explained here pry's plugin require pry- prefix. I have tried building using bundler:
bundle gem pry-name
but it messed up directory hierarchies(creating 2 instead of 1 directory):
create pry-name/pry-name.gemspec
create pry-name/lib/pry/name.rb
create pry-name/lib/pry/name/version.rb
In the gemspec it is using wrong directory structure:
require 'pry/name/version'
and in the same file it run this git command:
spec.files = `git ls-files`.split($/)
which gives, same as above, wrong structure of files
Is there way to tell bundler to recognize "-" as valid filename character not as "/"(directory separator)?
bundle gem
works according to the Rubygems convention for naming gems, as described at http://guides.rubygems.org/name-your-gem/Note that if you include
gem 'pry-name'
in theGemfile
of a project that usesBundler.require
, it will use the convention there by default, too, and try torequire 'pry/name'
.The best workaround is to create a
lib/pry-name.rb
file that just containsrequire 'pry/name'
. This keeps your directory structure consistent with the Rubygems & Bundler convention, allowingrequire 'pry/name'
to work, while also allowingrequire 'pry-name'
to work.