Closed timurvafin closed 11 years ago
@fredwu it will be great to get some feedback )
Hi @timurvafin thank you so much for the PR with detailed explanation! :+1: Sorry I haven't been responsive on this project lately, I will go over it in the next few days.
Is this the same issue as #43?
@fredwu right #43 is the same issue and that PR could be ignored.
@fredwu,
The right way to define where we would like to use ApiTaster is to require it in the correct bundler group. For example we usually would like to use it in the development and staging environments in the Rails application.
So make sense to require like:
In the
config/routes.rb
better to checkApiTaster
constant definition instead of define tricky logic like thisBy default Rails loader requires everything from
app
directory. So in case we are in thetest
environment for example whenapi_taster
gem does not loaded we will getuninitialized constant ApiTaster
error for sure.And for sure it will be not cool to check
ApiTaster
constant definition in each file in theapp/api_tasters/
folder. Probably better to move api tasters fromapp/api_tasters
tolib/api_tasters
.So this change set implements two things:
ApiTaster.route_path
option introduced instead of hardcoded value in theRoute
classlib/api_tasters