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.
Asked
Active
Viewed 664 times
7
-
how about `defined?(Rails)` ? – Kkulikovskis Aug 23 '16 at 10:40
-
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. – anthonator Aug 23 '16 at 14:27
-
2Try `$PROGRAM_NAME.include? 'spring'`. – Bruno Wego Feb 04 '17 at 15:43