marnen / middleman-breadcrumbs

Breadcrumbs helper for Middleman (http://www.middlemanapp.com)
MIT License
11 stars 12 forks source link

Do not include any executable since provided binaries are only for development #3

Closed alsemyonov closed 9 years ago

alsemyonov commented 9 years ago

After installing middleman-breadcrumbs gem there are two executables installed, that uses common names (setup and console) and could potentially break anything in the system.

setup:

#!/Users/alsemyonov/.rbenv/versions/2.2.3/bin/ruby
#
# This file was generated by RubyGems.
#
# The application 'middleman-breadcrumbs' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0"

if ARGV.first
  str = ARGV.first
  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
    version = $1
    ARGV.shift
  end
end

gem 'middleman-breadcrumbs', version
load Gem.bin_path('middleman-breadcrumbs', 'setup', version)

console:

#!/Users/alsemyonov/.rbenv/versions/2.2.3/bin/ruby
#
# This file was generated by RubyGems.
#
# The application 'middleman-breadcrumbs' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0"

if ARGV.first
  str = ARGV.first
  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
    version = $1
    ARGV.shift
  end
end

gem 'middleman-breadcrumbs', version
load Gem.bin_path('middleman-breadcrumbs', 'console', version)

In reality they are not needed for middleman-breadcrumbs used in production, these scripts are only for development.

marnen commented 9 years ago

These executables shouldn't have existed in the first place. I'll certainly take a look at this pull request!

alsemyonov commented 9 years ago

@marnen, you could just install original version of the gem and check for executables (there will be both of them). Then uninstall it and try to install gem from my fork — there should not be any executable for middleman-rbeadcrumbs. I have just tried it and made this pull request and another one for thoughtbot/factory_girl_rails#176 that have the similar issue with bin/setup script.

marnen commented 9 years ago

That's basically what I was going to do.

marnen commented 9 years ago

I've been busy with moving house for the last week or so. I will get to this as soon as possible.