Determine if using Rails console or server when using Spring
Asked Answered
T

0

7

Is it possible to determine if you are in the context of a running Rails server or console in an initializer when Spring is used? I've seen similar questions that don't take Spring into account.

Triennial answered 22/8, 2016 at 14:18 Comment(3)
how about defined?(Rails) ?Tideway
I want to know if I'm in the context of a running server OR a console. I need to be able to distinguish between the two.Triennial
Try $PROGRAM_NAME.include? 'spring'.Cuttle

© 2022 - 2024 — McMap. All rights reserved.