1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Push through rack dep into the wild puma

This commit is contained in:
Evan Phoenix 2014-03-03 11:13:29 -08:00
parent dd8dd5a520
commit e5787e35ed
2 changed files with 26 additions and 2 deletions

17
bin/puma-wild Normal file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env ruby
#
# Copyright (c) 2014 Evan Phoenix
#
require 'rubygems'
deps = ARGV.shift.split(",").each do |s|
name, ver = s.split(":",2)
gem name, ver
end
require 'puma/cli'
cli = Puma::CLI.new ARGV
cli.run

View file

@ -456,13 +456,20 @@ module Puma
end
if prune_bundler? && defined?(Bundler)
puma_lib_dir = $:.detect { |d| File.exist? File.join(d, "puma", "const.rb") }
puma = Bundler.rubygems.loaded_specs("puma")
puma_lib_dir = File.join(puma.full_gem_path, puma.require_paths.first)
deps = puma.runtime_dependencies.map { |d|
spec = Bundler.rubygems.loaded_specs(d.name)
"#{d.name}:#{spec.version.to_s}"
}.join(",")
if puma_lib_dir
log "* Pruning Bundler environment"
Bundler.with_clean_env do
Kernel.exec(Gem.ruby, "-I", puma_lib_dir,
File.expand_path(puma_lib_dir + "/../bin/puma"),
File.expand_path(puma_lib_dir + "/../bin/puma-wild"),
deps,
*@original_argv)
end
end