Created
May 22, 2020 21:01
-
-
Save BrennickL/0b0ee8f78a0f8ca53194e62b1c77b132 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env ruby | |
require "bundler/setup" | |
require "elevator" | |
require "pry" | |
def reload!(print = true) | |
puts 'Reloading ...' if print | |
# Main project directory. | |
root_dir = File.expand_path('..', __dir__) | |
# Directories within the project that should be reloaded. | |
reload_dirs = %w{lib} | |
# 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 | |
# You can add fixtures and/or initialization code here to make experimenting | |
# with your gem easier. You can also use a different console, if you like. | |
# (If you use this, don't forget to add pry to your Gemfile!) | |
Pry.start | |
require "irb" | |
IRB.start(__FILE__) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment