davetron5000 / optparse-plus

Start your command line scripts off right in Ruby
http://davetron5000.github.com/optparse-plus
Apache License 2.0
521 stars 54 forks source link

methadone generates binaries in 'bin' but sets bindir='exe' in gemspec #129

Closed corprew closed 3 years ago

corprew commented 5 years ago

methadone generates executable files in the 'bin' directory, but sets 'bindir' to 'exe' in gemspec

codex:~ corprew$ gem update methadone
Updating installed gems
Nothing to update
codex:~ corprew$ methadone bees
warning: your app has no license
rm -f README.md
codex:~ corprew$ cd bees
codex:bees corprew$ more bees.gemspec

file contains

  spec.bindir        = "exe"
  spec.executables   = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
  spec.require_paths = ["lib"]

but the proper bin directory is 'bin':

:bees corprew$ ls
CODE_OF_CONDUCT.md  Rakefile        lib
Gemfile         bees.gemspec        test
README.rdoc     bin

A gem generated like this doesn't identify its executable files to gemspec and therefore can't identify its "binaries" when it comes time to make binstubs. If you change 'exe' to 'bin' in the directories, the binstubs are properly generated.

corprew commented 5 years ago

Couldn't easily find where this was coming from, so couldn't generate a pull request, figured I'd let you know. Thanks for this and gli.

davetron5000 commented 5 years ago

D'oh. I think this is because at some point Bundler decided that exe is the proper bin dir, and Methadone uses bunder to bootstrap its gemspec.

I think moving methadone to use exe is probably the right thing, since that's where things are in the rest of the Ruby Ecosystem. I think this is where that happens (copy_file maintains the relative subdir, so I think it's as 'simple' as moving bin/executable to exe/executable and updating the integration tests).

corprew commented 5 years ago

Cool, there are some other pieces and the tests aren't currently passing for a couple of other reasons I think also related to bundler generation of the gemspec. I'll give this a shot when I have more time in a week or two.

davetron5000 commented 3 years ago

Closing in favor of #137 that captures the poor state of the scaffold