mirror of
				https://gitea.invidious.io/iv-org/shard-ameba.git
				synced 2024-08-15 00:53:29 +00:00 
			
		
		
		
	Make sure we only return files from GlobUtils#expand method
				
					
				
			This commit is contained in:
		
							parent
							
								
									e6a5fa9d71
								
							
						
					
					
						commit
						5403aee899
					
				
					 1 changed files with 7 additions and 4 deletions
				
			
		|  | @ -20,10 +20,13 @@ module Ameba | ||||||
|     # expand(["spec/*.cr", "src"]) # => all files in src folder + first level specs |     # expand(["spec/*.cr", "src"]) # => all files in src folder + first level specs | ||||||
|     # ``` |     # ``` | ||||||
|     def expand(globs) |     def expand(globs) | ||||||
|       globs.flat_map do |glob| |       globs | ||||||
|  |         .flat_map do |glob| | ||||||
|           glob += "/**/*.cr" if File.directory?(glob) |           glob += "/**/*.cr" if File.directory?(glob) | ||||||
|           Dir[glob] |           Dir[glob] | ||||||
|       end.uniq! |         end | ||||||
|  |         .uniq! | ||||||
|  |         .select! { |path| File.file?(path) } | ||||||
|     end |     end | ||||||
| 
 | 
 | ||||||
|     private def rejected_globs(globs) |     private def rejected_globs(globs) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue