lib/find_files.rb in markdown_exec-1.8.9 vs lib/find_files.rb in markdown_exec-2.0.0
- old
+ new
@@ -20,11 +20,11 @@
# Array<String>: A unique list of file paths that match the given pattern in the specified paths.
#
# Example:
# find_files('version.rb', ['lib/**', 'spec'])
# # This might return file paths like ['lib/markdown_exec/version.rb', 'spec/version_spec.rb'].
-def find_files(pattern, paths)
+def find_files(pattern, paths = ['', Dir.pwd])
matched_files = []
paths.each do |path_with_wildcard|
# Combine the path with the wildcard and the pattern
search_pattern = File.join(path_with_wildcard, pattern)
@@ -63,10 +63,9 @@
def test_find_files_with_recursion
# Test with recursive directories
expected_files = [
'lib/cli.rb',
'lib/colorize.rb',
- 'lib/dev/llm.rb',
'lib/dev/watchfile.sh',
'lib/markdown_exec.rb',
'lib/markdown_exec/version.rb'
]
result = find_files('*', ['lib/**'])