I found the below given statement in boot.rb file inside the root folder of my Rails Application.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
Can anyone help me to understand the usage of ENV['BUNDLE_GEMFILE'] and ||= in this context?
Thank you.
ENVis a hash.BUNDLE_GEMFILEis an item in that hash.||=known as “or equals” operator, what it does is checks ifENV['BUNDLE_GEMFILE']is set, if it is, then it takes the same. But if it isn’t, then it assigns whatever the functionFile.expand_path()returns toENV['BUNDLE_GEMFILE'].