Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional arguments for Dir.glob and FileUtils.cp_r #182

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/fakefs/dir.rb
Expand Up @@ -90,7 +90,7 @@ def self.foreach(dirname, &block)
Dir.open(dirname) { |file| yield file }
end

def self.glob(pattern, &block)
def self.glob(pattern, flags = 0, &block)
matches_for_pattern = lambda do |matcher|
[FileSystem.find(matcher) || []].flatten.map{|e|
Dir.pwd.match(%r[\A/?\z]) || !e.to_s.match(%r[\A#{Dir.pwd}/?]) ? e.to_s : e.to_s.match(%r[\A#{Dir.pwd}/?]).post_match}.sort
Expand Down
2 changes: 1 addition & 1 deletion lib/fakefs/fileutils.rb
Expand Up @@ -81,7 +81,7 @@ def cp(src, dest)
end
end

def cp_r(src, dest)
def cp_r(src, dest, options = {})
Array(src).each do |src|
# This error sucks, but it conforms to the original Ruby
# method.
Expand Down