Class: DiffDirs
- Inherits:
-
Object
- Object
- DiffDirs
- Defined in:
- lib/diff_dirs.rb
Class Method Summary collapse
Class Method Details
.diff_dirs(dir1, dir2) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/diff_dirs.rb', line 2 def self.diff_dirs(dir1, dir2) raise(ArgumentError, "Directories must be strings.") unless dir1.is_a?(String) && dir2.is_a?(String) dir1 = (dir1) dir2 = (dir2) cmd = "diff -qr #{dir1} #{dir2}" diff_result = execute(cmd) out = [] diff_result.each_line do |line| line.chomp! out << diff_result_line_parse(dir1, dir2, line) end out end |