Class: S3diff::Comparator
- Inherits:
-
Object
- Object
- S3diff::Comparator
- Defined in:
- lib/s3diff/comparator.rb
Instance Method Summary collapse
- #diff ⇒ Object
-
#initialize(file1, file2, s3_options = {}) ⇒ Comparator
constructor
A new instance of Comparator.
- #same? ⇒ Boolean
- #same_etag? ⇒ Boolean
Constructor Details
#initialize(file1, file2, s3_options = {}) ⇒ Comparator
Returns a new instance of Comparator.
5 6 7 8 9 |
# File 'lib/s3diff/comparator.rb', line 5 def initialize(file1, file2, = {}) @s3_options = @file1 = file_object(file1) @file2 = file_object(file2) end |
Instance Method Details
#diff ⇒ Object
19 20 21 |
# File 'lib/s3diff/comparator.rb', line 19 def diff @diff ||= Diffy::Diff.new(@file1.path, @file2.path, source: "files") end |
#same? ⇒ Boolean
15 16 17 |
# File 'lib/s3diff/comparator.rb', line 15 def same? same_etag? || diff.to_s.empty? end |
#same_etag? ⇒ Boolean
11 12 13 |
# File 'lib/s3diff/comparator.rb', line 11 def same_etag? @file1.etag == @file2.etag end |