diff-lcs 2.0.0.beta.1 → 2.0.0

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.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +32 -5
  3. data/CODE_OF_CONDUCT.md +152 -114
  4. data/CONTRIBUTING.md +8 -3
  5. data/CONTRIBUTORS.md +19 -9
  6. data/Manifest.txt +88 -70
  7. data/README.md +30 -17
  8. data/Rakefile +90 -22
  9. data/SECURITY.md +3 -12
  10. data/integration/compare/array_diff_spec.rb +10 -0
  11. data/integration/compare/hash_diff_spec.rb +25 -0
  12. data/integration/compare/string_diff_spec.rb +10 -0
  13. data/integration/rspec_differ_spec.rb +26 -0
  14. data/integration/rspec_expectations_spec.rb +32 -0
  15. data/integration/runner +20 -0
  16. data/lib/diff/lcs/change.rb +21 -16
  17. data/lib/diff/lcs/ldiff.rb +9 -4
  18. data/lib/diff/lcs/version.rb +1 -1
  19. data/spec/hunk_spec.rb +32 -34
  20. data/spec/ldiff_spec.rb +7 -7
  21. data/spec/spec_helper.rb +4 -12
  22. data/test/fixtures/ldiff/output.diff-c +7 -0
  23. data/test/fixtures/ldiff/output.diff-u +5 -0
  24. data/test/fixtures/ldiff/output.diff.bin2 +1 -0
  25. data/test/fixtures/ldiff/output.diff.bin2-c +1 -0
  26. data/test/fixtures/ldiff/output.diff.bin2-e +1 -0
  27. data/test/fixtures/ldiff/output.diff.bin2-f +1 -0
  28. data/test/fixtures/ldiff/output.diff.bin2-u +1 -0
  29. data/{spec → test}/fixtures/ldiff/output.diff.chef-c +2 -2
  30. data/test/fixtures/ldiff/output.diff.chef-u +9 -0
  31. data/{spec → test}/fixtures/ldiff/output.diff.chef2-c +2 -2
  32. data/{spec → test}/fixtures/ldiff/output.diff.chef2-u +2 -2
  33. data/test/fixtures/ldiff/output.diff.empty.vs.four_lines-c +9 -0
  34. data/test/fixtures/ldiff/output.diff.empty.vs.four_lines-u +7 -0
  35. data/test/fixtures/ldiff/output.diff.four_lines.vs.empty-c +9 -0
  36. data/test/fixtures/ldiff/output.diff.four_lines.vs.empty-u +7 -0
  37. data/test/fixtures/ldiff/output.diff.issue95_trailing_context-c +9 -0
  38. data/test/fixtures/ldiff/output.diff.issue95_trailing_context-u +6 -0
  39. data/{spec → test}/fixtures/ldiff/output.diff.missing_new_line1-c +2 -2
  40. data/test/fixtures/ldiff/output.diff.missing_new_line1-u +9 -0
  41. data/{spec → test}/fixtures/ldiff/output.diff.missing_new_line2-c +2 -2
  42. data/test/fixtures/ldiff/output.diff.missing_new_line2-u +9 -0
  43. data/test/test_block.rb +34 -0
  44. data/test/test_change.rb +234 -0
  45. data/test/test_diff.rb +53 -0
  46. data/test/test_helper.rb +225 -0
  47. data/test/test_hunk.rb +72 -0
  48. data/test/test_issues.rb +168 -0
  49. data/test/test_lcs.rb +47 -0
  50. data/test/test_ldiff.rb +89 -0
  51. data/test/test_patch.rb +362 -0
  52. data/test/test_sdiff.rb +167 -0
  53. data/test/test_traverse_balanced.rb +322 -0
  54. data/test/test_traverse_sequences.rb +187 -0
  55. metadata +136 -105
  56. data/spec/fixtures/ldiff/output.diff-c +0 -7
  57. data/spec/fixtures/ldiff/output.diff-u +0 -5
  58. data/spec/fixtures/ldiff/output.diff.bin2 +0 -1
  59. data/spec/fixtures/ldiff/output.diff.bin2-c +0 -1
  60. data/spec/fixtures/ldiff/output.diff.bin2-e +0 -1
  61. data/spec/fixtures/ldiff/output.diff.bin2-f +0 -1
  62. data/spec/fixtures/ldiff/output.diff.bin2-u +0 -1
  63. data/spec/fixtures/ldiff/output.diff.chef-u +0 -9
  64. data/spec/fixtures/ldiff/output.diff.empty.vs.four_lines-c +0 -9
  65. data/spec/fixtures/ldiff/output.diff.empty.vs.four_lines-u +0 -7
  66. data/spec/fixtures/ldiff/output.diff.four_lines.vs.empty-c +0 -9
  67. data/spec/fixtures/ldiff/output.diff.four_lines.vs.empty-u +0 -7
  68. data/spec/fixtures/ldiff/output.diff.issue95_trailing_context-c +0 -9
  69. data/spec/fixtures/ldiff/output.diff.issue95_trailing_context-u +0 -6
  70. data/spec/fixtures/ldiff/output.diff.missing_new_line1-u +0 -9
  71. data/spec/fixtures/ldiff/output.diff.missing_new_line2-u +0 -9
  72. /data/{spec → test}/fixtures/123_x +0 -0
  73. /data/{spec → test}/fixtures/456_x +0 -0
  74. /data/{spec → test}/fixtures/aX +0 -0
  75. /data/{spec → test}/fixtures/bXaX +0 -0
  76. /data/{spec → test}/fixtures/ds1.csv +0 -0
  77. /data/{spec → test}/fixtures/ds2.csv +0 -0
  78. /data/{spec → test}/fixtures/empty +0 -0
  79. /data/{spec → test}/fixtures/file1.bin +0 -0
  80. /data/{spec → test}/fixtures/file2.bin +0 -0
  81. /data/{spec → test}/fixtures/four_lines +0 -0
  82. /data/{spec → test}/fixtures/four_lines_with_missing_new_line +0 -0
  83. /data/{spec → test}/fixtures/ldiff/diff.missing_new_line1-e +0 -0
  84. /data/{spec → test}/fixtures/ldiff/diff.missing_new_line1-f +0 -0
  85. /data/{spec → test}/fixtures/ldiff/diff.missing_new_line2-e +0 -0
  86. /data/{spec → test}/fixtures/ldiff/diff.missing_new_line2-f +0 -0
  87. /data/{spec → test}/fixtures/ldiff/error.diff.chef-e +0 -0
  88. /data/{spec → test}/fixtures/ldiff/error.diff.chef-f +0 -0
  89. /data/{spec → test}/fixtures/ldiff/error.diff.missing_new_line1-e +0 -0
  90. /data/{spec → test}/fixtures/ldiff/error.diff.missing_new_line1-f +0 -0
  91. /data/{spec → test}/fixtures/ldiff/error.diff.missing_new_line2-e +0 -0
  92. /data/{spec → test}/fixtures/ldiff/error.diff.missing_new_line2-f +0 -0
  93. /data/{spec → test}/fixtures/ldiff/output.diff +0 -0
  94. /data/{spec → test}/fixtures/ldiff/output.diff.bin1 +0 -0
  95. /data/{spec → test}/fixtures/ldiff/output.diff.bin1-c +0 -0
  96. /data/{spec → test}/fixtures/ldiff/output.diff.bin1-e +0 -0
  97. /data/{spec → test}/fixtures/ldiff/output.diff.bin1-f +0 -0
  98. /data/{spec → test}/fixtures/ldiff/output.diff.bin1-u +0 -0
  99. /data/{spec → test}/fixtures/ldiff/output.diff.chef +0 -0
  100. /data/{spec → test}/fixtures/ldiff/output.diff.chef2 +0 -0
  101. /data/{spec → test}/fixtures/ldiff/output.diff.chef2-d +0 -0
  102. /data/{spec → test}/fixtures/ldiff/output.diff.empty.vs.four_lines +0 -0
  103. /data/{spec → test}/fixtures/ldiff/output.diff.empty.vs.four_lines-e +0 -0
  104. /data/{spec → test}/fixtures/ldiff/output.diff.empty.vs.four_lines-f +0 -0
  105. /data/{spec → test}/fixtures/ldiff/output.diff.four_lines.vs.empty +0 -0
  106. /data/{spec → test}/fixtures/ldiff/output.diff.four_lines.vs.empty-e +0 -0
  107. /data/{spec → test}/fixtures/ldiff/output.diff.four_lines.vs.empty-f +0 -0
  108. /data/{spec → test}/fixtures/ldiff/output.diff.issue95_trailing_context +0 -0
  109. /data/{spec → test}/fixtures/ldiff/output.diff.issue95_trailing_context-e +0 -0
  110. /data/{spec → test}/fixtures/ldiff/output.diff.issue95_trailing_context-f +0 -0
  111. /data/{spec → test}/fixtures/ldiff/output.diff.missing_new_line1 +0 -0
  112. /data/{spec → test}/fixtures/ldiff/output.diff.missing_new_line1-e +0 -0
  113. /data/{spec → test}/fixtures/ldiff/output.diff.missing_new_line1-f +0 -0
  114. /data/{spec → test}/fixtures/ldiff/output.diff.missing_new_line2 +0 -0
  115. /data/{spec → test}/fixtures/ldiff/output.diff.missing_new_line2-e +0 -0
  116. /data/{spec → test}/fixtures/ldiff/output.diff.missing_new_line2-f +0 -0
  117. /data/{spec → test}/fixtures/new-chef +0 -0
  118. /data/{spec → test}/fixtures/new-chef2 +0 -0
  119. /data/{spec → test}/fixtures/old-chef +0 -0
  120. /data/{spec → test}/fixtures/old-chef2 +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd303077c3c47d39b1a910a88cfba8e39af2d2882845fafd1884a89b772e3a6d
