How do I write an extension for Sinatra without packaging it like a gem?

I want to include distance_of_time_in_words method in sinatra application

I don't want to package and distribute the gem and this is what you need to do for the Sintra docs. I just want this method to be available in my opinion.

What's the easiest way to do this? Thanks.

+2


a source to share


2 answers


At http://www.sinatrarb.com/intro.html, review the Helpers section and define helper methods for use in route handlers and templates



+4


a source


Just put the file somewhere in your ruby ​​( $LOAD_PATH

) load path and require it. Or put the code directly into your application file.



0


a source







All Articles