Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions providers/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@
new_resource.migration_command command
end

new_resource.environment.update({
new_resource.environment.merge!({
"RAILS_ENV" => new_resource.environment_name,
"PATH" => [Gem.default_bindir, ENV['PATH']].join(':')
})
}) { |k, v1, v2| v1 } # user's environment settings will override

if new_resource.use_omnibus_ruby
Chef::Log.warn("Tying your Application to the Chef Omnibus Ruby is not recommended.")
new_resource.environment.merge!({
"PATH" => [Gem.default_bindir, ENV['PATH']].join(':')
}) { |k, v1, v2| v1 } # user's environment settings will override
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems these could be named with more clarity.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this sets PATH to Gem.default_bindir and then the existing PATH, unless the user specifies a PATH.

end

new_resource.symlink_before_migrate.update({
"database.yml" => "config/database.yml"
Expand Down
1 change: 1 addition & 0 deletions resources/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
attribute :bundler_without_groups, :kind_of => [Array], :default => []
attribute :bundle_command, :kind_of => [String, NilClass], :default => "bundle"
attribute :precompile_assets, :kind_of => [NilClass, TrueClass, FalseClass], :default => nil
attribute :use_omnibus_ruby, :kind_of => [TrueClass, FalseClass], :default => true

def database(*args, &block)
@database ||= Mash.new
Expand Down