4
- data.tar.gz: c0b593b8eaf428ac8615671eb2760c58281be09769cfb6df4b672011dd73c720
3
+ metadata.gz: b8edc3b3383f33e30269bdef56fd21d58ac8efe471bb202f129d659a4f1a5ead
4
+ data.tar.gz: 681426cabb34022d55a8335b4dcf095dc5b97faeddc4bbe82793a2cba36c6729
5
5
  SHA512:
6
- metadata.gz: 92cb3417833f94c81dad165cc462aad0edd2dd5fed5f2a148d46cb6ceae9a5a91ba92fedb0fbf31d46c49e576cd320b4945a3d7f377cee593c6416731c4e5afe
7
- data.tar.gz: 8ca265ed0f666f0f13f864b89a0eaa9765be5adcc6dc8df2cf526feeaa8f8713cca2bb66533861e6ef15356fb6db44e02ec40e8047090560910e6ef6228d6538
6
+ metadata.gz: db895eb27c2215803f6da307375044c456fe7a09250d86d3be8fd176e22cc6aef71d3767fd6901c62c3a9a5c1035e282570a535fe365bff8af9ce1459d937687
7
+ data.tar.gz: 948fd71bb838124c75c594921a5225358785b40d36d4b3bae60bd0d17914f1b3aa9ab71715e25c488028a67fb660a41808036ffa955b3802505dc9dce83d13fc
data/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Changelog
2
2
 
3
- ## 2.0.0.beta.1 / 2025-12-31
3
+ ## 2.0.0 / 2026-02-01
4
4
 
5
5
  This release has significant **breaking changes**.
6
6
 
@@ -35,6 +35,29 @@ This release has significant **breaking changes**.
35
35
  Most callers are using `Diff::LCS.lcs` and modern Ruby did-you-mean support
36
36
  should assist with this update.
37
37
 
38
+ - `Diff::LCS::Change` objects implemented the comparison operator (`<=>`)
39
+ incorrectly. Comparisons are now done so that the `position` is compared
40
+ first, then the `action` (by index of `VALID_ACTIONS`), and finally the
41
+ element. `Diff::LCS::ContextChange` works similarly, comparing the old and new
42
+ positions prior to comparing the actions by index.
43
+
44
+ The order of `VALID_ACTIONS` was changed for the index order to make sense.
45
+
46
+ - `ldiff` now implements `-` as a filename option for standard input. This is
47
+ used for integration testing with RSpec like this:
48
+
49
+ ```console
50
+ rspec -Ilib -rdiff/lcs integration/failure/array_diff_spec.rb 2>&1 |
51
+ ruby -Ilib bin/ldiff -U integration/golden/array_diff.txt -
52
+ ```
53
+
54
+ - diff-lcs no longer uses RSpec as its test suite, but instead uses Minitest.
55
+ The conversion to Minitest and the new RSpec integration tests
56
+ (`rake integration`) were written with the assistance of [Kiro][kiro] and
57
+ verified manually, with portions changed as required.
58
+
59
+ - The code of conduct was updated to the Contributor Covenant 3.0.
60
+
38
61
  ## 1.6.2 / 2025-05-12
39
62
 
