Is there like an established way of distributing non-ruby scripts with rubygems? -


if add bash script executable in gem, installing gem causes executable wrapped in like:

#!/usr/bin/env ruby_executable_hooks # # file generated rubygems. # # application 'my_bash_script' installed part of gem, , # file here facilitate running it. #  require 'rubygems'  version = ">= 0.a"  if argv.first   str = argv.first   str = str.dup.force_encoding("binary") if str.respond_to? :force_encoding   if str =~ /\a_(.*)_\z/ , gem::version.correct?($1)     version = $1     argv.shift   end end  gem 'my_bash_script', version load gem.bin_path('my_bash_script', 'my_bash_script', version) 

this makes dysfunctional because ruby interpreter doesn't speak bash.

what's way of dealing this? can turn wrapping off (preferable, bash starts 12 times faster yarv ruby interpreter), or need wrap bash in ruby in order generated load wrapper happy?

i found following answer in 1 of rubygem repo's ticket discussions.

i don't know of way works across platforms , makes sense. rubygems ruby. if file in gem's bindir , listed gem executable, should ruby. if gem has "special needs" should out of band, create rakefile special steps , list rakefile extension in spec. or use post-install message telling people install --no-wrapper.

also found following comment in rubygems specification documentation.

# # example, rake gem has rake executable. don’t specify # full path (as in bin/rake); application-style files expected - # found in bindir. + # found in bindir. these files must executable ruby files. files + # use bash or other interpreters not work. #

hope information helps.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -