mgomes / api_auth

HMAC authentication for Rails and HTTP Clients
MIT License
480 stars 147 forks source link

only load railtie if rails is present #96

Closed leemhenson closed 8 years ago

leemhenson commented 8 years ago

Hi. I'm using api_auth in a rack/activerecord app, but I don't want to load any other bits of rails if at all possible. The api_auth/railtie forces a bunch of things to be loaded that I don't want. I think it's fair to skip all that if Rails isn't even defined. What do you think?

kjg commented 8 years ago

Yeah. Within the railtie we probably don't need to try to load bits or rails that aren't already loaded either. Would you mind making that change and then fixing the specs that test the tie to require the needed gems.

Thanks!

On February 3, 2016 at 4:40:48 PM, lee henson (notifications@github.com) wrote:

Hi. I'm using api_auth in a rack/activerecord app, but I don't want to load any other bits of rails if at all possible. The api_auth/railtie forces a bunch of things to be loaded that I don't want. I think it's fair

to skip all that if Rails isn't even defined. What do you think?

You can view, comment on, or merge this pull request online at:

https://github.com/mgomes/api_auth/pull/96 Commit Summary

  • only load railtie if rails is present

File Changes

Patch Links:

— Reply to this email directly or view it on GitHub https://github.com/mgomes/api_auth/pull/96.

leemhenson commented 8 years ago

Ok, railtie can be safely required because it itself doesn't now require any Rails components. The spec_helper now loads Rails et al before loading api_auth, which means railtie can hook into the appropriate classes.

kjg commented 8 years ago

Thanks so much!