40
63
  - Handle upcoming changes to the `cgi` gem in Ruby 3.5 ([#147][pull-147])
@@ -60,8 +83,9 @@ This release has significant **breaking changes**.
60
83
 
61
84
  ## 1.6.0 / 2025-02-13
62
85
 
63
- - Baptiste Courtois (@annih) has done significant work on making `bin/ldiff`
64
- work better, contributing a number of issues and pull requests. These include:
86
+ - Baptiste Courtois ([@annih][gh-user-annih]) has done significant work on
87
+ making `bin/ldiff` work better, contributing a number of issues and pull
88
+ requests. These include:
65
89
 
66
90
  - Separation of command parsing from diff-generation in `Diff::LCS::Ldiff`
67
91
  code extraction making it easier to use separately from the `bin/ldiff`
@@ -420,8 +444,8 @@ This release has significant **breaking changes**.
420
444
 
421
445
  ## 1.1.1 / 2004-09-25
422
446
 
423
- - Fixed bug #891 (Set returned from patch command does not contain last equal
424
- part).
447
+ - Fixed bug [#891][gh-issue-891] (Set returned from patch command does not
448
+ contain last equal part).
425
449
 
426
450
  - Fixed a problem with callback initialisation code (it assumed that all
427
451
  callbacks passed as classes can be initialised; now, it rescues NoMethodError
@@ -552,3 +576,6 @@ This release has significant **breaking changes**.
552
576
  [standard ruby]: https://github.com/standardrb/standard
553
577
  [tidelift]: https://tidelift.com/security
554
578
  [tp]: https://guides.rubygems.org/trusted-publishing/
579
+ [kiro]: https://kiro.dev
580
+ [gh-user-annih]: https://github.com/annih
581
+ [gh-issue-891]: https://github.com/halostatue/diff-lcs/issues/891
data/CODE_OF_CONDUCT.md CHANGED
@@ -1,128 +1,166 @@
1
- # Contributor Covenant Code of Conduct
1
+ # Contributor Covenant 3.0 Code of Conduct
2
2
 
3
3
  ## Our Pledge
4
4
 
5
- We as members, contributors, and leaders pledge to make participation in our
6
- community a harassment-free experience for everyone, regardless of age, body
7
- size, visible or invisible disability, ethnicity, sex characteristics, gender
8
- identity and expression, level of experience, education, socio-economic status,
9
- nationality, personal appearance, race, caste, color, religion, or sexual
10
- identity and orientation.
11
-
12
- We pledge to act and interact in ways that contribute to an open, welcoming,
13
- diverse, inclusive, and healthy community.
14
-
15
- ## Our Standards
16
-
17
- Examples of behavior that contributes to a positive environment for our
18
- community include:
19
-
20
- - Demonstrating empathy and kindness toward other people
21
- - Being respectful of differing opinions, viewpoints, and experiences
22
- - Giving and gracefully accepting constructive feedback
23
- - Accepting responsibility and apologizing to those affected by our mistakes,
24
- and learning from the experience
25
- - Focusing on what is best not just for us as individuals, but for the overall
26
- community
27
-
28
- Examples of unacceptable behavior include:
29
-
30
- - The use of sexualized language or imagery, and sexual attention or advances of
31
- any kind
32
- - Trolling, insulting or derogatory comments, and personal or political attacks
33
- - Public or private harassment
34
- - Publishing others' private information, such as a physical or email address,
35
- without their explicit permission
36
- - Other conduct which could reasonably be considered inappropriate in a
37
- professional setting
38
-
39
- ## Enforcement Responsibilities
40
-
41
- Community leaders are responsible for clarifying and enforcing our standards of
42
- acceptable behavior and will take appropriate and fair corrective action in
43
- response to any behavior that they deem inappropriate, threatening, offensive,
44
- or harmful.
45
-
46
- Community leaders have the right and responsibility to remove, edit, or reject
47
- comments, commits, code, wiki edits, issues, and other contributions that are
48
- not aligned to this Code of Conduct, and will communicate reasons for moderation
49
- decisions when appropriate.
5
+ We pledge to make our community welcoming, safe, and equitable for all.
6
+
7
+ We are committed to fostering an environment that respects and promotes the
8
+ dignity, rights, and contributions of all individuals, regardless of
9
+ characteristics including race, ethnicity, caste, color, age, physical
10
+ characteristics, neurodiversity, disability, sex or gender, gender identity or
11
+ expression, sexual orientation, language, philosophy or religion, national or
12
+ social origin, socio-economic position, level of education, or other status. The
13
+ same privileges of participation are extended to everyone who participates in
14
+ good faith and in accordance with this Covenant.
15
+
16
+ ## Encouraged Behaviors
17
+
18
+ While acknowledging differences in social norms, we all strive to meet our
19
+ community's expectations for positive behavior. We also understand that our
20
+ words and actions may be interpreted differently than we intend based on
21
+ culture, background, or native language.
22
+
23
+ With these considerations in mind, we agree to behave mindfully toward each
24
+ other and act in ways that center our shared values, including:
25
+
26
+ 1. Respecting the **purpose of our community**, our activities, and our ways of
27
+ gathering.
28
+ 2. Engaging **kindly and honestly** with others.
29
+ 3. Respecting **different viewpoints** and experiences.
30
+ 4. **Taking responsibility** for our actions and contributions.
31
+ 5. Gracefully giving and accepting **constructive feedback**.
32
+ 6. Committing to **repairing harm** when it occurs.
33
+ 7. Behaving in other ways that promote and sustain the **well-being of our
34
+ community**.
35
+
36
+ ## Restricted Behaviors
37
+
38
+ We agree to restrict the following behaviors in our community. Instances,
39
+ threats, and promotion of these behaviors are violations of this Code of
40
+ Conduct.
41
+
42
+ 1. **Harassment.** Violating explicitly expressed boundaries or engaging in
43
+ unnecessary personal attention after any clear request to stop.
44
+ 2. **Character attacks.** Making insulting, demeaning, or pejorative comments
45
+ directed at a community member or group of people.
46
+ 3. **Stereotyping or discrimination.** Characterizing anyone’s personality or
47
+ behavior on the basis of immutable identities or traits.
48
+ 4. **Sexualization.** Behaving in a way that would generally be considered
49
+ inappropriately intimate in the context or purpose of the community.
50
+ 5. **Violating confidentiality**. Sharing or acting on someone's personal or
51
+ private information without their permission.
52
+ 6. **Endangerment.** Causing, encouraging, or threatening violence or other harm
53
+ toward any person or group.
54
+ 7. Behaving in other ways that **threaten the well-being** of our community.
55
+
56
+ ### Other Restrictions
57
+
58
+ 1. **Misleading identity.** Impersonating someone else for any reason, or
59
+ pretending to be someone else to evade enforcement actions.
60
+ 2. **Failing to credit sources.** Not properly crediting the sources of content
61
+ you contribute.
62
+ 3. **Promotional materials**. Sharing marketing or other commercial content in a
63
+ way that is outside the norms of the community.
64
+ 4. **Irresponsible communication.** Failing to responsibly present content which
65
+ includes, links or describes any other restricted behaviors.
66
+
67
+ ## Reporting an Issue
68
+
69
+ Tensions can occur between community members even when they are trying their
70
+ best to collaborate. Not every conflict represents a code of conduct violation,
71
+ and this Code of Conduct reinforces encouraged behaviors and norms that can help
72
+ avoid conflicts and minimize harm.
73
+
74
+ When an incident does occur, it is important to report it promptly. To report a
75
+ possible violation, create a [private security advisory][advisory] — violations
76
+ of this code of conduct are considered security vulnerabilities.
77
+
78
+ Community Moderators take reports of violations seriously and will make every
79
+ effort to respond in a timely manner. They will investigate all reports of code
80
+ of conduct violations, reviewing messages, logs, and recordings, or interviewing
81
+ witnesses and other participants. Community Moderators will keep investigation
82
+ and enforcement actions as transparent as possible while prioritizing safety and
83
+ confidentiality. In order to honor these values, enforcement actions are carried
84
+ out in private with the involved parties, but communicating to the whole
85
+ community may be part of a mutually agreed upon resolution.
86
+
87
+ ## Addressing and Repairing Harm
88
+
89
+ If an investigation by the Community Moderators finds that this Code of Conduct
90
+ has been violated, the following enforcement ladder may be used to determine how
91
+ best to repair harm, based on the incident's impact on the individuals involved
92
+ and the community as a whole. Depending on the severity of a violation, lower
93
+ rungs on the ladder may be skipped.
94
+
95
+ 1. Warning
96
+ 1. Event: A violation involving a single incident or series of incidents.
97
+ 2. Consequence: A private, written warning from the Community Moderators.
98
+ 3. Repair: Examples of repair include a private written apology,
99
+ acknowledgement of responsibility, and seeking clarification on
100
+ expectations.
101
+
102
+ 2. Temporarily Limited Activities
103
+ 1. Event: A repeated incidence of a violation that previously resulted in a
104
+ warning, or the first incidence of a more serious violation.
105
+ 2. Consequence: A private, written warning with a time-limited cooldown
106
+ period designed to underscore the seriousness of the situation and give
107
+ the community members involved time to process the incident. The cooldown
108
+ period may be limited to particular communication channels or interactions
109
+ with particular community members.
110
+ 3. Repair: Examples of repair may include making an apology, using the
111
+ cooldown period to reflect on actions and impact, and being thoughtful
112
+ about re-entering community spaces after the period is over.
113
+
114
+ 3. Temporary Suspension
115
+ 1. Event: A pattern of repeated violation which the Community Moderators have
116
+ tried to address with warnings, or a single serious violation.
117
+ 2. Consequence: A private written warning with conditions for return from
118
+ suspension. In general, temporary suspensions give the person being
119
+ suspended time to reflect upon their behavior and possible corrective
120
+ actions.
121
+ 3. Repair: Examples of repair include respecting the spirit of the
122
+ suspension, meeting the specified conditions for return, and being
123
+ thoughtful about how to reintegrate with the community when the suspension
124
+ is lifted.
125
+
126
+ 4. Permanent Ban
127
+ 1. Event: A pattern of repeated code of conduct violations that other steps
128
+ on the ladder have failed to resolve, or a violation so serious that the
129
+ Community Moderators determine there is no way to keep the community safe
130
+ with this person as a member.
131
+ 2. Consequence: Access to all community spaces, tools, and communication
132
+ channels is removed. In general, permanent bans should be rarely used,
133
+ should have strong reasoning behind them, and should only be resorted to
134
+ if working through other remedies has failed to change the behavior.
135
+ 3. Repair: There is no possible repair in cases of this severity.
136
+
137
+ This enforcement ladder is intended as a guideline. It does not limit the
138
+ ability of Community Managers to use their discretion and judgment, in keeping
139
+ with the best interests of our community.
50
140
 
51
141
  ## Scope
52
142
 
53
143
  This Code of Conduct applies within all community spaces, and also applies when
54
- an individual is officially representing the community in public spaces.
55
- Examples of representing our community include using an official email address,
56
- posting via an official social media account, or acting as an appointed
144
+ an individual is officially representing the community in public or other
145
+ spaces. Examples of representing our community include using an official email
146
+ address, posting via an official social media account, or acting as an appointed
57
147
  representative at an online or offline event.
58
148
 
59
- ## Enforcement
60
-
61
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
- reported to the community leaders responsible for enforcement at [INSERT CONTACT
63
- METHOD]. All complaints will be reviewed and investigated promptly and fairly.
64
-
65
- All community leaders are obligated to respect the privacy and security of the
66
- reporter of any incident.
67
-
68
- ## Enforcement Guidelines
69
-
70
- Community leaders will follow these Community Impact Guidelines in determining
71
- the consequences for any action they deem in violation of this Code of Conduct:
72
-
73
- ### 1. Correction
74
-
75
- **Community Impact**: Use of inappropriate language or other behavior deemed
76
- unprofessional or unwelcome in the community.
77
-
78
- **Consequence**: A private, written warning from community leaders, providing
79
- clarity around the nature of the violation and an explanation of why the
80
- behavior was inappropriate. A public apology may be requested.
81
-
82
- ### 2. Warning
83
-
84
- **Community Impact**: A violation through a single incident or series of
85
- actions.
86
-
87
- **Consequence**: A warning with consequences for continued behavior. No
88
- interaction with the people involved, including unsolicited interaction with
89
- those enforcing the Code of Conduct, for a specified period of time. This
90
- includes avoiding interactions in community spaces as well as external channels
91
- like social media. Violating these terms may lead to a temporary or permanent
92
- ban.
93
-
94
- ### 3. Temporary Ban
95
-
96
- **Community Impact**: A serious violation of community standards, including
97
- sustained inappropriate behavior.
98
-
99
- **Consequence**: A temporary ban from any sort of interaction or public
100
- communication with the community for a specified period of time. No public or
101
- private interaction with the people involved, including unsolicited interaction
102
- with those enforcing the Code of Conduct, is allowed during this period.
103
- Violating these terms may lead to a permanent ban.
104
-
105
- ### 4. Permanent Ban
106
-
107
- **Community Impact**: Demonstrating a pattern of violation of community
108
- standards, including sustained inappropriate behavior, harassment of an
109
- individual, or aggression toward or disparagement of classes of individuals.
110
-
111
- **Consequence**: A permanent ban from any sort of public interaction within the
112
- community.
113
-
114
149
  ## Attribution
115
150
 
116
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
117
- version 2.1, available at
118
- <https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>.
151
+ This Code of Conduct is adapted from the Contributor Covenant, version 3.0,
152
+ permanently available at <https://www.contributor-covenant.org/version/3/0/>.
119
153
 
120
- Community Impact Guidelines were inspired by
121
- [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
154
+ Contributor Covenant is stewarded by the Organization for Ethical Source and
155
+ licensed under CC BY-SA 4.0. To view a copy of this license, visit
156
+ <https://creativecommons.org/licenses/by-sa/4.0/>.
122
157
 
123
- For answers to common questions about this code of conduct, see the FAQ at
124
- <https://www.contributor-covenant.org/faq>. Translations are available at
125
- <https://www.contributor-covenant.org/translations>.
158
+ For answers to common questions about Contributor Covenant, see the FAQ at
159
+ <https://www.contributor-covenant.org/faq>. Translations are provided at
160
+ <https://www.contributor-covenant.org/translations>. Additional enforcement and
161
+ community guideline resources can be found at
162
+ <https://www.contributor-covenant.org/resources>. The enforcement ladder was
163
+ inspired by the work of [Mozilla’s code of conduct team][inclusion].
126
164
 
127
- [homepage]: https://www.contributor-covenant.org
128
- [Mozilla CoC]: https://github.com/mozilla/diversity
165
+ [advisory]: https://github.com/halostatue/diff-lcs/security/advisories/new
166
+ [inclusion]: https://github.com/mozilla/inclusion
data/CONTRIBUTING.md CHANGED
@@ -13,7 +13,11 @@ diff-lcs is governed under the [Contributor Covenant Code of Conduct][cccoc].
13
13
  I have several guidelines to contributing code through pull requests:
14
14
 
15
15
  - All code changes require tests. In most cases, this will be added or updated
16
- unit tests. I use [RSpec][rspec].
16
+ unit tests. I use [Minitest][minitest].
17
+
18
+ - There are integration tests with RSpec which must not be broken, accessible
19
+ through `rake integration`. This requires a non-bundled RSpec,
20
+ `gem install rspec`.
17
21
 
18
22
  - I use code formatters, static analysis tools, and linting to ensure consistent
19
23
  styles and formatting. There should be no warning output from test run
@@ -115,8 +119,9 @@ required metadata trailers are:
115
119
  [dco]: licences/dco.txt
116
120
  [hoe]: https://github.com/seattlerb/hoe
117
121
  [issues]: https://github.com/halostatue/diff-lcs/issues
118
- [rspec]: http://rspec.info/documentation/
122
+ [minitest]: https://github.com/seattlerb/minitest
123
+ [rspec]: https://rspec.info/documentation/
119
124
  [standardrb]: https://github.com/standardrb/standard
120
- [tpope-qcm]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
125
+ [tpope-qcm]: https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
121
126
  [trailers1]: https://git-scm.com/docs/git-interpret-trailers
122
127
  [trailers2]: https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---trailerlttokengtltvaluegt
data/CONTRIBUTORS.md CHANGED
@@ -1,26 +1,26 @@
1
1
  # Contributors
2
2
 
3
- - Austin Ziegler (@halostatue) created diff-lcs.
3
+ - Austin Ziegler ([@halostatue][gh-user-halostatue]) created diff-lcs.
4
4
 
5
5
  Thanks to everyone else who has contributed to diff-lcs over the years:
6
6
 
7
- - @ginriki
8
- - @joshbronson
9
- - @kevinmook
10
- - @mckaz
7
+ - [@ginriki][gh-user-ginriki]
8
+ - [@joshbronson][gh-user-joshbronson]
9
+ - [@kevinmook][gh-user-kevinmook]
10
+ - [@mckaz][gh-user-mckaz]
11
11
  - Akinori Musha
12
12
  - Artem Ignatyev
13
13
  - Brandon Fish
14
- - Baptiste Courtois (@annih)
14
+ - Baptiste Courtois ([@annih][gh-user-annih])
15
15
  - Camille Drapier
16
16
  - Cédric Boutillier
17
- - @earlopain
17
+ - [@earlopain][gh-user-earlopain]
18
18
  - Gregg Kellogg
19
19
  - Jagdeep Singh
20
20
  - Jason Gladish
21
21
  - Jon Rowe
22
22
  - Josef Strzibny
23
- - Josep (@apuratepp)
23
+ - Josep ([@apuratepp][gh-user-apuratepp])
24
24
  - Josh Bronson
25
25
  - Jun Aruga
26
26
  - Justin Steele
@@ -44,6 +44,16 @@ Thanks to everyone else who has contributed to diff-lcs over the years:
44
44
  - Ryan Lovelett
45
45
  - Scott Steele
46
46
  - Simon Courtois
47
- - Tien (@tiendo1011)
47
+ - Tien ([@tiendo1011][gh-user-tiendo1011])
48
48
  - Tomas Jura
49
49
  - Vít Ondruch
50
+
51
+ [gh-user-halostatue]: https://github.com/halostatue
52
+ [gh-user-ginriki]: https://github.com/ginriki
53
+ [gh-user-joshbronson]: https://github.com/joshbronson
54
+ [gh-user-kevinmook]: https://github.com/kevinmook
55
+ [gh-user-mckaz]: https://github.com/mckaz
56
+ [gh-user-annih]: https://github.com/annih
57
+ [gh-user-earlopain]: https://github.com/earlopain
58
+ [gh-user-apuratepp]: https://github.com/apuratepp
59
+ [gh-user-tiendo1011]: https://github.com/tiendo1011
data/Manifest.txt CHANGED
@@ -8,6 +8,12 @@ README.md
8
8
  Rakefile
9
9
  SECURITY.md
10
10
  bin/ldiff
11
+ integration/compare/array_diff_spec.rb
12
+ integration/compare/hash_diff_spec.rb
13
+ integration/compare/string_diff_spec.rb
14
+ integration/rspec_differ_spec.rb
15
+ integration/rspec_expectations_spec.rb
16
+ integration/runner
11
17
  lib/diff-lcs.rb
12
18
  lib/diff/lcs.rb
13
19
  lib/diff/lcs/array.rb
@@ -24,76 +30,6 @@ licenses/artistic.txt
24
30
  licenses/dco.txt
25
31
  spec/change_spec.rb
26
32
  spec/diff_spec.rb
27
- spec/fixtures/123_x
28
- spec/fixtures/456_x
29
- spec/fixtures/aX
30
- spec/fixtures/bXaX
31
- spec/fixtures/ds1.csv
32
- spec/fixtures/ds2.csv
33
- spec/fixtures/empty
34
- spec/fixtures/file1.bin
35
- spec/fixtures/file2.bin
36
- spec/fixtures/four_lines
37
- spec/fixtures/four_lines_with_missing_new_line
38
- spec/fixtures/ldiff/diff.missing_new_line1-e
39
- spec/fixtures/ldiff/diff.missing_new_line1-f
40
- spec/fixtures/ldiff/diff.missing_new_line2-e
41
- spec/fixtures/ldiff/diff.missing_new_line2-f
42
- spec/fixtures/ldiff/error.diff.chef-e
43
- spec/fixtures/ldiff/error.diff.chef-f
44
- spec/fixtures/ldiff/error.diff.missing_new_line1-e
45
- spec/fixtures/ldiff/error.diff.missing_new_line1-f
46
- spec/fixtures/ldiff/error.diff.missing_new_line2-e
47
- spec/fixtures/ldiff/error.diff.missing_new_line2-f
48
- spec/fixtures/ldiff/output.diff
49
- spec/fixtures/ldiff/output.diff-c
50
- spec/fixtures/ldiff/output.diff-u
51
- spec/fixtures/ldiff/output.diff.bin1
52
- spec/fixtures/ldiff/output.diff.bin1-c
53
- spec/fixtures/ldiff/output.diff.bin1-e
54
- spec/fixtures/ldiff/output.diff.bin1-f
55
- spec/fixtures/ldiff/output.diff.bin1-u
56
- spec/fixtures/ldiff/output.diff.bin2
57
- spec/fixtures/ldiff/output.diff.bin2-c
58
- spec/fixtures/ldiff/output.diff.bin2-e
59
- spec/fixtures/ldiff/output.diff.bin2-f
60
- spec/fixtures/ldiff/output.diff.bin2-u
61
- spec/fixtures/ldiff/output.diff.chef
62
- spec/fixtures/ldiff/output.diff.chef-c
63
- spec/fixtures/ldiff/output.diff.chef-u
64
- spec/fixtures/ldiff/output.diff.chef2
65
- spec/fixtures/ldiff/output.diff.chef2-c
66
- spec/fixtures/ldiff/output.diff.chef2-d
67
- spec/fixtures/ldiff/output.diff.chef2-u
68
- spec/fixtures/ldiff/output.diff.empty.vs.four_lines
69
- spec/fixtures/ldiff/output.diff.empty.vs.four_lines-c
70
- spec/fixtures/ldiff/output.diff.empty.vs.four_lines-e
71
- spec/fixtures/ldiff/output.diff.empty.vs.four_lines-f
72
- spec/fixtures/ldiff/output.diff.empty.vs.four_lines-u
73
- spec/fixtures/ldiff/output.diff.four_lines.vs.empty
74
- spec/fixtures/ldiff/output.diff.four_lines.vs.empty-c
75
- spec/fixtures/ldiff/output.diff.four_lines.vs.empty-e
76
- spec/fixtures/ldiff/output.diff.four_lines.vs.empty-f
77
- spec/fixtures/ldiff/output.diff.four_lines.vs.empty-u
78
- spec/fixtures/ldiff/output.diff.issue95_trailing_context
79
- spec/fixtures/ldiff/output.diff.issue95_trailing_context-c
80
- spec/fixtures/ldiff/output.diff.issue95_trailing_context-e
81
- spec/fixtures/ldiff/output.diff.issue95_trailing_context-f
82
- spec/fixtures/ldiff/output.diff.issue95_trailing_context-u
83
- spec/fixtures/ldiff/output.diff.missing_new_line1
84
- spec/fixtures/ldiff/output.diff.missing_new_line1-c
85
- spec/fixtures/ldiff/output.diff.missing_new_line1-e
86
- spec/fixtures/ldiff/output.diff.missing_new_line1-f
87
- spec/fixtures/ldiff/output.diff.missing_new_line1-u
88
- spec/fixtures/ldiff/output.diff.missing_new_line2
89
- spec/fixtures/ldiff/output.diff.missing_new_line2-c
90
- spec/fixtures/ldiff/output.diff.missing_new_line2-e
91
- spec/fixtures/ldiff/output.diff.missing_new_line2-f
92
- spec/fixtures/ldiff/output.diff.missing_new_line2-u
93
- spec/fixtures/new-chef
94
- spec/fixtures/new-chef2
95
- spec/fixtures/old-chef
96
- spec/fixtures/old-chef2
97
33
  spec/hunk_spec.rb
98
34
  spec/issues_spec.rb
99
35
  spec/lcs_spec.rb
@@ -103,3 +39,85 @@ spec/sdiff_spec.rb
103
39
  spec/spec_helper.rb
104
40
  spec/traverse_balanced_spec.rb
105
41
  spec/traverse_sequences_spec.rb
42
+ test/fixtures/123_x
43
+ test/fixtures/456_x
44
+ test/fixtures/aX
45
+ test/fixtures/bXaX
46
+ test/fixtures/ds1.csv
47
+ test/fixtures/ds2.csv
48
+ test/fixtures/empty
49
+ test/fixtures/file1.bin
50
+ test/fixtures/file2.bin
51
+ test/fixtures/four_lines
52
+ test/fixtures/four_lines_with_missing_new_line
53
+ test/fixtures/ldiff/diff.missing_new_line1-e
54
+ test/fixtures/ldiff/diff.missing_new_line1-f
55
+ test/fixtures/ldiff/diff.missing_new_line2-e
56
+ test/fixtures/ldiff/diff.missing_new_line2-f
57
+ test/fixtures/ldiff/error.diff.chef-e
58
+ test/fixtures/ldiff/error.diff.chef-f
59
+ test/fixtures/ldiff/error.diff.missing_new_line1-e
60
+ test/fixtures/ldiff/error.diff.missing_new_line1-f
61
+ test/fixtures/ldiff/error.diff.missing_new_line2-e
62
+ test/fixtures/ldiff/error.diff.missing_new_line2-f
63
+ test/fixtures/ldiff/output.diff
64
+ test/fixtures/ldiff/output.diff-c
65
+ test/fixtures/ldiff/output.diff-u
66
+ test/fixtures/ldiff/output.diff.bin1
67
+ test/fixtures/ldiff/output.diff.bin1-c
68
+ test/fixtures/ldiff/output.diff.bin1-e
69
+ test/fixtures/ldiff/output.diff.bin1-f
70
+ test/fixtures/ldiff/output.diff.bin1-u
71
+ test/fixtures/ldiff/output.diff.bin2
72
+ test/fixtures/ldiff/output.diff.bin2-c
73
+ test/fixtures/ldiff/output.diff.bin2-e
74
+ test/fixtures/ldiff/output.diff.bin2-f
75
+ test/fixtures/ldiff/output.diff.bin2-u
76
+ test/fixtures/ldiff/output.diff.chef
77
+ test/fixtures/ldiff/output.diff.chef-c
78
+ test/fixtures/ldiff/output.diff.chef-u
79
+ test/fixtures/ldiff/output.diff.chef2
80
+ test/fixtures/ldiff/output.diff.chef2-c
81
+ test/fixtures/ldiff/output.diff.chef2-d
82
+ test/fixtures/ldiff/output.diff.chef2-u
83
+ test/fixtures/ldiff/output.diff.empty.vs.four_lines
84
+ test/fixtures/ldiff/output.diff.empty.vs.four_lines-c
85
+ test/fixtures/ldiff/output.diff.empty.vs.four_lines-e
86
+ test/fixtures/ldiff/output.diff.empty.vs.four_lines-f
87
+ test/fixtures/ldiff/output.diff.empty.vs.four_lines-u
88
+ test/fixtures/ldiff/output.diff.four_lines.vs.empty
89
+ test/fixtures/ldiff/output.diff.four_lines.vs.empty-c
90
+ test/fixtures/ldiff/output.diff.four_lines.vs.empty-e
91
+ test/fixtures/ldiff/output.diff.four_lines.vs.empty-f
92
+ test/fixtures/ldiff/output.diff.four_lines.vs.empty-u
93
+ test/fixtures/ldiff/output.diff.issue95_trailing_context
94
+ test/fixtures/ldiff/output.diff.issue95_trailing_context-c
95
+ test/fixtures/ldiff/output.diff.issue95_trailing_context-e
96
+ test/fixtures/ldiff/output.diff.issue95_trailing_context-f
97
+ test/fixtures/ldiff/output.diff.issue95_trailing_context-u
98
+ test/fixtures/ldiff/output.diff.missing_new_line1
99
+ test/fixtures/ldiff/output.diff.missing_new_line1-c
100
+ test/fixtures/ldiff/output.diff.missing_new_line1-e
101
+ test/fixtures/ldiff/output.diff.missing_new_line1-f
102
+ test/fixtures/ldiff/output.diff.missing_new_line1-u
103
+ test/fixtures/ldiff/output.diff.missing_new_line2
104
+ test/fixtures/ldiff/output.diff.missing_new_line2-c
105
+ test/fixtures/ldiff/output.diff.missing_new_line2-e
106
+ test/fixtures/ldiff/output.diff.missing_new_line2-f
107
+ test/fixtures/ldiff/output.diff.missing_new_line2-u
108
+ test/fixtures/new-chef
109
+ test/fixtures/new-chef2
110
+ test/fixtures/old-chef
111
+ test/fixtures/old-chef2
112
+ test/test_block.rb
113
+ test/test_change.rb
114
+ test/test_diff.rb
115
+ test/test_helper.rb
116
+ test/test_hunk.rb
117
+ test/test_issues.rb
118
+ test/test_lcs.rb
119
+ test/test_ldiff.rb
120
+ test/test_patch.rb
121
+ test/test_sdiff.rb
122
+ test/test_traverse_balanced.rb
123
+ test/test_traverse_sequences.rb