Closed bkeepers closed 9 months ago
~How about moving all of the Rails integration to dotenv-rails instead?~
Oh, I see the integration was recently moved into dotenv on purpose.
Would it make sense to raise instead? When requiring this file, I expect it to work and warnings may or may not be seen. Rails itself for example raises when requiring files that require dependencies that are missing/not satisfied.
https://github.com/rails/rails/blob/9aeb1de2455e2988a90a49f73f87b60a58bcd173/activesupport/lib/active_support/cache/redis_cache_store.rb#L3-L11 https://github.com/rails/rails/blob/9aeb1de2455e2988a90a49f73f87b60a58bcd173/activesupport/lib/active_support/message_pack.rb#L3-L11
@Earlopain I debated about that. I decided not to because of all the unpredicable ways people use dotenv (like in another gem that still has Rails <6.1 in their build matrix). I would really prefer to raise, but I feel uneasy about it. 🤔
This adds a manual check for the Rails version before loading the railtie.
Fixes #480