Module: ModOrganizer::Utils
- Included in:
- ModOrganizer, Mod
- Defined in:
- lib/mod_organizer/utils.rb
Overview
Module giving some helpers to various ModOrganizer classes
Instance Method Summary collapse
-
#files_glob(glob) ⇒ Object
Return all files matching a glob.
Instance Method Details
#files_glob(glob) ⇒ Object
Return all files matching a glob. Handle special characters correctly. Don’t return . and ..
- Parameters
-
glob (String): The glob
- Result
-
Array<String>: The list of files matching the glob
14 15 16 17 18 19 |
# File 'lib/mod_organizer/utils.rb', line 14 def files_glob(glob) Dir.glob(glob.gsub('[', '\\[').gsub(']', '\\]'), File::FNM_DOTMATCH).select do |file| basename = File.basename(file) basename != '.' && basename != '..' end end |