Topic: Check if a module is included?
I am writing a piece of code that needs to check if Rails.cache is available. This is because the code could be run in a Rails and Non-rails environment and must do a few things differently if that is the case.
1. I thought I would be able to do something Kernel.const_defined?("Rails") but that doesn't work. How would you go about checking if a module is available?
2. Also if there is a better way to see if I am running in a rails environment I would love to know how.