Created
October 6, 2017 15:03
-
-
Save ZempTime/492ad98ea3ce957de553010b8d58f097 to your computer and use it in GitHub Desktop.
Building out index.js files throughout app
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
require "pathname" | |
IGNORED_FILES = ['.DS_Store'] | |
def recurse(directory) | |
current_dir = Pathname.new(directory) | |
populate_index(current_dir) | |
current_dir.children.each do |dir| | |
recurse(dir) if dir.directory? | |
end | |
end | |
def populate_index(directory) | |
# When opening a file for writing, i.e. using the "w" option, all previous contents of the file will be removed | |
# write to index.js in current dir | |
# get all children | |
# build require statements | |
end | |
#recurse('./app/angular') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment