Skip to content

Instantly share code, notes, and snippets.

@hassox
Created November 9, 2009 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hassox/229789 to your computer and use it in GitHub Desktop.
Save hassox/229789 to your computer and use it in GitHub Desktop.
##### PATH MANAGEMENT
MyStack.push_paths :my_file_group, ["relative/path1", "relative/path2"], "**/*.rb"
MyStack.push_paths :my_file_group, "relative/path3"
MyStack.dirs_for :my_file_group #=> MyStack.roots * [relative/path1, relative/path2, relative/path3]
MyStack.dirs_and_glob_for :my_file_group #=> MyStack.roots * [relative/path1, **/*.rb]
#=> MyStack.roots * [relative/path2, **/*.rb]
#=> MyStack.roots * [relative/path3, nil]
MyStack.paths_for(:my_file_group) # list of all files that match all roots * relative_paths * globs
MyStack.unique_paths_for(:my_file_group) # like paths_for but will unique the files taking the last declared
MyStack.unique_paths_for(:my_file_group, :invert => true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment