MasoniteFramework / interfaces

Python Interface Implementation
3 stars 1 forks source link

Added detection of ENABLE_INTERFACES environment variable. #3

Closed psyonara closed 5 years ago

psyonara commented 5 years ago

Fixes: #2

This adds detection of the environment variable ENABLE_INTERFACES, for specifically turning the interface checks on and off. When the checks are enabled, it also detects whether this is being used within Masonite, and then makes the checks dependent on DEBUG as well, so that Masonite will, by default, not perform the checks when in production.

Please review this very critically; I'm not one to get offended. Thanks! :)

psyonara commented 5 years ago

@josephmancuso I added a method name check, and now the tests pass. Please take a look and let me know if that's ok. If it is, I still want to do some cleanup and refactoring. :)

josephmancuso commented 5 years ago

looks good to me. I actually really like what you did with that config and environment variables. I might use that code for Masonite's testcase class :)

josephmancuso commented 5 years ago

my code is a bit messy since I wasn't sure if it was even possible at the time so it was a lot of duck tape and messy code as you can see.

Not my favorite block of code 😅

psyonara commented 5 years ago

I could see you were experimenting and hadn't cleaned up yet. As we all do. :-) I'll just tidy up a bit - that's one of my favourite coding activities anyway.

psyonara commented 5 years ago

@josephmancuso Right, all ready for your final review. :-)

josephmancuso commented 5 years ago

looks great but I want to pull it in and do some more testing which i'll have to do tonight

psyonara commented 5 years ago

Cool cool, let me know if you find anything that needs fixing.