class ChefFS::FileSystem::PairLister
Attributes
a_root[R]
b_root[R]
pattern[R]
Public Class Methods
new(pattern, a_root, b_root)
click to toggle source
# File lib/chef_fs/file_system.rb, line 176 def initialize(pattern, a_root, b_root) @pattern = pattern @a_root = a_root @b_root = b_root end
Public Instance Methods
each() { |a, b| ... }
click to toggle source
# File lib/chef_fs/file_system.rb, line 186 def each # Make sure everything on the server is also on the filesystem, and diff found_paths = Set.new ChefFS::FileSystem.list(a_root, pattern).each do |a| found_paths << a.path b = ChefFS::FileSystem.resolve_path(b_root, a.path) yield [ a, b ] end # Check the outer regex pattern to see if it matches anything on the # filesystem that isn't on the server ChefFS::FileSystem.list(b_root, pattern).each do |b| if !found_paths.include?(b.path) a = ChefFS::FileSystem.resolve_path(a_root, b.path) yield [ a, b ] end end end