简体   繁体   中英

Ruby on Rails, how to setup hot swap for lib folder?

My models are becoming bigger and bigger (fat model thin controller approach) so I am making more and more modules (eg /lib/user/*).

Problem is that they don't get re-deployed so each time I have to restart Webrick.

How to set "hot swap" for lib folder?

Thank you, and generally is that good practice since it is not enabled by default.

Use Guard and Guard-Rails . Guard allows watching of files/folders and taking actions. Guard-Rails will restart your rails server each time a particular file is changed. The default folders for Guard-Rails includes the lib folder (and subfolders).

You can find details for Guard on github .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM