Created
August 27, 2023 11:40
-
-
Save cherryramatisdev/36675cc2e3795da22965978023f6dd23 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def reload!(print: true) | |
| puts 'Reloading ...' if print | |
| # Main project directory. | |
| root_dir = Dir.pwd | |
| # Directories within the project that should be reloaded. | |
| reload_dirs = %w[lib app] | |
| # Loop through and reload every file in all relevant project directories. | |
| reload_dirs.each do |dir| | |
| Dir.glob("#{root_dir}/#{dir}/**/*.rb").each { |f| load(f) } | |
| end | |
| # Return true when complete. | |
| true | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment