Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.

Commit 5f7acac

Browse files
author
Joshua Timberman
committed
Merge pull request #31 from lamont-granquist/COOK-3219
COOK-3219: Using omnibus bundler for your app is bad
2 parents c0e52d8 + a213237 commit 5f7acac

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

providers/rails.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,16 @@
3030
new_resource.migration_command command
3131
end
3232

33-
new_resource.environment.update({
33+
new_resource.environment.merge!({
3434
"RAILS_ENV" => new_resource.environment_name,
35-
"PATH" => [Gem.default_bindir, ENV['PATH']].join(':')
36-
})
35+
}) { |k, v1, v2| v1 } # user's environment settings will override
36+
37+
if new_resource.use_omnibus_ruby
38+
Chef::Log.warn("Tying your Application to the Chef Omnibus Ruby is not recommended.")
39+
new_resource.environment.merge!({
40+
"PATH" => [Gem.default_bindir, ENV['PATH']].join(':')
41+
}) { |k, v1, v2| v1 } # user's environment settings will override
42+
end
3743

3844
new_resource.symlink_before_migrate.update({
3945
"database.yml" => "config/database.yml"

resources/rails.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
attribute :bundler_without_groups, :kind_of => [Array], :default => []
3030
attribute :bundle_command, :kind_of => [String, NilClass], :default => "bundle"
3131
attribute :precompile_assets, :kind_of => [NilClass, TrueClass, FalseClass], :default => nil
32+
attribute :use_omnibus_ruby, :kind_of => [TrueClass, FalseClass], :default => true
3233

3334
def database(*args, &block)
3435
@database ||= Mash.new

0 commit comments

Comments
 (0)