cmpfs-ruby 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHORS.md +21 -0
- data/CHANGES.md +82 -0
- data/CONTRIBUTING.md +36 -0
- data/EXAMPLES.md +9 -0
- data/FAQ.md +28 -0
- data/INSTALL.md +41 -0
- data/LICENSE +10 -10
- data/NEWS.md +21 -0
- data/README.md +66 -8
- data/Rakefile +21 -0
- data/SECURITY.md +23 -0
- data/TODO.md +24 -0
- data/examples/compare_two_binary_files.md +57 -0
- data/examples/compare_two_text_files.md +57 -0
- data/lib/cmpfs/compare/api_1_9.rb +1 -0
- data/lib/cmpfs/compare/api_2.rb +1 -0
- data/lib/cmpfs/compare/binary/internal_.rb +1 -0
- data/lib/cmpfs/compare/text/internal_.rb +1 -0
- data/lib/cmpfs/compare.rb +3 -3
- data/lib/cmpfs/version.rb +5 -5
- data/lib/cmpfs.rb +3 -3
- metadata +37 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a8e86f24a24c5a3cde852200e9750ce35e545c6ee13509b1f3afa4a54d9e1e55
|
|
4
|
+
data.tar.gz: '087d979dfc6c201d6173c385f51340ecd1b7d513fa953a022b3e463d0515542f'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7c94c420ba8995fc967813a0c5bebb84068ea6bda1f5ec152dbe2cb8d9e4022c8a31612b8254c3f5fa903df59b9e10e62e3952218e0712958286feaa25ddebcd
|
|
7
|
+
data.tar.gz: 3881dbb4de8501ce45affad9ea0c52d431aae45ded26106cafd667d26895c33f416aee61e6e8191630edaf997de6d50390dcdcf08617cf6270eafe40fca58c8a
|
data/AUTHORS.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# cmpfs.Ruby - Authors <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Major Contributors
|
|
5
|
+
|
|
6
|
+
| Name | GitHub |
|
|
7
|
+
| ----------- | --------------------------------- |
|
|
8
|
+
| Matt Wilson | [mwsis](https://github.com/mwsis) |
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Defect reports, fixes and suggestions (for which we are very grateful)
|
|
12
|
+
|
|
13
|
+
| Name | GitHub |
|
|
14
|
+
| ----------- | --------------------------------- |
|
|
15
|
+
| \<none> | |
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
Contributions are welcomed.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
<!-- ########################### end of file ########################### -->
|
data/CHANGES.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# cmpfs.Ruby - Changes <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## 0.2.5 - 27th August 2026
|
|
5
|
+
|
|
6
|
+
* renamed **cmpfs.gemspec** to **cmpfs-ruby.gemspec** so the filename stem matches `spec.name`;
|
|
7
|
+
* **cmpfs-ruby.gemspec**: `spec.summary` matches the README tagline; packaged **AUTHORS**, **CHANGES**, **CONTRIBUTING**, **EXAMPLES**, **FAQ**, **INSTALL**, **NEWS**, **SECURITY**, and **TODO**; **Gemfile.lock** and **.ruby-version** excluded from `spec.files`;
|
|
8
|
+
* stop tracking **Gemfile.lock**; **Gemfile** sets `lockfile false` when Bundler supports it; CI uses `bundler-cache: false` because Bundler 4 then writes no lockfile and **ruby/setup-ruby** cache cats **Gemfile.lock**;
|
|
9
|
+
* CI **Warnings** job now runs on Ruby **3.4**; `gem build cmpfs-ruby.gemspec`;
|
|
10
|
+
* updated **run_all_unit_tests.sh** (from https://github.com/synesissoftware/misc-dev-scripts) to skip **tput** when **$TERM** is unset or stdout is not a TTY;
|
|
11
|
+
* reordered **README.md** (tagline before badges; TOC after badges), added Language / License / Last Commit badges and **Dependencies** (Efferent / Afferent);
|
|
12
|
+
* **EXAMPLES.md** example links are repo-relative (`./examples/…`);
|
|
13
|
+
* library source **Home:** URLs now use `https`;
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## 0.2.4 - 15th August 2026
|
|
17
|
+
|
|
18
|
+
* added `# frozen_string_literal: true` to all **lib/** sources;
|
|
19
|
+
* completed **EXAMPLES.md** catalogue for existing examples;
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 0.2.3 - 4th April 2024
|
|
23
|
+
|
|
24
|
+
* fixed restrictive Ruby 2.x dependency in gemspec;
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## 0.2.2.1 - 4th April 2024
|
|
28
|
+
|
|
29
|
+
* fixed license to canonical form;
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## 0.2.2 - 4th April 2024
|
|
33
|
+
|
|
34
|
+
* fixed restrictive Ruby 2.x dependency in gemspec;
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## 0.2.1.4 - 3rd April 2024
|
|
38
|
+
|
|
39
|
+
* tidying and documentation;
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## 0.2.1.3 - 3rd April 2024
|
|
43
|
+
|
|
44
|
+
* tidying and documentation;
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## 0.2.1.2 - 2nd April 2024
|
|
48
|
+
|
|
49
|
+
* tidying, documentation, and project boilerplate;
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## 0.2.1.1 - 2nd April 2024
|
|
53
|
+
|
|
54
|
+
* merged **boilerplate** into **master**;
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## 0.2.1 - 11th April 2019
|
|
58
|
+
|
|
59
|
+
* tidyings;
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## 0.2.0 - 13th March 2019
|
|
63
|
+
|
|
64
|
+
* added `Compare.compare_text_files()`, `Compare.compare_text_streams()`, and `Compare.compare_text()`;
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
## 0.1.0 - 13th March 2019
|
|
68
|
+
|
|
69
|
+
* sorted modules correctly for including and extending;
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
## 0.0.1 - 12th March 2019
|
|
73
|
+
|
|
74
|
+
* added missing `VERSION_REVISION`;
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
## 0.0.0 - 12th March 2019
|
|
78
|
+
|
|
79
|
+
* initial version;
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
<!-- ########################### end of file ########################### -->
|
data/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# cmpfs.Ruby - Contributing <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Table of Contents <!-- omit in toc -->
|
|
5
|
+
|
|
6
|
+
- [Defects and features](#defects-and-features)
|
|
7
|
+
- [Pull requests](#pull-requests)
|
|
8
|
+
- [Tests](#tests)
|
|
9
|
+
- [License](#license)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Defects and features
|
|
13
|
+
|
|
14
|
+
Open an issue on https://github.com/synesissoftware/cmpfs.Ruby/issues.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Pull requests
|
|
18
|
+
|
|
19
|
+
Pull requests are welcome on https://github.com/synesissoftware/cmpfs.Ruby. Keep diffs local to the change; match existing indentation (2 spaces in Ruby) and the Synesis markdown set (**README.md**, **CHANGES.md**, **NEWS.md**, **TODO.md**, **INSTALL.md**, **CONTRIBUTING.md**, **SECURITY.md**).
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Tests
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
bundle exec rake test
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
or `./run_all_unit_tests.sh`.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## License
|
|
32
|
+
|
|
33
|
+
Contributions are accepted under the 3-clause BSD license. See [LICENSE](./LICENSE).
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
<!-- ########################### end of file ########################### -->
|
data/EXAMPLES.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# cmpfs.Ruby - Examples <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|Name|Source & Description|Summary|
|
|
4
|
+
|---|---|---|
|
|
5
|
+
|**compare_two_binary_files**|[examples/compare_two_binary_files.rb](./examples/compare_two_binary_files.rb)<br/>[examples/compare_two_binary_files.md](./examples/compare_two_binary_files.md)|Compares two files for binary equality via `compare_binary`|
|
|
6
|
+
|**compare_two_text_files**|[examples/compare_two_text_files.rb](./examples/compare_two_text_files.rb)<br/>[examples/compare_two_text_files.md](./examples/compare_two_text_files.md)|Compares two files for text equality via `compare_text` (skip blank lines; trim)|
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<!-- ########################### end of file ########################### -->
|
data/FAQ.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# cmpfs.Ruby - FAQ <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
The FAQ list is under (constant) development. If you post a question on the
|
|
4
|
+
[Issues](https://github.com/synesissoftware/cmpfs.Ruby/issues) forum
|
|
5
|
+
it will be used to create one.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Table of Contents <!-- omit in toc -->
|
|
9
|
+
|
|
10
|
+
- [Q1: "How do I install this library?"](#q1-how-do-i-install-this-library)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# FAQs: <!-- omit in toc -->
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## Q1: "How do I install this library?"
|
|
17
|
+
|
|
18
|
+
Install via **gem**:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
gem install cmpfs-ruby
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
See [README.md](./README.md) for usage.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
<!-- ########################### end of file ########################### -->
|
data/INSTALL.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# cmpfs.Ruby - Installation and Use <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Table of Contents <!-- omit in toc -->
|
|
5
|
+
|
|
6
|
+
- [Install the gem](#install-the-gem)
|
|
7
|
+
- [From a source checkout](#from-a-source-checkout)
|
|
8
|
+
- [Using the library](#using-the-library)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Install the gem
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
gem install cmpfs-ruby
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
or add to a **Gemfile**:
|
|
18
|
+
|
|
19
|
+
```Ruby
|
|
20
|
+
gem 'cmpfs-ruby'
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
then `bundle install`.
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## From a source checkout
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
bundle install
|
|
30
|
+
bundle exec rake test
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## Using the library
|
|
35
|
+
|
|
36
|
+
```Ruby
|
|
37
|
+
require 'cmpfs'
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
<!-- ########################### end of file ########################### -->
|
data/LICENSE
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
cmpfs.Ruby
|
|
1
|
+
cmpfs.Ruby - BSD 3-Clause License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2019-
|
|
3
|
+
Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems
|
|
4
4
|
Copyright (c) 2019, Matthew Wilson and Synesis Software
|
|
5
5
|
All rights reserved.
|
|
6
6
|
|
|
7
7
|
Redistribution and use in source and binary forms, with or without
|
|
8
8
|
modification, are permitted provided that the following conditions are met:
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
11
|
+
this list of conditions and the following disclaimer.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
14
|
+
this list of conditions and the following disclaimer in the documentation
|
|
15
|
+
and/or other materials provided with the distribution.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
18
|
+
contributors may be used to endorse or promote products derived from
|
|
19
|
+
this software without specific prior written permission.
|
|
20
20
|
|
|
21
21
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
22
22
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
data/NEWS.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# cmpfs.Ruby - News <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
| Date | News Item |
|
|
4
|
+
| ---------------- | ---------------------------------------------------------------------------------------- |
|
|
5
|
+
| 27th August 2026 | [**cmpfs.Ruby** 0.2.5](https://github.com/synesissoftware/cmpfs.Ruby/releases/tag/0.2.5) |
|
|
6
|
+
| 15th August 2026 | [**cmpfs.Ruby** 0.2.4](https://github.com/synesissoftware/cmpfs.Ruby/releases/tag/0.2.4) |
|
|
7
|
+
| 4th April 2024 | [**cmpfs.Ruby** 0.2.3](https://github.com/synesissoftware/cmpfs.Ruby/releases/tag/0.2.3) |
|
|
8
|
+
| 4th April 2024 | **cmpfs.Ruby** 0.2.2.1 released |
|
|
9
|
+
| 4th April 2024 | **cmpfs.Ruby** 0.2.2 released |
|
|
10
|
+
| 3rd April 2024 | **cmpfs.Ruby** 0.2.1.4 released |
|
|
11
|
+
| 3rd April 2024 | **cmpfs.Ruby** 0.2.1.3 released |
|
|
12
|
+
| 2nd April 2024 | **cmpfs.Ruby** 0.2.1.2 released |
|
|
13
|
+
| 2nd April 2024 | **cmpfs.Ruby** 0.2.1.1 released |
|
|
14
|
+
| 11th April 2019 | **cmpfs.Ruby** 0.2.1 released |
|
|
15
|
+
| 13th March 2019 | **cmpfs.Ruby** 0.2.0 released |
|
|
16
|
+
| 13th March 2019 | **cmpfs.Ruby** 0.1.0 released |
|
|
17
|
+
| 12th March 2019 | **cmpfs.Ruby** 0.0.1 released |
|
|
18
|
+
| 12th March 2019 | **cmpfs.Ruby** 0.0.0 released |
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
<!-- ########################### end of file ########################### -->
|
data/README.md
CHANGED
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
**Com**pare **F**ile-**S**ystem entities, for **Ruby**
|
|
4
4
|
|
|
5
|
+

|
|
6
|
+
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
5
7
|
[](https://badge.fury.io/rb/cmpfs-ruby)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
## Introduction
|
|
9
|
-
|
|
10
|
-
Provides platform-independent facilities for comparing file contents, for both binary and text files
|
|
8
|
+
[](https://github.com/synesissoftware/cmpfs.Ruby/commits/master)
|
|
9
|
+
[](https://github.com/synesissoftware/cmpfs.Ruby/actions/workflows/ruby.yml)
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
## Table of Contents <!-- omit in toc -->
|
|
@@ -20,13 +19,38 @@ Provides platform-independent facilities for comparing file contents, for both b
|
|
|
20
19
|
- [Where to get help](#where-to-get-help)
|
|
21
20
|
- [Contribution guidelines](#contribution-guidelines)
|
|
22
21
|
- [Dependencies](#dependencies)
|
|
22
|
+
- [Efferent (fan-out)](#efferent-fan-out)
|
|
23
|
+
- [Runtime Dependencies (aka "Normal Dependencies")](#runtime-dependencies-aka-normal-dependencies)
|
|
24
|
+
- [Development Dependencies](#development-dependencies)
|
|
25
|
+
- [Afferent (fan-in)](#afferent-fan-in)
|
|
26
|
+
- [Runtime dependents](#runtime-dependents)
|
|
27
|
+
- [Development dependents](#development-dependents)
|
|
23
28
|
- [Related projects](#related-projects)
|
|
24
29
|
- [License](#license)
|
|
25
30
|
|
|
26
31
|
|
|
32
|
+
## Introduction
|
|
33
|
+
|
|
34
|
+
**cmpfs.Ruby** provides platform-independent facilities for comparing file contents, for both binary and text files.
|
|
35
|
+
|
|
36
|
+
It has **no dependencies** on any other non-standard library.
|
|
37
|
+
|
|
38
|
+
|
|
27
39
|
## Installation
|
|
28
40
|
|
|
29
|
-
Install
|
|
41
|
+
Install via **gem** as in:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
gem install cmpfs-ruby
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
or add it to your `Gemfile`.
|
|
48
|
+
|
|
49
|
+
Use via **require**, as in:
|
|
50
|
+
|
|
51
|
+
```Ruby
|
|
52
|
+
require 'cmpfs'
|
|
53
|
+
```
|
|
30
54
|
|
|
31
55
|
|
|
32
56
|
## Components
|
|
@@ -45,6 +69,8 @@ all of which are obtained when `extend`ing or `include`ing the `CmpFS` module.
|
|
|
45
69
|
|
|
46
70
|
## Examples
|
|
47
71
|
|
|
72
|
+
Examples are provided in the ```examples``` directory, along with a markdown description for each. A detailed list TOC of them is provided in [EXAMPLES.md](./EXAMPLES.md).
|
|
73
|
+
|
|
48
74
|
**examples/compare_two_binary_files.rb**:
|
|
49
75
|
```Ruby
|
|
50
76
|
#! /usr/bin/env ruby
|
|
@@ -142,6 +168,7 @@ $stdout.puts "files are #{compare_text(lhs_path, rhs_path, skip_blank_lines: tru
|
|
|
142
168
|
|
|
143
169
|
## Project Information
|
|
144
170
|
|
|
171
|
+
|
|
145
172
|
### Where to get help
|
|
146
173
|
|
|
147
174
|
[GitHub Page](https://github.com/synesissoftware/cmpfs.Ruby "GitHub Page")
|
|
@@ -155,9 +182,41 @@ Defect reports, feature requests, and pull requests are welcome on https://githu
|
|
|
155
182
|
### Dependencies
|
|
156
183
|
|
|
157
184
|
|
|
185
|
+
#### Efferent (fan-out)
|
|
186
|
+
|
|
187
|
+
Libraries upon which **cmpfs.Ruby** depends:
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
##### Runtime Dependencies (aka "Normal Dependencies")
|
|
191
|
+
|
|
192
|
+
* \<none>;
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
##### Development Dependencies
|
|
196
|
+
|
|
197
|
+
* [**rake**](https://rubygems.org/gems/rake);
|
|
198
|
+
* [**test-unit**](https://rubygems.org/gems/test-unit);
|
|
199
|
+
* [**xqsr3**](https://github.com/synesissoftware/xqsr3);
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
#### Afferent (fan-in)
|
|
203
|
+
|
|
204
|
+
Projects that depend on **cmpfs.Ruby**:
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
##### Runtime dependents
|
|
208
|
+
|
|
209
|
+
* \<none>;
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
##### Development dependents
|
|
213
|
+
|
|
214
|
+
* \<none>;
|
|
215
|
+
|
|
216
|
+
|
|
158
217
|
### Related projects
|
|
159
218
|
|
|
160
|
-
|
|
219
|
+
* C/C++ **cmpfs** — same product idea (binary/text file and stream comparison); recovery into freelibs is planned beside this gem (not yet published as a sibling tree here);
|
|
161
220
|
|
|
162
221
|
|
|
163
222
|
### License
|
|
@@ -166,4 +225,3 @@ T.B.C.
|
|
|
166
225
|
|
|
167
226
|
|
|
168
227
|
<!-- ########################### end of file ########################### -->
|
|
169
|
-
|
data/Rakefile
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Rakefile for cmpfs.Ruby
|
|
4
|
+
|
|
5
|
+
require 'rake/testtask'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Rake::TestTask.new do |tt|
|
|
9
|
+
|
|
10
|
+
tt.libs << 'lib'
|
|
11
|
+
tt.libs << 'test'
|
|
12
|
+
tt.name = 'test'
|
|
13
|
+
tt.test_files = FileList['test/**/tc_*.rb']
|
|
14
|
+
tt.verbose = true
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
task :default => :test
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# ############################## end of file ############################# #
|
data/SECURITY.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# cmpfs.Ruby - Security <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Table of Contents <!-- omit in toc -->
|
|
5
|
+
|
|
6
|
+
- [Reporting a vulnerability](#reporting-a-vulnerability)
|
|
7
|
+
- [Supported versions](#supported-versions)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Reporting a vulnerability
|
|
11
|
+
|
|
12
|
+
Please report security issues privately via GitHub Security Advisories on https://github.com/synesissoftware/cmpfs.Ruby/security, or by opening an issue if an advisory cannot be filed. Do not attach exploit proofs of concept against third-party systems.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## Supported versions
|
|
16
|
+
|
|
17
|
+
| Version | Supported |
|
|
18
|
+
| ------- | --------- |
|
|
19
|
+
| 0.2.x | ✅ |
|
|
20
|
+
| < 0.2 | ❌ |
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<!-- ########################### end of file ########################### -->
|
data/TODO.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# cmpfs.Ruby - TODO <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Functional improvements
|
|
5
|
+
|
|
6
|
+
* [ ] quiet assigned-but-unused variable warnings in **lib/cmpfs/compare/text/internal_.rb** (`lhs_ix`, `rhs_ix`, `lhs_nr`, `rhs_nr`; Ruby 3.4 `-W` / CI **Warnings** job);
|
|
7
|
+
* [ ] quiet the ambiguous `/` regexp warning in **test/unit/tc_version.rb** (Ruby 3.4 `-W` / CI **Warnings** job);
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Performance improvements
|
|
11
|
+
|
|
12
|
+
* \<none>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## Packaging improvements
|
|
16
|
+
|
|
17
|
+
* [x] ~~~updated **run_all_unit_tests.sh** (from **misc-dev-scripts**) to skip `tput` when `$TERM` is unset or stdout is not a TTY~~~;
|
|
18
|
+
* [x] ~~~**Gemfile** `lockfile false`; stop tracking **Gemfile.lock**; CI `bundler-cache: false`~~~;
|
|
19
|
+
* [x] ~~~gemspec polish: README tagline as `spec.summary`, package docs, exclude **Gemfile.lock** / **.ruby-version**; renamed **cmpfs.gemspec** → **cmpfs-ruby.gemspec**~~~;
|
|
20
|
+
* [x] ~~~README canonical structure (tagline before badges; **Dependencies**; CI badge → **ruby.yml**)~~~;
|
|
21
|
+
* [x] ~~~after the packaging/boilerplate/CI baseline: bump **VERSION** and align **CHANGES**/**NEWS**~~~;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<!-- ########################### end of file ########################### -->
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# cmpfs.Ruby - Example - **compare_two_binary_files**
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
Compares two files for binary equality via `compare_binary`.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Source
|
|
9
|
+
|
|
10
|
+
```ruby
|
|
11
|
+
#! /usr/bin/env ruby
|
|
12
|
+
|
|
13
|
+
$:.unshift File.join(File.dirname(__FILE__), '../lib')
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
require 'cmpfs'
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
include CmpFS
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# command-line handling
|
|
23
|
+
|
|
24
|
+
lhs_path, rhs_path =
|
|
25
|
+
case ARGV.size
|
|
26
|
+
when 0, 1
|
|
27
|
+
|
|
28
|
+
if '--help' == ARGV[0]
|
|
29
|
+
|
|
30
|
+
$stdout.puts "#$0: <lhs-path> <rhs-path>"
|
|
31
|
+
|
|
32
|
+
exit 0
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
abort "#$0: not enough arguments; use --help for usage"
|
|
36
|
+
when 2
|
|
37
|
+
|
|
38
|
+
ARGV[0..2]
|
|
39
|
+
else
|
|
40
|
+
|
|
41
|
+
abort "#$0: too many arguments; use --help for usage"
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
# main()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
$stdout.puts "binary comparison of '#{lhs_path}' with '#{rhs_path}':"
|
|
49
|
+
|
|
50
|
+
$stdout.puts "files are #{compare_binary(lhs_path, rhs_path) ? '' : 'not '}equal"
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
# ############################## end of file ############################# #
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
<!-- ########################### end of file ########################### -->
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# cmpfs.Ruby - Example - **compare_two_text_files**
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
Compares two files for text equality via `compare_text`, skipping blank lines and trimming lines.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Source
|
|
9
|
+
|
|
10
|
+
```ruby
|
|
11
|
+
#! /usr/bin/env ruby
|
|
12
|
+
|
|
13
|
+
$:.unshift File.join(File.dirname(__FILE__), '../lib')
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
require 'cmpfs'
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
include CmpFS
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# command-line handling
|
|
23
|
+
|
|
24
|
+
lhs_path, rhs_path =
|
|
25
|
+
case ARGV.size
|
|
26
|
+
when 0, 1
|
|
27
|
+
|
|
28
|
+
if '--help' == ARGV[0]
|
|
29
|
+
|
|
30
|
+
$stdout.puts "#$0: <lhs-path> <rhs-path>"
|
|
31
|
+
|
|
32
|
+
exit 0
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
abort "#$0: not enough arguments; use --help for usage"
|
|
36
|
+
when 2
|
|
37
|
+
|
|
38
|
+
ARGV[0..2]
|
|
39
|
+
else
|
|
40
|
+
|
|
41
|
+
abort "#$0: too many arguments; use --help for usage"
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
# main()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
$stdout.puts "text comparison of '#{lhs_path}' with '#{rhs_path}':"
|
|
49
|
+
|
|
50
|
+
$stdout.puts "files are #{compare_text(lhs_path, rhs_path, skip_blank_lines: true, trim_lines: true) ? '' : 'not '}equal"
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
# ############################## end of file ############################# #
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
<!-- ########################### end of file ########################### -->
|
data/lib/cmpfs/compare/api_2.rb
CHANGED
data/lib/cmpfs/compare.rb
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
2
|
# ######################################################################## #
|
|
3
3
|
# File: cmpfs/version.rb
|
|
4
4
|
#
|
|
5
5
|
# Purpose: Version for cmpfs.Ruby library
|
|
6
6
|
#
|
|
7
7
|
# Created: 1st March 2019
|
|
8
|
-
# Updated:
|
|
8
|
+
# Updated: 19th August 2026
|
|
9
9
|
#
|
|
10
|
-
# Home:
|
|
10
|
+
# Home: https://github.com/synesissoftware/cmpfs.Ruby
|
|
11
11
|
#
|
|
12
12
|
# Author: Matthew Wilson
|
|
13
13
|
#
|
data/lib/cmpfs/version.rb
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
2
|
# ######################################################################## #
|
|
3
3
|
# File: cmpfs/version.rb
|
|
4
4
|
#
|
|
5
5
|
# Purpose: Version for cmpfs.Ruby library
|
|
6
6
|
#
|
|
7
7
|
# Created: 1st March 2019
|
|
8
|
-
# Updated:
|
|
8
|
+
# Updated: 27th August 2026
|
|
9
9
|
#
|
|
10
|
-
# Home:
|
|
10
|
+
# Home: https://github.com/synesissoftware/cmpfs.Ruby
|
|
11
11
|
#
|
|
12
12
|
# Author: Matthew Wilson
|
|
13
13
|
#
|
|
14
|
-
# Copyright (c) 2019-
|
|
14
|
+
# Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems
|
|
15
15
|
# Copyright (c) 2019, Matthew Wilson and Synesis Software
|
|
16
16
|
# All rights reserved.
|
|
17
17
|
#
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
module CmpFS
|
|
52
52
|
|
|
53
53
|
# Current version of the cmpfs.Ruby library
|
|
54
|
-
VERSION = '0.2.
|
|
54
|
+
VERSION = '0.2.5'
|
|
55
55
|
|
|
56
56
|
private
|
|
57
57
|
VERSION_PARTS_ = VERSION.split(/[.]/).collect { |n| n.to_i } # :nodoc:
|
data/lib/cmpfs.rb
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
2
|
# ######################################################################## #
|
|
3
3
|
# File: cmpfs.rb
|
|
4
4
|
#
|
|
5
5
|
# Purpose: Primary require for cmpfs.Ruby library
|
|
6
6
|
#
|
|
7
7
|
# Created: 1st March 2019
|
|
8
|
-
# Updated:
|
|
8
|
+
# Updated: 19th August 2026
|
|
9
9
|
#
|
|
10
|
-
# Home:
|
|
10
|
+
# Home: https://github.com/synesissoftware/cmpfs.Ruby
|
|
11
11
|
#
|
|
12
12
|
# Author: Matthew Wilson
|
|
13
13
|
#
|
metadata
CHANGED
|
@@ -1,47 +1,60 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cmpfs-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Wilson
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-08-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: xqsr3
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0.39'
|
|
20
17
|
- - ">="
|
|
21
18
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: 0.39.
|
|
19
|
+
version: 0.39.5
|
|
20
|
+
- - "<"
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: '1.0'
|
|
23
23
|
type: :development
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
26
|
requirements:
|
|
27
|
-
- - "~>"
|
|
28
|
-
- !ruby/object:Gem::Version
|
|
29
|
-
version: '0.39'
|
|
30
27
|
- - ">="
|
|
31
28
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 0.39.
|
|
29
|
+
version: 0.39.5
|
|
30
|
+
- - "<"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '1.0'
|
|
33
33
|
description: |
|
|
34
34
|
Compare File-System entities, for Ruby is a library that provides comparison
|
|
35
35
|
functions for file-system entities - files and streams - including binary and
|
|
36
36
|
filtering textual comparisons.
|
|
37
|
-
email:
|
|
37
|
+
email:
|
|
38
|
+
- matthew@synesis.com.au
|
|
38
39
|
executables: []
|
|
39
40
|
extensions: []
|
|
40
41
|
extra_rdoc_files: []
|
|
41
42
|
files:
|
|
43
|
+
- AUTHORS.md
|
|
44
|
+
- CHANGES.md
|
|
45
|
+
- CONTRIBUTING.md
|
|
46
|
+
- EXAMPLES.md
|
|
47
|
+
- FAQ.md
|
|
48
|
+
- INSTALL.md
|
|
42
49
|
- LICENSE
|
|
50
|
+
- NEWS.md
|
|
43
51
|
- README.md
|
|
52
|
+
- Rakefile
|
|
53
|
+
- SECURITY.md
|
|
54
|
+
- TODO.md
|
|
55
|
+
- examples/compare_two_binary_files.md
|
|
44
56
|
- examples/compare_two_binary_files.rb
|
|
57
|
+
- examples/compare_two_text_files.md
|
|
45
58
|
- examples/compare_two_text_files.rb
|
|
46
59
|
- lib/cmpfs.rb
|
|
47
60
|
- lib/cmpfs/compare.rb
|
|
@@ -56,11 +69,15 @@ files:
|
|
|
56
69
|
- test/unit/tc_compare_text.rb
|
|
57
70
|
- test/unit/tc_version.rb
|
|
58
71
|
- test/unit/ts_all.rb
|
|
59
|
-
homepage:
|
|
72
|
+
homepage: https://github.com/synesissoftware/cmpfs.Ruby
|
|
60
73
|
licenses:
|
|
61
74
|
- BSD-3-Clause
|
|
62
|
-
metadata:
|
|
63
|
-
|
|
75
|
+
metadata:
|
|
76
|
+
bug_tracker_uri: https://github.com/synesissoftware/cmpfs.Ruby/issues
|
|
77
|
+
changelog_uri: https://github.com/synesissoftware/cmpfs.Ruby/blob/master/CHANGES.md
|
|
78
|
+
homepage_uri: https://github.com/synesissoftware/cmpfs.Ruby
|
|
79
|
+
source_code_uri: https://github.com/synesissoftware/cmpfs.Ruby
|
|
80
|
+
post_install_message:
|
|
64
81
|
rdoc_options: []
|
|
65
82
|
require_paths:
|
|
66
83
|
- lib
|
|
@@ -68,15 +85,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
68
85
|
requirements:
|
|
69
86
|
- - ">="
|
|
70
87
|
- !ruby/object:Gem::Version
|
|
71
|
-
version:
|
|
88
|
+
version: 1.9.3
|
|
72
89
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
90
|
requirements:
|
|
74
91
|
- - ">="
|
|
75
92
|
- !ruby/object:Gem::Version
|
|
76
93
|
version: '0'
|
|
77
94
|
requirements: []
|
|
78
|
-
|
|
79
|
-
|
|
95
|
+
rubyforge_project:
|
|
96
|
+
rubygems_version: 2.7.6.3
|
|
97
|
+
signing_key:
|
|
80
98
|
specification_version: 4
|
|
81
|
-
summary:
|
|
99
|
+
summary: Compare File-System entities, for Ruby
|
|
82
100
|
test_files: []
|