def check_initialized
return if !should_initialize? || initialized?
return if !config.fetch(:check_initialized, true)
if defined?(::Rails)
message = 'The Union Station hooks are not initialized. Please ensure ' \
'that you have an initializer file ' \
'`config/initializers/union_station.rb` in which you call ' \
"this:\n\n" \
" if defined?(UnionStationHooks)\n" \
" UnionStationHooks.initialize!\n" \
" end"
else
message = 'The Union Station hooks are not initialized. Please ensure ' \
'that the following code is called during application ' \
"startup:\n\n" \
" if defined?(UnionStationHooks)\n" \
" UnionStationHooks.initialize!\n" \
" end"
end
STDERR.puts(" *** WARNING: #{message}")
@@config[:initialize_from_check] = true
initialize!
report_internal_information('HOOKS_NOT_INITIALIZED', message)
end