Module: CmpFS::Compare::CmpFS_Compare_Methods
- Included in:
- CmpFS::Compare, CmpFS::Compare
- Defined in:
- lib/cmpfs/compare/api_2.rb,
lib/cmpfs/compare/api_1_9.rb
Instance Method Summary collapse
-
#compare_binary(lhs, rhs, options = {}) ⇒ Object
Compares two files/streams in a binary (exact) manner.
-
#compare_binary_files(lhs_path, rhs_path, options = {}) ⇒ Object
Compares two files, named by
lhs_pathandrhs_path, in a binary (exact) manner. -
#compare_binary_streams(lhs_stm, rhs_stm, options = {}) ⇒ Object
Compares two streams,
lhs_stmandrhs_stm, in a binary (exact) manner. -
#compare_text(lhs, rhs, options = {}) ⇒ Object
Compares two files/streams, named by
lhsandrhs, in a textual manner according to the givenoptions. -
#compare_text_files(lhs_path, rhs_path, options = {}) ⇒ Object
Compares two files, named by
lhs_pathandrhs_path, in a textual manner according to the givenoptions. -
#compare_text_streams(lhs_stm, rhs_stm, options = {}) ⇒ Object
Compares two streams, named by
lhs_stmandrhs_stm, in a textual manner according to the givenoptions.
Instance Method Details
#compare_binary(lhs, rhs, options = {}) ⇒ Object
Compares two files/streams in a binary (exact) manner
Signature
Return
true if the files/streams have exactly the same content; false otherwise.
37 38 39 40 |
# File 'lib/cmpfs/compare/api_2.rb', line 37 def compare_binary lhs, rhs, ** ::CmpFS::Compare::Binary::Internal_.compare_binary_ lhs, rhs, end |
#compare_binary_files(lhs_path, rhs_path, options = {}) ⇒ Object
Compares two files, named by lhs_path and rhs_path, in a binary (exact) manner
17 18 19 20 |
# File 'lib/cmpfs/compare/api_2.rb', line 17 def compare_binary_files lhs_path, rhs_path, ** ::CmpFS::Compare::Binary::Internal_.compare_binary_files_ lhs_path, rhs_path, end |
#compare_binary_streams(lhs_stm, rhs_stm, options = {}) ⇒ Object
Compares two streams, lhs_stm and rhs_stm, in a binary (exact) manner
24 25 26 27 |
# File 'lib/cmpfs/compare/api_2.rb', line 24 def compare_binary_streams lhs_stm, rhs_stm, ** ::CmpFS::Compare::Binary::Internal_.compare_binary_streams_ lhs_stm, rhs_stm, end |
#compare_text(lhs, rhs, options = {}) ⇒ Object
Compares two files/streams, named by lhs and rhs, in a textual manner according to the given options
Signature
-
Parameters:
lhs-
(String, stream) The name of a file, or a stream object
rhs-
(String, stream) The name of a file, or a stream object
options-
(Hash) Options
-
Options:
:no_rewind-
(boolean) Prevents the default behaviour of
rewinding the stream before processing:skip_blank_lines-
(boolean) Determines whether blank lines
should be skipped from the comparison:trim_lines-
(boolean) Determines whether lines should be
trimmed of leading and trailing space (including EOL sequence)
Return
true if the files/streams have exactly the same content; false otherwise.
117 118 119 120 |
# File 'lib/cmpfs/compare/api_2.rb', line 117 def compare_text lhs, rhs, ** ::CmpFS::Compare::Text::Internal_.compare_text_ lhs, rhs, end |
#compare_text_files(lhs_path, rhs_path, options = {}) ⇒ Object
Compares two files, named by lhs_path and rhs_path, in a textual manner according to the given options
Signature
-
Parameters:
lhs_path-
(String) The name of a file
rhs_path-
(String) The name of a file
options-
(Hash) Options
-
Options:
:skip_blank_lines-
(boolean) Determines whether blank lines
should be skipped from the comparison:trim_lines-
(boolean) Determines whether lines should be
trimmed of leading and trailing space (including EOL sequence)
Return
true if the files/streams have exactly the same content; false otherwise.
63 64 65 66 |
# File 'lib/cmpfs/compare/api_2.rb', line 63 def compare_text_files lhs_path, rhs_path, ** ::CmpFS::Compare::Text::Internal_.compare_text_files_ lhs_path, rhs_path, end |
#compare_text_streams(lhs_stm, rhs_stm, options = {}) ⇒ Object
Compares two streams, named by lhs_stm and rhs_stm, in a textual manner according to the given options
Signature
-
Parameters:
lhs_stm-
(stream) A stream object
rhs_stm-
(stream) A stream object
options-
(Hash) Options
-
Options:
:no_rewind-
(boolean) Prevents the default behaviour of
rewinding the stream before processing:skip_blank_lines-
(boolean) Determines whether blank lines
should be skipped from the comparison:trim_lines-
(boolean) Determines whether lines should be
trimmed of leading and trailing space (including EOL sequence)
Return
true if the files/streams have exactly the same content; false otherwise.
90 91 92 93 |
# File 'lib/cmpfs/compare/api_2.rb', line 90 def compare_text_streams lhs_stm, rhs_stm, ** ::CmpFS::Compare::Text::Internal_.compare_text_streams_ lhs_stm, rhs_stm, end |