Skip to content

Commit

Permalink
Fix typos and extraneous checks and rescues
Browse files Browse the repository at this point in the history
  • Loading branch information
daveallie committed Jun 27, 2019
1 parent f864b23 commit 9f79234
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/config.rb
Expand Up @@ -160,7 +160,7 @@

# prune_bundler

# Extra gems to be loaded when the environment bundler context is pruned.
# Extra gems to be loaded when the bundler context is pruned.
# Only applies if prune_bundler is used.

# extra_runtime_dependencies ['gem_name_1', 'gem_name_2']
Expand Down
4 changes: 2 additions & 2 deletions lib/puma/dsl.rb
Expand Up @@ -462,8 +462,8 @@ def raise_exception_on_sigterm(answer=true)
# When using prune_bundler, if extra runtime dependencies need to be loaded to
# initialize your app, then this setting can be used.
#
# For each gem's name passed, that gem will be loaded when the environment
# is pruned.
# Before bundler is pruned, the gem names supplied will be looked up in the bundler
# context and then loaded again after bundler is pruned.
def extra_runtime_dependencies(answer = [])
@options[:extra_runtime_dependencies] = Array(answer)
end
Expand Down
14 changes: 6 additions & 8 deletions lib/puma/launcher.rb
Expand Up @@ -273,14 +273,12 @@ def prune_bundler
"#{d.name}:#{spec.version.to_s}"
end

if @options[:extra_runtime_dependencies]
@options[:extra_runtime_dependencies].each do |d_name|
spec = Bundler.rubygems.loaded_specs(d_name) rescue nil
if spec
dirs += spec.require_paths.map { |x| File.join(spec.full_gem_path, x) }
else
log "* Couldn't to load extra dependency: #{d_name}"
end
@options[:extra_runtime_dependencies].each do |d_name|
spec = Bundler.rubygems.loaded_specs(d_name)
if spec
dirs += spec.require_paths.map { |x| File.join(spec.full_gem_path, x) }
else
log "* Could not load extra dependency: #{d_name}"
end
end

Expand Down

0 comments on commit 9f79234

Please sign in to comment.