Sha256: b97a863ab416a02da02a8088ead21a96fd4bfaae51457b47cb36c18989459ed1
Contents?: true
Size: 827 Bytes
Versions: 15
Compression:
Stored size: 827 Bytes
Contents
module Padrino ## # Replaces the current process with it's binstub. # def self.replace_with_binstub(executable) begin return if Bundler.definition.missing_specs.empty? rescue NameError, NoMethodError, Bundler::GemfileNotFound end project_root = Dir.pwd until project_root.empty? break if File.file?(File.join(project_root, 'Gemfile')) project_root = project_root.rpartition('/').first end if %w(Gemfile .components).all? { |file| File.file?(File.join(project_root, file)) } binstub = File.join(project_root, 'bin', executable) if File.file?(binstub) exec Gem.ruby, binstub, *ARGV else puts 'Please run `bundler install --binstubs` from your project root to generate bundle-specific executables' exit! end end end end
Version data entries
15 entries across 15 versions & 1 rubygems