src/lib/%app_name%.rb.tt in rgentpl-1.2.6 vs src/lib/%app_name%.rb.tt in rgentpl-2.0.0
- old
+ new
@@ -27,13 +27,11 @@
class << self
# Environment
#
# @return [String] the current environment
def env
- unless defined?(TEMPLATE_ENV)
- load File.expand_path('../../config/environment.rb', __FILE__)
- end
- TEMPLATE_ENV
+ load File.expand_path("../config/environment.rb", __dir__) unless ENV.include? "TEMPLATE_ENV"
+ ENV["TEMPLATE_ENV"]
end
# Logger
#
# @return [Logger] the logger