cmpfs-ruby 0.2.0 → 0.2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE +17 -16
- data/README.md +133 -11
- data/examples/compare_two_binary_files.rb +44 -0
- data/examples/compare_two_text_files.rb +44 -0
- data/lib/cmpfs/compare/api_1_9.rb +142 -120
- data/lib/cmpfs/compare/api_2.rb +130 -108
- data/lib/cmpfs/compare/binary/internal_.rb +50 -52
- data/lib/cmpfs/compare/text/internal_.rb +89 -92
- data/lib/cmpfs/compare.rb +25 -23
- data/lib/cmpfs/version.rb +20 -19
- data/lib/cmpfs.rb +22 -18
- data/test/unit/compare/tc_compare_binary.rb +52 -51
- data/test/unit/compare/ts_all.rb +1 -1
- data/test/unit/tc_compare_binary.rb +53 -54
- data/test/unit/tc_compare_text.rb +85 -31
- data/test/unit/tc_version.rb +19 -16
- data/test/unit/ts_all.rb +1 -1
- metadata +24 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 46fb5f08ba76dfb2e7850d848f46c57016635721b445974b280a8247d7d93ac0
|
4
|
+
data.tar.gz: 60baeea6023c1d8178ecfc5c54b3f8ab8fe9e2b562773785b5453c2a868d560a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed2d57ba6d485a995ef08244373e7518a2212fff1560cc23be8809100200a83759c37416c4e9a37e5dc878ad5facf58d99b1baef9221d350ecf828b8b6711151
|
7
|
+
data.tar.gz: e9b77bf3cb58c210afbc64db805a2a7898a0fd8507a8f2e470df66cdbdd58c5799c8ec68bd0e23f832d30d5e16ff030ea81965e958804b35d1e2eec1efab6ee7
|
data/LICENSE
CHANGED
@@ -1,31 +1,32 @@
|
|
1
1
|
cmpfs.Ruby
|
2
2
|
|
3
|
+
Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
|
3
4
|
Copyright (c) 2019, Matthew Wilson and Synesis Software
|
4
5
|
All rights reserved.
|
5
6
|
|
6
7
|
Redistribution and use in source and binary forms, with or without
|
7
8
|
modification, are permitted provided that the following conditions are met:
|
8
9
|
|
9
|
-
* Redistributions of source code must retain the above copyright notice,
|
10
|
-
list of conditions and the following disclaimer.
|
10
|
+
* Redistributions of source code must retain the above copyright notice,
|
11
|
+
this list of conditions and the following disclaimer.
|
11
12
|
|
12
13
|
* Redistributions in binary form must reproduce the above copyright notice,
|
13
14
|
this list of conditions and the following disclaimer in the documentation
|
14
15
|
and/or other materials provided with the distribution.
|
15
16
|
|
16
|
-
* Neither the names of cmpfs or cmpfs.Ruby nor the names of
|
17
|
-
|
18
|
-
|
19
|
-
permission.
|
17
|
+
* Neither the names of cmpfs or cmpfs.Ruby nor the names of its contributors
|
18
|
+
or its copyright holders may be used to endorse or promote products
|
19
|
+
derived from this software without specific prior written permission.
|
20
20
|
|
21
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
22
|
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
23
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
24
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
25
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
26
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
27
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
28
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
29
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
30
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
21
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
22
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
23
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
24
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
25
|
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
26
|
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
27
|
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
28
|
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
29
|
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
30
|
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
31
|
+
POSSIBILITY OF SUCH DAMAGE.
|
31
32
|
|
data/README.md
CHANGED
@@ -1,29 +1,144 @@
|
|
1
|
-
# cmpfs.Ruby
|
1
|
+
# cmpfs.Ruby <!-- omit in toc -->
|
2
|
+
|
2
3
|
**Com**pare **F**ile-**S**ystem entities, for **Ruby**
|
3
4
|
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/cmpfs-ruby.svg)](https://badge.fury.io/rb/cmpfs-ruby)
|
6
|
+
|
7
|
+
|
4
8
|
## Introduction
|
5
9
|
|
6
|
-
|
10
|
+
Provides platform-independent facilities for comparing file contents, for both binary and text files
|
7
11
|
|
8
|
-
## Table of Contents
|
9
12
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
## Table of Contents <!-- omit in toc -->
|
14
|
+
|
15
|
+
- [Introduction](#introduction)
|
16
|
+
- [Installation](#installation)
|
17
|
+
- [Components](#components)
|
18
|
+
- [Examples](#examples)
|
19
|
+
- [Project Information](#project-information)
|
20
|
+
- [Where to get help](#where-to-get-help)
|
21
|
+
- [Contribution guidelines](#contribution-guidelines)
|
22
|
+
- [Dependencies](#dependencies)
|
23
|
+
- [Related projects](#related-projects)
|
24
|
+
- [License](#license)
|
25
|
+
|
15
26
|
|
16
27
|
## Installation
|
17
28
|
|
18
29
|
Install using `gem install cmpfs-ruby` or add it to your `Gemfile`.
|
19
30
|
|
31
|
+
|
20
32
|
## Components
|
21
33
|
|
22
|
-
|
34
|
+
The primary components provided are the functions:
|
35
|
+
|
36
|
+
* `CmpFS::Compare.compare_binary_files()`
|
37
|
+
* `CmpFS::Compare.compare_binary_streams()`
|
38
|
+
* `CmpFS::Compare.compare_binary()`
|
39
|
+
* `CmpFS::Compare.compare_text_files()`
|
40
|
+
* `CmpFS::Compare.compare_text_streams()`
|
41
|
+
* `CmpFS::Compare.compare_text()`
|
42
|
+
|
43
|
+
all of which are obtained when `extend`ing or `include`ing the `CmpFS` module.
|
44
|
+
|
23
45
|
|
24
46
|
## Examples
|
25
47
|
|
26
|
-
|
48
|
+
**examples/compare_two_binary_files.rb**:
|
49
|
+
```Ruby
|
50
|
+
#! /usr/bin/env ruby
|
51
|
+
|
52
|
+
$:.unshift File.join(File.dirname(__FILE__), '../lib')
|
53
|
+
|
54
|
+
|
55
|
+
require 'cmpfs'
|
56
|
+
|
57
|
+
|
58
|
+
include CmpFS
|
59
|
+
|
60
|
+
|
61
|
+
# command-line handling
|
62
|
+
|
63
|
+
lhs_path, rhs_path =
|
64
|
+
case ARGV.size
|
65
|
+
when 0, 1
|
66
|
+
|
67
|
+
if '--help' == ARGV[0]
|
68
|
+
|
69
|
+
$stdout.puts "#$0: <lhs-path> <rhs-path>"
|
70
|
+
|
71
|
+
exit 0
|
72
|
+
end
|
73
|
+
|
74
|
+
abort "#$0: not enough arguments; use --help for usage"
|
75
|
+
when 2
|
76
|
+
|
77
|
+
ARGV[0..2]
|
78
|
+
else
|
79
|
+
|
80
|
+
abort "#$0: too many arguments; use --help for usage"
|
81
|
+
end
|
82
|
+
|
83
|
+
|
84
|
+
# main()
|
85
|
+
|
86
|
+
|
87
|
+
$stdout.puts "binary comparison of '#{lhs_path}' with '#{rhs_path}':"
|
88
|
+
|
89
|
+
$stdout.puts "files are #{compare_binary(lhs_path, rhs_path) ? '' : 'not '}equal"
|
90
|
+
|
91
|
+
|
92
|
+
# ############################## end of file ############################# #
|
93
|
+
```
|
94
|
+
|
95
|
+
**examples/compare_two_text_files.rb**:
|
96
|
+
```Ruby
|
97
|
+
#! /usr/bin/env ruby
|
98
|
+
|
99
|
+
$:.unshift File.join(File.dirname(__FILE__), '../lib')
|
100
|
+
|
101
|
+
|
102
|
+
require 'cmpfs'
|
103
|
+
|
104
|
+
|
105
|
+
include CmpFS
|
106
|
+
|
107
|
+
|
108
|
+
# command-line handling
|
109
|
+
|
110
|
+
lhs_path, rhs_path =
|
111
|
+
case ARGV.size
|
112
|
+
when 0, 1
|
113
|
+
|
114
|
+
if '--help' == ARGV[0]
|
115
|
+
|
116
|
+
$stdout.puts "#$0: <lhs-path> <rhs-path>"
|
117
|
+
|
118
|
+
exit 0
|
119
|
+
end
|
120
|
+
|
121
|
+
abort "#$0: not enough arguments; use --help for usage"
|
122
|
+
when 2
|
123
|
+
|
124
|
+
ARGV[0..2]
|
125
|
+
else
|
126
|
+
|
127
|
+
abort "#$0: too many arguments; use --help for usage"
|
128
|
+
end
|
129
|
+
|
130
|
+
|
131
|
+
# main()
|
132
|
+
|
133
|
+
|
134
|
+
$stdout.puts "text comparison of '#{lhs_path}' with '#{rhs_path}':"
|
135
|
+
|
136
|
+
$stdout.puts "files are #{compare_text(lhs_path, rhs_path, skip_blank_lines: true, trim_lines: true) ? '' : 'not '}equal"
|
137
|
+
|
138
|
+
|
139
|
+
# ############################## end of file ############################# #
|
140
|
+
```
|
141
|
+
|
27
142
|
|
28
143
|
## Project Information
|
29
144
|
|
@@ -31,17 +146,24 @@ T.B.C.
|
|
31
146
|
|
32
147
|
[GitHub Page](https://github.com/synesissoftware/cmpfs.Ruby "GitHub Page")
|
33
148
|
|
149
|
+
|
34
150
|
### Contribution guidelines
|
35
151
|
|
36
152
|
Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/cmpfs.Ruby.
|
37
153
|
|
154
|
+
|
38
155
|
### Dependencies
|
39
156
|
|
157
|
+
|
40
158
|
### Related projects
|
41
159
|
|
42
160
|
T.B.C.
|
43
161
|
|
162
|
+
|
44
163
|
### License
|
45
164
|
|
46
|
-
**cmpfs.
|
165
|
+
**cmpfs.Ruby** is released under the 3-clause BSD license. See [LICENSE](./LICENSE) for details.
|
166
|
+
|
167
|
+
|
168
|
+
<!-- ########################### end of file ########################### -->
|
47
169
|
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
|
3
|
+
$:.unshift File.join(File.dirname(__FILE__), '../lib')
|
4
|
+
|
5
|
+
|
6
|
+
require 'cmpfs'
|
7
|
+
|
8
|
+
|
9
|
+
include CmpFS
|
10
|
+
|
11
|
+
|
12
|
+
# command-line handling
|
13
|
+
|
14
|
+
lhs_path, rhs_path =
|
15
|
+
case ARGV.size
|
16
|
+
when 0, 1
|
17
|
+
|
18
|
+
if '--help' == ARGV[0]
|
19
|
+
|
20
|
+
$stdout.puts "#$0: <lhs-path> <rhs-path>"
|
21
|
+
|
22
|
+
exit 0
|
23
|
+
end
|
24
|
+
|
25
|
+
abort "#$0: not enough arguments; use --help for usage"
|
26
|
+
when 2
|
27
|
+
|
28
|
+
ARGV[0..2]
|
29
|
+
else
|
30
|
+
|
31
|
+
abort "#$0: too many arguments; use --help for usage"
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
# main()
|
36
|
+
|
37
|
+
|
38
|
+
$stdout.puts "binary comparison of '#{lhs_path}' with '#{rhs_path}':"
|
39
|
+
|
40
|
+
$stdout.puts "files are #{compare_binary(lhs_path, rhs_path) ? '' : 'not '}equal"
|
41
|
+
|
42
|
+
|
43
|
+
# ############################## end of file ############################# #
|
44
|
+
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
|
3
|
+
$:.unshift File.join(File.dirname(__FILE__), '../lib')
|
4
|
+
|
5
|
+
|
6
|
+
require 'cmpfs'
|
7
|
+
|
8
|
+
|
9
|
+
include CmpFS
|
10
|
+
|
11
|
+
|
12
|
+
# command-line handling
|
13
|
+
|
14
|
+
lhs_path, rhs_path =
|
15
|
+
case ARGV.size
|
16
|
+
when 0, 1
|
17
|
+
|
18
|
+
if '--help' == ARGV[0]
|
19
|
+
|
20
|
+
$stdout.puts "#$0: <lhs-path> <rhs-path>"
|
21
|
+
|
22
|
+
exit 0
|
23
|
+
end
|
24
|
+
|
25
|
+
abort "#$0: not enough arguments; use --help for usage"
|
26
|
+
when 2
|
27
|
+
|
28
|
+
ARGV[0..2]
|
29
|
+
else
|
30
|
+
|
31
|
+
abort "#$0: too many arguments; use --help for usage"
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
# main()
|
36
|
+
|
37
|
+
|
38
|
+
$stdout.puts "text comparison of '#{lhs_path}' with '#{rhs_path}':"
|
39
|
+
|
40
|
+
$stdout.puts "files are #{compare_text(lhs_path, rhs_path, skip_blank_lines: true, trim_lines: true) ? '' : 'not '}equal"
|
41
|
+
|
42
|
+
|
43
|
+
# ############################## end of file ############################# #
|
44
|
+
|
@@ -1,139 +1,161 @@
|
|
1
1
|
|
2
2
|
if RUBY_VERSION >= '2'
|
3
3
|
|
4
|
-
|
4
|
+
abort "This file required Ruby 1+: RUBY_VERSION='#{RUBY_VERSION}'"
|
5
5
|
end
|
6
6
|
|
7
7
|
require 'cmpfs/compare/binary/internal_'
|
8
8
|
require 'cmpfs/compare/text/internal_'
|
9
9
|
|
10
|
+
|
10
11
|
module CmpFS
|
11
12
|
module Compare
|
12
13
|
|
13
14
|
module CmpFS_Compare_Methods
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
16
|
+
# Compares two files, named by +lhs_path+ and +rhs_path+, in a binary
|
17
|
+
# (exact) manner
|
18
|
+
#
|
19
|
+
# === Signature
|
20
|
+
#
|
21
|
+
# * *Parameters:*
|
22
|
+
# - +lhs_path+:: (+String+) The name of a file
|
23
|
+
# - +rhs_path+:: (+String+) The name of a file
|
24
|
+
# - +options+:: (+Hash+) Options that control the behaviour of the method
|
25
|
+
#
|
26
|
+
# * *Options:*
|
27
|
+
#
|
28
|
+
# === Return
|
29
|
+
# +true+ if the files have exactly the same content; +false+ otherwise.
|
30
|
+
def compare_binary_files lhs_path, rhs_path, options = {}
|
31
|
+
|
32
|
+
options ||= {}
|
33
|
+
|
34
|
+
::CmpFS::Compare::Binary::Internal_.compare_binary_files_ lhs_path, rhs_path, options
|
35
|
+
end
|
36
|
+
|
37
|
+
# Compares two streams, +lhs_stm+ and +rhs_stm+, in a binary
|
38
|
+
# (exact) manner
|
39
|
+
#
|
40
|
+
# === Signature
|
41
|
+
#
|
42
|
+
# * *Parameters:*
|
43
|
+
# - +lhs_stm+:: (stream) A stream object
|
44
|
+
# - +rhs_stm+:: (stream) A stream object
|
45
|
+
# - +options+:: (+Hash+) Options that control the behaviour of the method
|
46
|
+
#
|
47
|
+
# * *Options:*
|
48
|
+
# - +:no_rewind+:: (boolean) Prevents the default behaviour of rewinding each stream before processing
|
49
|
+
#
|
50
|
+
# === Return
|
51
|
+
# +true+ if the streams have exactly the same content; +false+ otherwise.
|
52
|
+
def compare_binary_streams lhs_stm, rhs_stm, options = {}
|
53
|
+
|
54
|
+
options ||= {}
|
55
|
+
|
56
|
+
::CmpFS::Compare::Binary::Internal_.compare_binary_streams_ lhs_stm, rhs_stm, options
|
57
|
+
end
|
58
|
+
|
59
|
+
# Compares two files/streams in a binary (exact) manner
|
60
|
+
#
|
61
|
+
# === Signature
|
62
|
+
#
|
63
|
+
# * *Parameters:*
|
64
|
+
# - +lhs+:: (+String+, stream) The name of a file, or a stream object
|
65
|
+
# - +rhs+:: (+String+, stream) The name of a file, or a stream object
|
66
|
+
# - +options+:: (+Hash+) Options that control the behaviour of the method
|
67
|
+
#
|
68
|
+
# * *Options:*
|
69
|
+
# - +:no_rewind+:: (boolean) Prevents the default behaviour of rewinding each stream before processing
|
70
|
+
#
|
71
|
+
# === Return
|
72
|
+
# +true+ if the files/streams have exactly the same content; +false+
|
73
|
+
# otherwise.
|
74
|
+
def compare_binary lhs, rhs, options = {}
|
75
|
+
|
76
|
+
options ||= {}
|
77
|
+
|
78
|
+
::CmpFS::Compare::Binary::Internal_.compare_binary_ lhs, rhs, options
|
79
|
+
end
|
80
|
+
|
81
|
+
|
82
|
+
# Compares two files, named by +lhs_path+ and +rhs_path+, in a textual
|
83
|
+
# manner according to the given +options+
|
84
|
+
#
|
85
|
+
# === Signature
|
86
|
+
#
|
87
|
+
# * *Parameters:*
|
88
|
+
# - +lhs_path+:: (+String+) The name of a file
|
89
|
+
# - +rhs_path+:: (+String+) The name of a file
|
90
|
+
# - +options+:: (+Hash+) Options that control the behaviour of the method
|
91
|
+
#
|
92
|
+
# * *Options:*
|
93
|
+
# - +:skip_blank_lines+:: (boolean) Determines whether blank lines should be skipped from the comparison
|
94
|
+
# - +:trim_lines+:: (boolean) Determines whether lines should be trimmed of leading and trailing space (including EOL sequence)
|
95
|
+
#
|
96
|
+
# === Return
|
97
|
+
# +true+ if the files/streams have exactly the same content; +false+
|
98
|
+
# otherwise.
|
99
|
+
def compare_text_files lhs_path, rhs_path, options = {}
|
100
|
+
|
101
|
+
options |= {}
|
102
|
+
|
103
|
+
::CmpFS::Compare::Text::Internal_.compare_text_files_ lhs_path, rhs_path, options
|
104
|
+
end
|
105
|
+
|
106
|
+
# Compares two streams, named by +lhs_stm+ and +rhs_stm+, in a textual
|
107
|
+
# manner according to the given +options+
|
108
|
+
#
|
109
|
+
# === Signature
|
110
|
+
#
|
111
|
+
# * *Parameters:*
|
112
|
+
# - +lhs_stm+:: (stream) A stream object
|
113
|
+
# - +rhs_stm+:: (stream) A stream object
|
114
|
+
# - +options+:: (+Hash+) Options that control the behaviour of the method
|
115
|
+
#
|
116
|
+
# * *Options:*
|
117
|
+
# - +:no_rewind+:: (boolean) Prevents the default behaviour of rewinding each stream before processing
|
118
|
+
# - +:skip_blank_lines+:: (boolean) Determines whether blank lines should be skipped from the comparison
|
119
|
+
# - +:trim_lines+:: (boolean) Determines whether lines should be trimmed of leading and trailing space (including EOL sequence)
|
120
|
+
#
|
121
|
+
# === Return
|
122
|
+
# +true+ if the files/streams have exactly the same content; +false+
|
123
|
+
# otherwise.
|
124
|
+
def compare_text_streams lhs_stm, rhs_stm, options = {}
|
125
|
+
|
126
|
+
options ||= {}
|
127
|
+
|
128
|
+
::CmpFS::Compare::Text::Internal_.compare_text_streams_ lhs_stm, rhs_stm, options
|
129
|
+
end
|
130
|
+
|
131
|
+
# Compares two files/streams, named by +lhs+ and +rhs+, in a textual
|
132
|
+
# manner according to the given +options+
|
133
|
+
#
|
134
|
+
# === Signature
|
135
|
+
#
|
136
|
+
# * *Parameters:*
|
137
|
+
# - +lhs+:: (+String+, stream) The name of a file, or a stream object
|
138
|
+
# - +rhs+:: (+String+, stream) The name of a file, or a stream object
|
139
|
+
# - +options+:: (+Hash+) Options that control the behaviour of the method
|
140
|
+
#
|
141
|
+
# * *Options:*
|
142
|
+
# - +:no_rewind+:: (boolean) Prevents the default behaviour of rewinding each stream before processing
|
143
|
+
# - +:skip_blank_lines+:: (boolean) Determines whether blank lines should be skipped from the comparison
|
144
|
+
# - +:trim_lines+:: (boolean) Determines whether lines should be trimmed of leading and trailing space (including EOL sequence)
|
145
|
+
#
|
146
|
+
# === Return
|
147
|
+
# +true+ if the files/streams have exactly the same content; +false+
|
148
|
+
# otherwise.
|
149
|
+
def compare_text lhs, rhs, options = {}
|
150
|
+
|
151
|
+
options ||= {}
|
152
|
+
|
153
|
+
::CmpFS::Compare::Text::Internal_.compare_text_ lhs, rhs, options
|
154
|
+
end
|
133
155
|
end # module CmpFS_Compare_Methods
|
134
156
|
end # module Compare
|
135
157
|
end # module CmpFS
|
136
158
|
|
137
|
-
# ############################## end of file ############################# #
|
138
159
|
|
160
|
+
# ############################## end of file ############################# #
|
139
161
|
|