summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Ziegler <austin@zieglers.ca>2021-12-23 00:53:34 -0500
committerAustin Ziegler <austin@zieglers.ca>2021-12-23 00:53:34 -0500
commit66c70146f9d8889eeb4ea7867e97a2688f01ad4b (patch)
tree42557f32b12759a2362d36e0350634be4bbe0e43
parentbdd6be06451310d5a33ae38afbad655fd6737169 (diff)
downloaddiff-lcs-66c70146f9d8889eeb4ea7867e97a2688f01ad4b.tar.gz
Move docs
-rw-r--r--.gitignore3
-rw-r--r--doc/Array.html105
-rw-r--r--doc/Code-of-Conduct_md.html157
-rw-r--r--doc/Contributing_md.html246
-rw-r--r--doc/Diff.html91
-rw-r--r--doc/Diff/LCS/Internals.html360
-rw-r--r--doc/Diff/LCS/Ldiff.html91
-rw-r--r--doc/Fixnum.html134
-rw-r--r--doc/History_md.html407
-rw-r--r--doc/LCS.html1119
-rw-r--r--doc/LCS/Block.html240
-rw-r--r--doc/LCS/Change.html500
-rw-r--r--doc/LCS/ContextChange.html353
-rw-r--r--doc/LCS/ContextDiffCallbacks.html255
-rw-r--r--doc/LCS/DefaultCallbacks.html207
-rw-r--r--doc/LCS/DiffCallbacks.html305
-rw-r--r--doc/LCS/HTMLDiff.html231
-rw-r--r--doc/LCS/Hunk.html397
-rw-r--r--doc/LCS/SDiffCallbacks.html312
-rw-r--r--doc/License_md.html110
-rw-r--r--doc/Manifest_txt.html91
-rw-r--r--doc/README_rdoc.html170
-rw-r--r--doc/String.html105
-rw-r--r--doc/created.rid21
-rw-r--r--doc/css/fonts.css167
-rw-r--r--doc/css/rdoc.css639
-rw-r--r--doc/docs/COPYING_txt.html299
-rw-r--r--doc/docs/artistic_txt.html204
-rw-r--r--doc/fonts/Lato-Light.ttfbin0 -> 94668 bytes
-rw-r--r--doc/fonts/Lato-LightItalic.ttfbin0 -> 94196 bytes
-rw-r--r--doc/fonts/Lato-Regular.ttfbin0 -> 96184 bytes
-rw-r--r--doc/fonts/Lato-RegularItalic.ttfbin0 -> 95316 bytes
-rw-r--r--doc/fonts/SourceCodePro-Bold.ttfbin0 -> 71200 bytes
-rw-r--r--doc/fonts/SourceCodePro-Regular.ttfbin0 -> 71692 bytes
-rw-r--r--doc/images/add.pngbin0 -> 733 bytes
-rw-r--r--doc/images/arrow_up.pngbin0 -> 372 bytes
-rw-r--r--doc/images/brick.pngbin0 -> 452 bytes
-rw-r--r--doc/images/brick_link.pngbin0 -> 764 bytes
-rw-r--r--doc/images/bug.pngbin0 -> 774 bytes
-rw-r--r--doc/images/bullet_black.pngbin0 -> 211 bytes
-rw-r--r--doc/images/bullet_toggle_minus.pngbin0 -> 207 bytes
-rw-r--r--doc/images/bullet_toggle_plus.pngbin0 -> 209 bytes
-rw-r--r--doc/images/date.pngbin0 -> 626 bytes
-rw-r--r--doc/images/delete.pngbin0 -> 715 bytes
-rw-r--r--doc/images/find.pngbin0 -> 659 bytes
-rw-r--r--doc/images/loadingAnimation.gifbin0 -> 5886 bytes
-rw-r--r--doc/images/macFFBgHack.pngbin0 -> 207 bytes
-rw-r--r--doc/images/package.pngbin0 -> 853 bytes
-rw-r--r--doc/images/page_green.pngbin0 -> 621 bytes
-rw-r--r--doc/images/page_white_text.pngbin0 -> 342 bytes
-rw-r--r--doc/images/page_white_width.pngbin0 -> 309 bytes
-rw-r--r--doc/images/plugin.pngbin0 -> 591 bytes
-rw-r--r--doc/images/ruby.pngbin0 -> 592 bytes
-rw-r--r--doc/images/tag_blue.pngbin0 -> 1880 bytes
-rw-r--r--doc/images/tag_green.pngbin0 -> 613 bytes
-rw-r--r--doc/images/transparent.pngbin0 -> 97 bytes
-rw-r--r--doc/images/wrench.pngbin0 -> 610 bytes
-rw-r--r--doc/images/wrench_orange.pngbin0 -> 584 bytes
-rw-r--r--doc/images/zoom.pngbin0 -> 692 bytes
-rw-r--r--doc/index.html184
-rw-r--r--doc/js/darkfish.js84
-rw-r--r--doc/js/navigation.js105
-rw-r--r--doc/js/navigation.js.gzbin0 -> 833 bytes
-rw-r--r--doc/js/search.js110
-rw-r--r--doc/js/search_index.js1
-rw-r--r--doc/js/search_index.js.gzbin0 -> 3942 bytes
-rw-r--r--doc/js/searcher.js229
-rw-r--r--doc/js/searcher.js.gzbin0 -> 1688 bytes
-rw-r--r--doc/table_of_contents.html717
-rw-r--r--index.html84
70 files changed, 8749 insertions, 84 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e52d7fc
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+research/
+.byebug_history
+Gemfile.lock
diff --git a/doc/Array.html b/doc/Array.html
new file mode 100644
index 0000000..2a6d8e5
--- /dev/null
+++ b/doc/Array.html
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>class Array - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "./";
+ var index_rel_prefix = "./";
+</script>
+
+<script src="./js/navigation.js" defer></script>
+<script src="./js/search.js" defer></script>
+<script src="./js/search_index.js" defer></script>
+<script src="./js/searcher.js" defer></script>
+<script src="./js/darkfish.js" defer></script>
+
+<link href="./css/fonts.css" rel="stylesheet">
+<link href="./css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="class">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="./index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="./table_of_contents.html#pages">Pages</a>
+ <a href="./table_of_contents.html#classes">Classes</a>
+ <a href="./table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+
+ <div id="class-metadata">
+
+
+<div id="parent-class-section" class="nav-section">
+ <h3>Parent</h3>
+
+ <p class="link">Object
+</div>
+
+
+<div id="includes-section" class="nav-section">
+ <h3>Included Modules</h3>
+
+ <ul class="link-list">
+ <li><a class="include" href="LCS.html">LCS</a>
+ </ul>
+</div>
+
+
+
+ </div>
+</nav>
+
+<main role="main" aria-labelledby="class-Array">
+ <h1 id="class-Array" class="class">
+ class Array
+ </h1>
+
+ <section class="description">
+
+ </section>
+
+ <section id="5Buntitled-5D" class="documentation-section">
+
+
+
+
+
+ </section>
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/Code-of-Conduct_md.html b/doc/Code-of-Conduct_md.html
new file mode 100644
index 0000000..c8f7f5d
--- /dev/null
+++ b/doc/Code-of-Conduct_md.html
@@ -0,0 +1,157 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>Code-of-Conduct - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "./";
+ var index_rel_prefix = "./";
+</script>
+
+<script src="./js/navigation.js" defer></script>
+<script src="./js/search.js" defer></script>
+<script src="./js/search_index.js" defer></script>
+<script src="./js/searcher.js" defer></script>
+<script src="./js/darkfish.js" defer></script>
+
+<link href="./css/fonts.css" rel="stylesheet">
+<link href="./css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="file">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="./index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="./table_of_contents.html#pages">Pages</a>
+ <a href="./table_of_contents.html#classes">Classes</a>
+ <a href="./table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+<div class="nav-section">
+ <h3>Table of Contents</h3>
+
+ <ul class="link-list" role="directory">
+ <li><a href="#label-Contributor+Covenant+Code+of+Conduct">Contributor Covenant Code of Conduct</a>
+ <li><a href="#label-Our+Pledge">Our Pledge</a>
+ <li><a href="#label-Our+Standards">Our Standards</a>
+ <li><a href="#label-Our+Responsibilities">Our Responsibilities</a>
+ <li><a href="#label-Scope">Scope</a>
+ <li><a href="#label-Enforcement">Enforcement</a>
+ <li><a href="#label-Attribution">Attribution</a>
+ </ul>
+</div>
+
+
+ <div id="project-metadata">
+
+<div id="fileindex-section" class="nav-section">
+ <h3>Pages</h3>
+
+ <ul class="link-list">
+ <li><a href="./Code-of-Conduct_md.html">Code-of-Conduct</a>
+ <li><a href="./Contributing_md.html">Contributing</a>
+ <li><a href="./History_md.html">History</a>
+ <li><a href="./License_md.html">License</a>
+ <li><a href="./Manifest_txt.html">Manifest</a>
+ <li><a href="./README_rdoc.html">README</a>
+ <li><a href="./docs/COPYING_txt.html">COPYING</a>
+ <li><a href="./docs/artistic_txt.html">artistic</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-label="Page Code-of-Conduct.md">
+
+<h1 id="label-Contributor+Covenant+Code+of+Conduct">Contributor Covenant Code of Conduct<span><a href="#label-Contributor+Covenant+Code+of+Conduct">&para;</a> <a href="#top">&uarr;</a></span></h1>
+
+<h2 id="label-Our+Pledge">Our Pledge<span><a href="#label-Our+Pledge">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<p>In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.</p>
+
+<h2 id="label-Our+Standards">Our Standards<span><a href="#label-Our+Standards">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<p>Examples of behavior that contributes to creating a positive environment include:</p>
+<ul><li>
+<p>Using welcoming and inclusive language</p>
+</li><li>
+<p>Being respectful of differing viewpoints and experiences</p>
+</li><li>
+<p>Gracefully accepting constructive criticism</p>
+</li><li>
+<p>Focusing on what is best for the community</p>
+</li><li>
+<p>Showing empathy towards other community members</p>
+</li></ul>
+
+<p>Examples of unacceptable behavior by participants include:</p>
+<ul><li>
+<p>The use of sexualized language or imagery and unwelcome sexual attention or advances</p>
+</li><li>
+<p>Trolling, insulting/derogatory comments, and personal or political attacks</p>
+</li><li>
+<p>Public or private harassment</p>
+</li><li>
+<p>Publishing others&#39; private information, such as a physical or electronic address, without explicit permission</p>
+</li><li>
+<p>Other conduct which could reasonably be considered inappropriate in a professional setting</p>
+</li></ul>
+
+<h2 id="label-Our+Responsibilities">Our Responsibilities<span><a href="#label-Our+Responsibilities">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<p>Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.</p>
+
+<p>Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.</p>
+
+<h2 id="label-Scope">Scope<span><a href="#label-Scope">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<p>This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.</p>
+
+<h2 id="label-Enforcement">Enforcement<span><a href="#label-Enforcement">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<p>Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [INSERT EMAIL ADDRESS]. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.</p>
+
+<p>Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project&#39;s leadership.</p>
+
+<h2 id="label-Attribution">Attribution<span><a href="#label-Attribution">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<p>This Code of Conduct is adapted from the <a href="http://contributor-covenant.org">Contributor Covenant</a>, version 1.4, available at <a href="http://contributor-covenant.org/version/1/4/">contributor-covenant.org/version/1/4</a></p>
+
+</main>
+
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/Contributing_md.html b/doc/Contributing_md.html
new file mode 100644
index 0000000..09d1a46
--- /dev/null
+++ b/doc/Contributing_md.html
@@ -0,0 +1,246 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>Contributing - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "./";
+ var index_rel_prefix = "./";
+</script>
+
+<script src="./js/navigation.js" defer></script>
+<script src="./js/search.js" defer></script>
+<script src="./js/search_index.js" defer></script>
+<script src="./js/searcher.js" defer></script>
+<script src="./js/darkfish.js" defer></script>
+
+<link href="./css/fonts.css" rel="stylesheet">
+<link href="./css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="file">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="./index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="./table_of_contents.html#pages">Pages</a>
+ <a href="./table_of_contents.html#classes">Classes</a>
+ <a href="./table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+<div class="nav-section">
+ <h3>Table of Contents</h3>
+
+ <ul class="link-list" role="directory">
+ <li><a href="#label-Contributing">Contributing</a>
+ <li><a href="#label-Test+Dependencies">Test Dependencies</a>
+ <li><a href="#label-Workflow">Workflow</a>
+ <li><a href="#label-Contributors">Contributors</a>
+ </ul>
+</div>
+
+
+ <div id="project-metadata">
+
+<div id="fileindex-section" class="nav-section">
+ <h3>Pages</h3>
+
+ <ul class="link-list">
+ <li><a href="./Code-of-Conduct_md.html">Code-of-Conduct</a>
+ <li><a href="./Contributing_md.html">Contributing</a>
+ <li><a href="./History_md.html">History</a>
+ <li><a href="./License_md.html">License</a>
+ <li><a href="./Manifest_txt.html">Manifest</a>
+ <li><a href="./README_rdoc.html">README</a>
+ <li><a href="./docs/COPYING_txt.html">COPYING</a>
+ <li><a href="./docs/artistic_txt.html">artistic</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-label="Page Contributing.md">
+
+<h2 id="label-Contributing"><a href="Contributing_md.html">Contributing</a><span><a href="#label-Contributing">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<p>I value any contribution to <a href="LCS.html"><code>Diff::LCS</code></a> you can provide: a bug report, a feature request, or code contributions. Code contributions to <a href="LCS.html"><code>Diff::LCS</code></a> are especially &lt;del&gt;welcome&lt;/del&gt;encouraged. Because <a href="LCS.html"><code>Diff::LCS</code></a> is a complex codebase, there are a few guidelines:</p>
+<ul><li>
+<p>Code changes <em>will not</em> be accepted without tests. The test suite is written with [RSpec][].</p>
+</li><li>
+<p>Match my coding style.</p>
+</li><li>
+<p>Use a thoughtfully-named topic branch that contains your change. Rebase your commits into logical chunks as necessary.</p>
+</li><li>
+<p>Use <a href="http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html">quality commit messages</a>.</p>
+</li><li>
+<p>Do not change the version number; when your patch is accepted and a release is made, the version will be updated at that point.</p>
+</li><li>
+<p>Submit a GitHub pull request with your changes.</p>
+</li><li>
+<p>New or changed behaviours require appropriate documentation.</p>
+</li></ul>
+
+<h3 id="label-Test+Dependencies">Test Dependencies<span><a href="#label-Test+Dependencies">&para;</a> <a href="#top">&uarr;</a></span></h3>
+
+<p><a href="LCS.html"><code>Diff::LCS</code></a> uses Ryan Davis’s [Hoe][] to manage the release process, and it adds a number of rake tasks. You will mostly be interested in:</p>
+
+<pre>$ rake</pre>
+
+<p>which runs the tests the same way that:</p>
+
+<pre>$ rake spec</pre>
+
+<p>will do.</p>
+
+<p>To assist with the installation of the development dependencies, I have provided a Gemfile pointing to the (generated) <code>diff-lcs.gemspec</code> file. This will permit you to do:</p>
+
+<pre>$ bundle install</pre>
+
+<p>to get the development dependencies. If you aleady have <code>hoe</code> installed, you can accomplish the same thing with:</p>
+
+<pre>$ rake newb</pre>
+
+<p>This task will install any missing dependencies, run the tests/specs, and generate the RDoc.</p>
+
+<p>You can run tests with code coverage analysis by running:</p>
+
+<pre>$ rake spec:coverage</pre>
+
+<h3 id="label-Workflow">Workflow<span><a href="#label-Workflow">&para;</a> <a href="#top">&uarr;</a></span></h3>
+
+<p>Here&#39;s the most direct way to get your work merged into the project:</p>
+<ul><li>
+<p>Fork the project.</p>
+</li><li>
+<p>Clone down your fork (<code>git clone git://github.com/&lt;username&gt;/diff-lcs.git</code>).</p>
+</li><li>
+<p>Create a topic branch to contain your change (<code>git checkout -b my_awesome_feature</code>).</p>
+</li><li>
+<p>Hack away, add tests. Not necessarily in that order.</p>
+</li><li>
+<p>Make sure everything still passes by running <code>rake</code>.</p>
+</li><li>
+<p>If necessary, rebase your commits into logical chunks, without errors.</p>
+</li><li>
+<p>Push the branch up (<code>git push origin my_awesome_feature</code>).</p>
+</li><li>
+<p>Create a pull request against halostatue/diff-lcs and describe what your change does and the why you think it should be merged.</p>
+</li></ul>
+
+<h3 id="label-Contributors">Contributors<span><a href="#label-Contributors">&para;</a> <a href="#top">&uarr;</a></span></h3>
+<ul><li>
+<p>Austin Ziegler created <a href="LCS.html"><code>Diff::LCS</code></a>.</p>
+</li></ul>
+
+<p>Thanks to everyone else who has contributed code or bug reports to Diff::LCS:</p>
+<ul><li>
+<p>@ginriki</p>
+</li><li>
+<p>@joshbronson</p>
+</li><li>
+<p>@kevinmook</p>
+</li><li>
+<p>@mckaz</p>
+</li><li>
+<p>Akinori Musha</p>
+</li><li>
+<p>Artem Ignatyev</p>
+</li><li>
+<p>Brandon Fish</p>
+</li><li>
+<p>Camille Drapier</p>
+</li><li>
+<p>Cédric Boutillier</p>
+</li><li>
+<p>Gregg Kellogg</p>
+</li><li>
+<p>Jagdeep Singh</p>
+</li><li>
+<p>Jason Gladish</p>
+</li><li>
+<p>Jon Rowe</p>
+</li><li>
+<p>Josef Strzibny</p>
+</li><li>
+<p>Josep (@apuratepp)</p>
+</li><li>
+<p>Josh Bronson</p>
+</li><li>
+<p>Jun Aruga</p>
+</li><li>
+<p>Kenichi Kamiya</p>
+</li><li>
+<p>Kensuke Nagae</p>
+</li><li>
+<p>Kevin Ansfield</p>
+</li><li>
+<p>Koichi Ito</p>
+</li><li>
+<p>Mark Friedgan</p>
+</li><li>
+<p>Michael Granger</p>
+</li><li>
+<p>Myron Marston</p>
+</li><li>
+<p>Nicolas Leger</p>
+</li><li>
+<p>Oleg Orlov</p>
+</li><li>
+<p>Paul Kunysch</p>
+</li><li>
+<p>Pete Higgins</p>
+</li><li>
+<p>Peter Wagenet</p>
+</li><li>
+<p>Philippe Lafoucrière</p>
+</li><li>
+<p>Ryan Lovelett</p>
+</li><li>
+<p>Scott Steele</p>
+</li><li>
+<p>Simon Courtois</p>
+</li><li>
+<p>Tien (@tiendo1011)</p>
+</li><li>
+<p>Tomas Jura</p>
+</li><li>
+<p>Vít Ondruch</p>
+</li></ul>
+
+</main>
+
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/Diff.html b/doc/Diff.html
new file mode 100644
index 0000000..8fa95fe
--- /dev/null
+++ b/doc/Diff.html
@@ -0,0 +1,91 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>module Diff - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "./";
+ var index_rel_prefix = "./";
+</script>
+
+<script src="./js/navigation.js" defer></script>
+<script src="./js/search.js" defer></script>
+<script src="./js/search_index.js" defer></script>
+<script src="./js/searcher.js" defer></script>
+<script src="./js/darkfish.js" defer></script>
+
+<link href="./css/fonts.css" rel="stylesheet">
+<link href="./css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="module">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="./index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="./table_of_contents.html#pages">Pages</a>
+ <a href="./table_of_contents.html#classes">Classes</a>
+ <a href="./table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+
+ <div id="class-metadata">
+
+
+
+
+
+ </div>
+</nav>
+
+<main role="main" aria-labelledby="module-Diff">
+ <h1 id="module-Diff" class="module">
+ module Diff
+ </h1>
+
+ <section class="description">
+
+ </section>
+
+ <section id="5Buntitled-5D" class="documentation-section">
+
+
+
+
+
+ </section>
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/Diff/LCS/Internals.html b/doc/Diff/LCS/Internals.html
new file mode 100644
index 0000000..b1ccf43
--- /dev/null
+++ b/doc/Diff/LCS/Internals.html
@@ -0,0 +1,360 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>module Diff::LCS::Internals - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "../../";
+ var index_rel_prefix = "../../";
+</script>
+
+<script src="../../js/navigation.js" defer></script>
+<script src="../../js/search.js" defer></script>
+<script src="../../js/search_index.js" defer></script>
+<script src="../../js/searcher.js" defer></script>
+<script src="../../js/darkfish.js" defer></script>
+
+<link href="../../css/fonts.css" rel="stylesheet">
+<link href="../../css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="module">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="../../index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="../../table_of_contents.html#pages">Pages</a>
+ <a href="../../table_of_contents.html#classes">Classes</a>
+ <a href="../../table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+
+ <div id="class-metadata">
+
+
+
+
+
+<!-- Method Quickref -->
+<div id="method-list-section" class="nav-section">
+ <h3>Methods</h3>
+
+ <ul class="link-list" role="directory">
+ <li ><a href="#method-c-analyze_patchset">::analyze_patchset</a>
+ <li ><a href="#method-c-intuit_diff_direction">::intuit_diff_direction</a>
+ <li ><a href="#method-c-lcs">::lcs</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-labelledby="module-Diff::LCS::Internals">
+ <h1 id="module-Diff::LCS::Internals" class="module">
+ module Diff::LCS::Internals
+ </h1>
+
+ <section class="description">
+
+ </section>
+
+ <section id="5Buntitled-5D" class="documentation-section">
+
+
+
+
+
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Class Methods</h3>
+ </header>
+
+ <div id="method-c-analyze_patchset" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">analyze_patchset</span><span
+ class="method-args">(patchset, depth = 0)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>This method will analyze the provided patchset to provide a single-pass normalization (conversion of the array form of Diff::LCS::Change objects to the object form of same) and detection of whether the patchset represents changes to be made.</p>
+
+ <div class="method-source-code" id="analyze_patchset-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/internals.rb, line 102</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">analyze_patchset</span>(<span class="ruby-identifier">patchset</span>, <span class="ruby-identifier">depth</span> = <span class="ruby-value">0</span>)
+ <span class="ruby-identifier">fail</span> <span class="ruby-string">&#39;Patchset too complex&#39;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">depth</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
+
+ <span class="ruby-identifier">has_changes</span> = <span class="ruby-keyword">false</span>
+ <span class="ruby-identifier">new_patchset</span> = []
+
+ <span class="ruby-comment"># Format:</span>
+ <span class="ruby-comment"># [ # patchset</span>
+ <span class="ruby-comment"># # hunk (change)</span>
+ <span class="ruby-comment"># [ # hunk</span>
+ <span class="ruby-comment"># # change</span>
+ <span class="ruby-comment"># ]</span>
+ <span class="ruby-comment"># ]</span>
+
+ <span class="ruby-identifier">patchset</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">hunk</span><span class="ruby-operator">|</span>
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">hunk</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Change</span>
+ <span class="ruby-identifier">has_changes</span> <span class="ruby-operator">||=</span> <span class="ruby-operator">!</span><span class="ruby-identifier">hunk</span>.<span class="ruby-identifier">unchanged?</span>
+ <span class="ruby-identifier">new_patchset</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">hunk</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">Array</span>
+ <span class="ruby-comment"># Detect if the &#39;hunk&#39; is actually an array-format change object.</span>
+ <span class="ruby-keyword">if</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Change</span>.<span class="ruby-identifier">valid_action?</span> <span class="ruby-identifier">hunk</span>[<span class="ruby-value">0</span>]
+ <span class="ruby-identifier">hunk</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Change</span>.<span class="ruby-identifier">from_a</span>(<span class="ruby-identifier">hunk</span>)
+ <span class="ruby-identifier">has_changes</span> <span class="ruby-operator">||=</span> <span class="ruby-operator">!</span><span class="ruby-identifier">hunk</span>.<span class="ruby-identifier">unchanged?</span>
+ <span class="ruby-identifier">new_patchset</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">hunk</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">with_changes</span>, <span class="ruby-identifier">hunk</span> = <span class="ruby-identifier">analyze_patchset</span>(<span class="ruby-identifier">hunk</span>, <span class="ruby-identifier">depth</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
+ <span class="ruby-identifier">has_changes</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">with_changes</span>
+ <span class="ruby-identifier">new_patchset</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">hunk</span>)
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">fail</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Cannot normalise a hunk of class #{hunk.class}.&quot;</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+
+ [<span class="ruby-identifier">has_changes</span>, <span class="ruby-identifier">new_patchset</span>]
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-c-intuit_diff_direction" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">intuit_diff_direction</span><span
+ class="method-args">(src, patchset, limit = nil)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Examine the patchset and the source to see in which direction the patch should be applied.</p>
+
+<p>WARNING: By default, this examines the whole patch, so this could take some time. This also works better with Diff::LCS::ContextChange or Diff::LCS::Change as its source, as an array will cause the creation of one of the above.</p>
+
+ <div class="method-source-code" id="intuit_diff_direction-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/internals.rb, line 147</span>
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">intuit_diff_direction</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">patchset</span>, <span class="ruby-identifier">limit</span> = <span class="ruby-keyword">nil</span>)
+ <span class="ruby-identifier">string</span> = <span class="ruby-identifier">src</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">String</span>)
+ <span class="ruby-identifier">count</span> = <span class="ruby-identifier">left_match</span> = <span class="ruby-identifier">left_miss</span> = <span class="ruby-identifier">right_match</span> = <span class="ruby-identifier">right_miss</span> = <span class="ruby-value">0</span>
+
+ <span class="ruby-identifier">patchset</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">change</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">change</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>
+ <span class="ruby-identifier">le</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">change</span>.<span class="ruby-identifier">old_position</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">change</span>.<span class="ruby-identifier">old_position</span>]
+ <span class="ruby-identifier">re</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">change</span>.<span class="ruby-identifier">new_position</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">change</span>.<span class="ruby-identifier">new_position</span>]
+
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">change</span>.<span class="ruby-identifier">action</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;-&#39;</span> <span class="ruby-comment"># Remove details from the old string</span>
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">le</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">change</span>.<span class="ruby-identifier">old_element</span>
+ <span class="ruby-identifier">left_match</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">left_miss</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;+&#39;</span>
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">re</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">change</span>.<span class="ruby-identifier">new_element</span>
+ <span class="ruby-identifier">right_match</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">right_miss</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;=&#39;</span>
+ <span class="ruby-identifier">left_miss</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">le</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">change</span>.<span class="ruby-identifier">old_element</span>
+ <span class="ruby-identifier">right_miss</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">re</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">change</span>.<span class="ruby-identifier">new_element</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;!&#39;</span>
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">le</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">change</span>.<span class="ruby-identifier">old_element</span>
+ <span class="ruby-identifier">left_match</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">re</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">change</span>.<span class="ruby-identifier">new_element</span>
+ <span class="ruby-identifier">right_match</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">left_miss</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-identifier">right_miss</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Change</span>
+ <span class="ruby-comment"># With a simplistic change, we can&#39;t tell the difference between</span>
+ <span class="ruby-comment"># the left and right on &#39;!&#39; actions, so we ignore those. On &#39;=&#39;</span>
+ <span class="ruby-comment"># actions, if there&#39;s a miss, we miss both left and right.</span>
+ <span class="ruby-identifier">element</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">change</span>.<span class="ruby-identifier">position</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">change</span>.<span class="ruby-identifier">position</span>]
+
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">change</span>.<span class="ruby-identifier">action</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;-&#39;</span>
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">element</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">change</span>.<span class="ruby-identifier">element</span>
+ <span class="ruby-identifier">left_match</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">left_miss</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;+&#39;</span>
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">element</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">change</span>.<span class="ruby-identifier">element</span>
+ <span class="ruby-identifier">right_match</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">right_miss</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;=&#39;</span>
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">element</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">change</span>.<span class="ruby-identifier">element</span>
+ <span class="ruby-identifier">left_miss</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-identifier">right_miss</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">limit</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">count</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">limit</span>)
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-identifier">no_left</span> = <span class="ruby-identifier">left_match</span>.<span class="ruby-identifier">zero?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">left_miss</span>.<span class="ruby-identifier">positive?</span>
+ <span class="ruby-identifier">no_right</span> = <span class="ruby-identifier">right_match</span>.<span class="ruby-identifier">zero?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">right_miss</span>.<span class="ruby-identifier">positive?</span>
+
+ <span class="ruby-keyword">case</span> [<span class="ruby-identifier">no_left</span>, <span class="ruby-identifier">no_right</span>]
+ <span class="ruby-keyword">when</span> [<span class="ruby-keyword">false</span>, <span class="ruby-keyword">true</span>]
+ <span class="ruby-value">:patch</span>
+ <span class="ruby-keyword">when</span> [<span class="ruby-keyword">true</span>, <span class="ruby-keyword">false</span>]
+ <span class="ruby-value">:unpatch</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">left_match</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">right_match</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">left_miss</span>.<span class="ruby-identifier">zero?</span>
+ <span class="ruby-value">:patch</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-value">:unpatch</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-value">-1</span>
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">right_miss</span>.<span class="ruby-identifier">zero?</span>
+ <span class="ruby-value">:unpatch</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-value">:patch</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">fail</span> <span class="ruby-string">&quot;The provided patchset does not appear to apply to the provided \
+enumerable as either source or destination value.&quot;</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-c-lcs" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">lcs</span><span
+ class="method-args">(a, b)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Compute the longest common subsequence between the sequenced Enumerables <code>a</code> and <code>b</code>. The result is an array whose contents is such that</p>
+
+<pre class="ruby"><span class="ruby-identifier">result</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Internals</span>.<span class="ruby-identifier">lcs</span>(<span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span>)
+<span class="ruby-identifier">result</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">e</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">a</span>[<span class="ruby-identifier">i</span>], <span class="ruby-identifier">b</span>[<span class="ruby-identifier">e</span>]) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">nil?</span>
+<span class="ruby-keyword">end</span>
+</pre>
+
+ <div class="method-source-code" id="lcs-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/internals.rb, line 41</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">lcs</span>(<span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span>)
+ <span class="ruby-identifier">a_start</span> = <span class="ruby-identifier">b_start</span> = <span class="ruby-value">0</span>
+ <span class="ruby-identifier">a_finish</span> = <span class="ruby-identifier">a</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
+ <span class="ruby-identifier">b_finish</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
+ <span class="ruby-identifier">vector</span> = []
+
+ <span class="ruby-comment"># Collect any common elements at the beginning...</span>
+ <span class="ruby-keyword">while</span> (<span class="ruby-identifier">a_start</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">a_finish</span>) <span class="ruby-keyword">and</span> (<span class="ruby-identifier">b_start</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">b_finish</span>) <span class="ruby-keyword">and</span> (<span class="ruby-identifier">a</span>[<span class="ruby-identifier">a_start</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">b</span>[<span class="ruby-identifier">b_start</span>])
+ <span class="ruby-identifier">vector</span>[<span class="ruby-identifier">a_start</span>] = <span class="ruby-identifier">b_start</span>
+ <span class="ruby-identifier">a_start</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-identifier">b_start</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-comment"># Now the end...</span>
+ <span class="ruby-keyword">while</span> (<span class="ruby-identifier">a_start</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">a_finish</span>) <span class="ruby-keyword">and</span> (<span class="ruby-identifier">b_start</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">b_finish</span>) <span class="ruby-keyword">and</span> (<span class="ruby-identifier">a</span>[<span class="ruby-identifier">a_finish</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">b</span>[<span class="ruby-identifier">b_finish</span>])
+ <span class="ruby-identifier">vector</span>[<span class="ruby-identifier">a_finish</span>] = <span class="ruby-identifier">b_finish</span>
+ <span class="ruby-identifier">a_finish</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
+ <span class="ruby-identifier">b_finish</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-comment"># Now, compute the equivalence classes of positions of elements.</span>
+ <span class="ruby-comment"># An explanation for how this works: https://codeforces.com/topic/92191</span>
+ <span class="ruby-identifier">b_matches</span> = <span class="ruby-identifier">position_hash</span>(<span class="ruby-identifier">b</span>, <span class="ruby-identifier">b_start</span><span class="ruby-operator">..</span><span class="ruby-identifier">b_finish</span>)
+
+ <span class="ruby-identifier">thresh</span> = []
+ <span class="ruby-identifier">links</span> = []
+ <span class="ruby-identifier">string</span> = <span class="ruby-identifier">a</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">String</span>)
+
+ (<span class="ruby-identifier">a_start</span><span class="ruby-operator">..</span><span class="ruby-identifier">a_finish</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">ai</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">a</span>[<span class="ruby-identifier">i</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">a</span>[<span class="ruby-identifier">i</span>]
+ <span class="ruby-identifier">bm</span> = <span class="ruby-identifier">b_matches</span>[<span class="ruby-identifier">ai</span>]
+ <span class="ruby-identifier">k</span> = <span class="ruby-keyword">nil</span>
+ <span class="ruby-identifier">bm</span>.<span class="ruby-identifier">reverse_each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">j</span><span class="ruby-operator">|</span>
+ <span class="ruby-comment"># Although the threshold check is not mandatory for this to work,</span>
+ <span class="ruby-comment"># it may have an optimization purpose</span>
+ <span class="ruby-comment"># An attempt to remove it: https://github.com/halostatue/diff-lcs/pull/72</span>
+ <span class="ruby-comment"># Why it is reintroduced: https://github.com/halostatue/diff-lcs/issues/78</span>
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">k</span> <span class="ruby-keyword">and</span> (<span class="ruby-identifier">thresh</span>[<span class="ruby-identifier">k</span>] <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">j</span>) <span class="ruby-keyword">and</span> (<span class="ruby-identifier">thresh</span>[<span class="ruby-identifier">k</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>] <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">j</span>)
+ <span class="ruby-identifier">thresh</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">j</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">k</span> = <span class="ruby-identifier">replace_next_larger</span>(<span class="ruby-identifier">thresh</span>, <span class="ruby-identifier">j</span>, <span class="ruby-identifier">k</span>)
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-identifier">links</span>[<span class="ruby-identifier">k</span>] = [<span class="ruby-identifier">k</span>.<span class="ruby-identifier">positive?</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">links</span>[<span class="ruby-identifier">k</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">i</span>, <span class="ruby-identifier">j</span>] <span class="ruby-keyword">unless</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">nil?</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-keyword">unless</span> <span class="ruby-identifier">thresh</span>.<span class="ruby-identifier">empty?</span>
+ <span class="ruby-identifier">link</span> = <span class="ruby-identifier">links</span>[<span class="ruby-identifier">thresh</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>]
+ <span class="ruby-keyword">until</span> <span class="ruby-identifier">link</span>.<span class="ruby-identifier">nil?</span>
+ <span class="ruby-identifier">vector</span>[<span class="ruby-identifier">link</span>[<span class="ruby-value">1</span>]] = <span class="ruby-identifier">link</span>[<span class="ruby-value">2</span>]
+ <span class="ruby-identifier">link</span> = <span class="ruby-identifier">link</span>[<span class="ruby-value">0</span>]
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-identifier">vector</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ </section>
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/Diff/LCS/Ldiff.html b/doc/Diff/LCS/Ldiff.html
new file mode 100644
index 0000000..3b618d6
--- /dev/null
+++ b/doc/Diff/LCS/Ldiff.html
@@ -0,0 +1,91 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>module Diff::LCS::Ldiff - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "../../";
+ var index_rel_prefix = "../../";
+</script>
+
+<script src="../../js/navigation.js" defer></script>
+<script src="../../js/search.js" defer></script>
+<script src="../../js/search_index.js" defer></script>
+<script src="../../js/searcher.js" defer></script>
+<script src="../../js/darkfish.js" defer></script>
+
+<link href="../../css/fonts.css" rel="stylesheet">
+<link href="../../css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="module">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="../../index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="../../table_of_contents.html#pages">Pages</a>
+ <a href="../../table_of_contents.html#classes">Classes</a>
+ <a href="../../table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+
+ <div id="class-metadata">
+
+
+
+
+
+ </div>
+</nav>
+
+<main role="main" aria-labelledby="module-Diff::LCS::Ldiff">
+ <h1 id="module-Diff::LCS::Ldiff" class="module">
+ module Diff::LCS::Ldiff
+ </h1>
+
+ <section class="description">
+
+ </section>
+
+ <section id="5Buntitled-5D" class="documentation-section">
+
+
+
+
+
+ </section>
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/Fixnum.html b/doc/Fixnum.html
new file mode 100644
index 0000000..69b409d
--- /dev/null
+++ b/doc/Fixnum.html
@@ -0,0 +1,134 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>class Fixnum - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "./";
+ var index_rel_prefix = "./";
+</script>
+
+<script src="./js/navigation.js" defer></script>
+<script src="./js/search.js" defer></script>
+<script src="./js/search_index.js" defer></script>
+<script src="./js/searcher.js" defer></script>
+<script src="./js/darkfish.js" defer></script>
+
+<link href="./css/fonts.css" rel="stylesheet">
+<link href="./css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="class">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="./index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="./table_of_contents.html#pages">Pages</a>
+ <a href="./table_of_contents.html#classes">Classes</a>
+ <a href="./table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+
+ <div id="class-metadata">
+
+
+<div id="parent-class-section" class="nav-section">
+ <h3>Parent</h3>
+
+ <p class="link">Object
+</div>
+
+
+
+
+<!-- Method Quickref -->
+<div id="method-list-section" class="nav-section">
+ <h3>Methods</h3>
+
+ <ul class="link-list" role="directory">
+ <li ><a href="#method-i-positive-3F">#positive?</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-labelledby="class-Fixnum">
+ <h1 id="class-Fixnum" class="class">
+ class Fixnum
+ </h1>
+
+ <section class="description">
+
+ </section>
+
+ <section id="5Buntitled-5D" class="documentation-section">
+
+
+
+
+
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Instance Methods</h3>
+ </header>
+
+ <div id="method-i-positive-3F" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">positive?</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="positive-3F-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/backports.rb, line 5</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">positive?</span>
+ <span class="ruby-keyword">self</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-comment"># rubocop:disable Style/NumericPredicate</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ </section>
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/History_md.html b/doc/History_md.html
new file mode 100644
index 0000000..b071f53
--- /dev/null
+++ b/doc/History_md.html
@@ -0,0 +1,407 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>History - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "./";
+ var index_rel_prefix = "./";
+</script>
+
+<script src="./js/navigation.js" defer></script>
+<script src="./js/search.js" defer></script>
+<script src="./js/search_index.js" defer></script>
+<script src="./js/searcher.js" defer></script>
+<script src="./js/darkfish.js" defer></script>
+
+<link href="./css/fonts.css" rel="stylesheet">
+<link href="./css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="file">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="./index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="./table_of_contents.html#pages">Pages</a>
+ <a href="./table_of_contents.html#classes">Classes</a>
+ <a href="./table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+<div class="nav-section">
+ <h3>Table of Contents</h3>
+
+ <ul class="link-list" role="directory">
+ <li><a href="#label-History">History</a>
+ <li><a href="#label-1.5.0+-2F+2021-12-23">1.5.0 / 2021-12-23</a>
+ <li><a href="#label-1.4.4+-2F+2020-07-01">1.4.4 / 2020-07-01</a>
+ <li><a href="#label-1.4.3+-2F+2020-06-29">1.4.3 / 2020-06-29</a>
+ <li><a href="#label-1.4.2+-2F+2020-06-23">1.4.2 / 2020-06-23</a>
+ <li><a href="#label-1.4.1+-2F+2020-06-23">1.4.1 / 2020-06-23</a>
+ <li><a href="#label-1.4+-2F+2020-06-23">1.4 / 2020-06-23</a>
+ <li><a href="#label-1.3+-2F+2017-01-18">1.3 / 2017-01-18</a>
+ <li><a href="#label-1.2.5+-2F+2013-11-08">1.2.5 / 2013-11-08</a>
+ <li><a href="#label-1.2.4+-2F+2013-04-20">1.2.4 / 2013-04-20</a>
+ <li><a href="#label-1.2.3+-2F+2013-04-11">1.2.3 / 2013-04-11</a>
+ <li><a href="#label-1.2.2+-2F+2013-03-30">1.2.2 / 2013-03-30</a>
+ <li><a href="#label-1.2.1+-2F+2013-02-09">1.2.1 / 2013-02-09</a>
+ <li><a href="#label-1.2.0+-2F+2013-01-21">1.2.0 / 2013-01-21</a>
+ <li><a href="#label-unpatch-21+where+they+implied+that+they+would+replace+the+original+value.">unpatch! where they implied that they would replace the original value.</a>
+ <li><a href="#label-1.1.3+-2F+2011-08-27">1.1.3 / 2011-08-27</a>
+ <li><a href="#label-1.1.2+-2F+2004-10-20">1.1.2 / 2004-10-20</a>
+ <li><a href="#label-1.1.1+-2F+2004-09-25">1.1.1 / 2004-09-25</a>
+ <li><a href="#label-1.1.0">1.1.0</a>
+ <li><a href="#label-1.0.4">1.0.4</a>
+ <li><a href="#label-1.0.3">1.0.3</a>
+ <li><a href="#label-1.0.2">1.0.2</a>
+ <li><a href="#label-1.0.1">1.0.1</a>
+ <li><a href="#label-1.0">1.0</a>
+ </ul>
+</div>
+
+
+ <div id="project-metadata">
+
+<div id="fileindex-section" class="nav-section">
+ <h3>Pages</h3>
+
+ <ul class="link-list">
+ <li><a href="./Code-of-Conduct_md.html">Code-of-Conduct</a>
+ <li><a href="./Contributing_md.html">Contributing</a>
+ <li><a href="./History_md.html">History</a>
+ <li><a href="./License_md.html">License</a>
+ <li><a href="./Manifest_txt.html">Manifest</a>
+ <li><a href="./README_rdoc.html">README</a>
+ <li><a href="./docs/COPYING_txt.html">COPYING</a>
+ <li><a href="./docs/artistic_txt.html">artistic</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-label="Page History.md">
+
+<h1 id="label-History"><a href="History_md.html">History</a><span><a href="#label-History">&para;</a> <a href="#top">&uarr;</a></span></h1>
+
+<h2 id="label-1.5.0+-2F+2021-12-23">1.5.0 / 2021-12-23<span><a href="#label-1.5.0+-2F+2021-12-23">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Updated the CI configuration and monkey-patch Hoe.</p>
+</li><li>
+<p>Kenichi Kamiya fixed a test configuration deprecation in SimpleCov. <a href="https://github.com/halostatue/diff-lcs/issues/69">#69</a></p>
+</li><li>
+<p>Tien introduced several corrections and code improvements:</p>
+</li><li>
+<p>Removed an off-by-one error when calculating an index value by embracing Ruby iteration properly. This had a side-effect of fixing a long-standing bug in <code>#traverse_sequences</code> where the traversal would not be transitive. That is, <code>LCS(s2, s1)</code> should produce a sequence that is transitive with <code>LCS(s1, s2)</code> on traversal, and applying the diff computed from those results would result in equivalent changes that could be played forward or backward as appropriate. <a href="https://github.com/halostatue/diff-lcs/issues/71">#71</a>, <a href="https://github.com/halostatue/diff-lcs/issues/75">#75</a></p>
+</li><li>
+<p>The above fix resulted in a changed order of the longest common subsequence when callbacks were applied. After analysis, it was determined that the computed subsequence was <em>equivalent</em> to the prior version, so the test was updated. This also resulted in the clarification of documentation when traversing the subsequences. <a href="https://github.com/halostatue/diff-lcs/issues/79">#79</a></p>
+</li><li>
+<p>An infinite loop case in the case where <a href="LCS.html"><code>Diff::LCS</code></a> would be included into an enumerable class has been fixed. <a href="https://github.com/halostatue/diff-lcs/issues/73">#73</a></p>
+</li><li>
+<p>Clarified the purpose of a threshold test in calculation of <a href="LCS.html"><code>LCS</code></a>. <a href="https://github.com/halostatue/diff-lcs/issues/72">#72</a>, <a href="https://github.com/halostatue/diff-lcs/issues/80">#80</a></p>
+</li><li>
+<p>Removed autotest directory</p>
+</li></ul>
+
+<h2 id="label-1.4.4+-2F+2020-07-01">1.4.4 / 2020-07-01<span><a href="#label-1.4.4+-2F+2020-07-01">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Fixed an issue reported by Jun Aruga in the <a href="Diff/LCS/Ldiff.html"><code>Diff::LCS::Ldiff</code></a> binary text detection. <a href="https://github.com/halostatue/diff-lcs/issues/44">#44</a></p>
+</li><li>
+<p>Fixed a theoretical issue reported by Jun Aruga in Diff::LCS::Hunk to raise a more useful exception. <a href="https://github.com/halostatue/diff-lcs/issues/43">#43</a></p>
+</li><li>
+<p>Added documentation that should address custom object issues as reported in <a href="https://github.com/halostatue/diff-lcs/issues/35">#35</a>.</p>
+</li><li>
+<p>Fixed more diff errors, in part reported in <a href="https://github.com/halostatue/diff-lcs/issues/65">#65</a>.</p>
+</li><li>
+<p>The use of <code>Numeric#abs</code> is incorrect in <code>Diff::LCS::Block#diff_size</code>. The diff size <em>must</em> be accurate for correct change placement.</p>
+</li><li>
+<p>When selecting @max_diff_size in Diff::LCS::Hunk, choose it based on <code>block.diff_size.abs</code>.</p>
+</li><li>
+<p>Made a number of changes that will, unfortunately, increase allocations at the cost of being safe with frozen strings.</p>
+</li><li>
+<p>Add some knowledge that when <code>Diff::LCS::Hunk#diff</code> is called, that we are processing the <em>last</em> hunk, so some changes will be made to how the output is generated.</p>
+<ul><li>
+<p><code>old</code>, <code>ed</code>, and <code>reverse_ed</code> formats have no differences.</p>
+</li><li>
+<p><code>unified</code> format will report <code>\ No newline at end of file</code> given the correct conditions, at most once. Unified range reporting also differs for the last hunk such that the <code>length</code> of the range is reduced by one.</p>
+</li><li>
+<p><code>context</code> format will report <code>\No newline at end of file</code> given the correct conditions, up to once per “file”. Context range reporting also differs for the last hunk such that the <code>end</code> part of the range is reduced by one to a minimum of one.</p>
+</li></ul>
+</li><li>
+<p>Added a bunch more tests for the cases above, and fixed <code>hunk_spec.rb</code> so that the phrase being compared isn&#39;t nonsense French.</p>
+</li><li>
+<p>Updated formatting.</p>
+</li><li>
+<p>Added a Rake task to assist with manual testing on Ruby 1.8.</p>
+</li></ul>
+
+<h2 id="label-1.4.3+-2F+2020-06-29">1.4.3 / 2020-06-29<span><a href="#label-1.4.3+-2F+2020-06-29">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Fixed several issues with the 1.4 on Rubies older than 2.0. Some of this was providing useful shim functions to Hoe 3.x (which dropped these older Rubies a while ago). Specifically:</p>
+</li><li>
+<p>Removed Array#lazy from a method in Diff::LCS::Hunk.</p>
+</li><li>
+<p>Changed some unit tests to use old-style Symbol-keyed hashes.</p>
+</li><li>
+<p>Changed some unit test helper functions to no longer use keyword parameters, but only a trailing options hash.</p>
+</li><li>
+<p>Made the use of <code>psych</code> dependent on <code>RUBY_VERSION &gt;= 1.9</code>.</p>
+</li></ul>
+
+<p>Resolves <a href="https://github.com/halostatue/diff-lcs/issues/63">#63</a>.</p>
+
+<h2 id="label-1.4.2+-2F+2020-06-23">1.4.2 / 2020-06-23<span><a href="#label-1.4.2+-2F+2020-06-23">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Camille Drapier fixed a small issue with RuboCop configuration. <a href="https://github.com/halostatue/diff-lcs/pull/59">#59</a></p>
+</li><li>
+<p>Applied another fix (and unit test) to fix an issue for the Chef team. <a href="https://github.com/halostatue/diff-lcs/issues/60">#60</a>, <a href="https://github.com/halostatue/diff-lcs/pull/61">#61</a></p>
+</li></ul>
+
+<h2 id="label-1.4.1+-2F+2020-06-23">1.4.1 / 2020-06-23<span><a href="#label-1.4.1+-2F+2020-06-23">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Fix an issue where diff sizes could be negative, and they should be. <a href="https://github.com/halostatue/diff-lcs/issues/57">#57</a>, <a href="https://github.com/halostatue/diff-lcs/pull/58">#58</a></p>
+</li></ul>
+
+<h2 id="label-1.4+-2F+2020-06-23">1.4 / 2020-06-23<span><a href="#label-1.4+-2F+2020-06-23">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Ruby versions lower than 2.4 are soft-deprecated and will not be run as part of the CI process any longer.</p>
+</li><li>
+<p>Akinora MUSHA (knu) added the ability for Diff::LCS::Change objects to be implicitly treated arrays. Originally provided as pull request <a href="https://github.com/halostatue/diff-lcs/pull/47">#47</a>, but it introduced a number of test failures as documented in <a href="https://github.com/halostatue/diff-lcs/issues/48">#48</a>, and remediation of <a href="LCS.html"><code>Diff::LCS</code></a> itself was introduced in <a href="https://github.com/halostatue/diff-lcs/pull/49">#49</a>.</p>
+</li><li>
+<p>Resolved <a href="https://github.com/halostatue/diff-lcs/issues/5">#5</a> with some tests comparing output from <code>system</code> calls to <code>bin/ldiff</code> with some pre-generated output. Resolved <a href="https://github.com/halostatue/diff-lcs/issues/6">#6</a> with these tests.</p>
+</li><li>
+<p>Resolved a previously undetected <code>bin/ldiff</code> issue with <code>--context</code> output not matching <code>diff --context</code> output.</p>
+</li><li>
+<p>Resolved an issue with later versions of Ruby not working with an <code>OptParse</code> specification of <code>Numeric</code>; this has been changed to <code>Integer</code>.</p>
+</li><li>
+<p>Brandon Fish added truffleruby in <a href="https://github.com/halostatue/diff-lcs/pull/52">#52</a>.</p>
+</li><li>
+<p>Fixed two missing classes as reported in <a href="https://github.com/halostatue/diff-lcs/issues/53">#53</a>.</p>
+</li></ul>
+
+<h2 id="label-1.3+-2F+2017-01-18">1.3 / 2017-01-18<span><a href="#label-1.3+-2F+2017-01-18">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Bugs fixed:</p>
+</li><li>
+<p>Fixed an error for bin/ldiff --version. Fixes issue <a href="https://github.com/halostatue/diff-lcs/issues/21">#21</a>.</p>
+</li><li>
+<p>Force Diff::LCS::Change and Diff::LCS::ContextChange to only perform equality comparisons against themselves. Provided by Kevin Mook in pull request <a href="https://github.com/halostatue/diff-lcs/pull/29">#29</a>.</p>
+</li><li>
+<p>Fix tab expansion in htmldiff, provided by Mark Friedgan in pull request <a href="https://github.com/halostatue/diff-lcs/pull/25">#25</a>.</p>
+</li><li>
+<p>Silence Ruby 2.4 <a href="Fixnum.html"><code>Fixnum</code></a> deprecation warnings. Fixes issue <a href="https://github.com/halostatue/diff-lcs/issues/38">#38</a> and pull request <a href="https://github.com/halostatue/diff-lcs/pull/36">#36</a>.</p>
+</li><li>
+<p>Ensure that test dependencies are loaded properly. Fixes issue <a href="https://github.com/halostatue/diff-lcs/issues/33">#33</a> and pull request <a href="https://github.com/halostatue/diff-lcs/pull/34">#34</a>.</p>
+</li><li>
+<p>Fix issue <a href="https://github.com/halostatue/diff-lcs/issues/1">#1</a> with incorrect intuition of patch direction. Tentative fix, but the previous failure cases pass now.</p>
+</li><li>
+<p>Tooling changes:</p>
+</li><li>
+<p>Added SimpleCov and Coveralls support.</p>
+</li><li>
+<p>Change the homepage (temporarily) to the GitHub repo.</p>
+</li><li>
+<p>Updated testing and gem infrastructure.</p>
+</li><li>
+<p>Modernized the specs.</p>
+</li><li>
+<p>Cleaned up documentation.</p>
+</li><li>
+<p>Added a Code of Conduct.</p>
+</li></ul>
+
+<h2 id="label-1.2.5+-2F+2013-11-08">1.2.5 / 2013-11-08<span><a href="#label-1.2.5+-2F+2013-11-08">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Bugs fixed:</p>
+</li><li>
+<p>Comparing arrays flattened them too far, especially with <a href="LCS.html#method-c-sdiff"><code>Diff::LCS.sdiff</code></a>. Fixed by Josh Bronson in pull request <a href="https://github.com/halostatue/diff-lcs/pull/23">#23</a>.</p>
+</li></ul>
+
+<h2 id="label-1.2.4+-2F+2013-04-20">1.2.4 / 2013-04-20<span><a href="#label-1.2.4+-2F+2013-04-20">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Bugs fixed:</p>
+</li><li>
+<p>A bug was introduced after 1.1.3 when pruning common sequences at the start of comparison. Paul Kunysch (@pck) fixed this in pull request <a href="https://github.com/halostatue/diff-lcs/pull/18">#18</a>. Thanks!</p>
+</li><li>
+<p>The Rubinius (1.9 mode) bug in <a href="https://github.com/rubinius/rubinius/issues/2268">rubinius/rubinius#2268</a> has been fixed by the Rubinius team two days after it was filed. Thanks for fixing this so quickly!</p>
+</li><li>
+<p>Switching to Raggi&#39;s hoe-gemspec2 for gemspec generation.</p>
+</li></ul>
+
+<h2 id="label-1.2.3+-2F+2013-04-11">1.2.3 / 2013-04-11<span><a href="#label-1.2.3+-2F+2013-04-11">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Bugs Fixed:</p>
+</li><li>
+<p>The new encoding detection for diff output generation (added in 1.2.2) introduced a bug if the left side of the comparison was the empty set. Originally found in <a href="https://github.com/rspec/rspec-expectations/issues/238">rspec/rspec-expectations#238</a> and <a href="https://github.com/rspec/rspec-expectations/issues/239">rspec/rspec-expectations#239</a>. Jon Rowe developed a reasonable heuristic (left side, right side, empty string literal) to avoid this bug.</p>
+</li><li>
+<p>There is a known issue with Rubinius in 1.9 mode reported in <a href="https://github.com/rubinius/rubinius/issues/2268">rubinius/rubinius#2268</a> and demonstrated in the Travis CI builds. For all other tested platforms, diff-lcs is considered stable. As soon as a suitably small test-case can be created for the Rubinius team to examine, this will be added to the Rubinius issue around this.</p>
+</li></ul>
+
+<h2 id="label-1.2.2+-2F+2013-03-30">1.2.2 / 2013-03-30<span><a href="#label-1.2.2+-2F+2013-03-30">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Bugs Fixed:</p>
+</li><li>
+<p>Diff::LCS::Hunk could not properly generate a difference for comparison sets that are not US-ASCII-compatible because of the use of literal regular expressions and strings. Jon Rowe found this in <a href="https://github.com/rspec/rspec-expectations/issues/219">rspec/rspec-expectations#219</a> and provided a first pass implementation in pull request <a href="https://github.com/halostatue/diff-lcs/pull/15">#15</a>. I&#39;ve reworked it because of test failures in Rubinius when running in Ruby 1.9 mode. This coerces the added values to the encoding of the old dataset (as determined by the first piece of the old dataset).</p>
+</li><li>
+<p>Adding Travis CI testing for Ruby 2.0.</p>
+</li></ul>
+
+<h2 id="label-1.2.1+-2F+2013-02-09">1.2.1 / 2013-02-09<span><a href="#label-1.2.1+-2F+2013-02-09">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Bugs Fixed:</p>
+</li><li>
+<p>As seen in <a href="https://github.com/rspec/rspec-expectations/pull/200">rspec/rspec-expectations#200</a>, the release of <a href="LCS.html"><code>Diff::LCS</code></a> 1.2 introduced an unnecessary public API change to Diff::LCS::Hunk (see the change at <a href="https://github.com/rspec/rspec-expectations/commit/3d6fc82c">rspec/rspec-expectations@3d6fc82c</a> for details). The new method name (and behaviour) is more correct, but I should not have renamed the function or should have at least provided an alias. This release restores Diff::LCS::Hunk#unshift as an alias to merge. Note that the old unshift behaviour was incorrect and will not be restored.</p>
+</li></ul>
+
+<h2 id="label-1.2.0+-2F+2013-01-21">1.2.0 / 2013-01-21<span><a href="#label-1.2.0+-2F+2013-01-21">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Minor Enhancements:</p>
+</li><li>
+<p>Added special case handling for <a href="LCS.html#method-c-patch"><code>Diff::LCS.patch</code></a> so that it handles patches that are empty or contain no changes.</p>
+</li><li>
+<p>Added two new methods (patch_me and unpatch_me) to the includable module.</p>
+</li><li>
+<p>Bugs Fixed:</p>
+</li><li>
+<p>Fixed issue <a href="https://github.com/halostatue/diff-lcs/issues/1">#1</a> patch direction detection.</p>
+</li><li>
+<p>Resolved issue <a href="https://github.com/halostatue/diff-lcs/issues/2">#2</a> by handling <code>string[string.size, 1]</code> properly (it returns <code>&quot;&quot;</code> not <code>nil</code>).</p>
+</li><li>
+<p>Michael Granger (ged) fixed an implementation error in Diff::LCS::Change and added specs in pull request <a href="https://github.com/halostatue/diff-lcs/pull/8">#8</a>. Thanks!</p>
+</li><li>
+<p>Made the code auto-testable.</p>
+</li><li>
+<p>Vít Ondruch (voxik) provided the latest version of the GPL2 license file in pull request <a href="https://github.com/halostatue/diff-lcs/pull/10">#10</a>. Thanks!</p>
+</li><li>
+<p>Fixed a documentation issue with the includable versions of patch! and</p>
+
+<h1 id="label-unpatch-21+where+they+implied+that+they+would+replace+the+original+value.">unpatch! where they implied that they would replace the original value.<span><a href="#label-unpatch-21+where+they+implied+that+they+would+replace+the+original+value.">&para;</a> <a href="#top">&uarr;</a></span></h1>
+
+<p>Given that <a href="LCS.html#method-c-patch"><code>Diff::LCS.patch</code></a> always returns a copy, the documentation was incorrect and has been corrected. To provide the behaviour that was originally documented, two new methods were added to provide this behaviour. Found by scooter-dangle in issue <a href="https://github.com/halostatue/diff-lcs/issues/12">#12</a>. Thanks!</p>
+</li><li>
+<p>Code Style Changes:</p>
+</li><li>
+<p>Removed trailing spaces.</p>
+</li><li>
+<p>Calling class methods using <code>.</code> instead of <code>::</code>.</p>
+</li><li>
+<p>Vít Ondruch (voxik) removed unnecessary shebangs in pull request <a href="https://github.com/halostatue/diff-lcs/pull/9">#9</a>. Thanks!</p>
+</li><li>
+<p>Kenichi Kamiya (kachick) removed some warnings of an unused variable in lucky pull request <a href="https://github.com/halostatue/diff-lcs/pull/13">#13</a>. Thanks!</p>
+</li><li>
+<p>Embarked on a major refactoring to make the files a little more manageable and understand the code on a deeper level.</p>
+</li><li>
+<p>Adding to <a href="http://travis-ci.org">travis-ci.org</a>.</p>
+</li></ul>
+
+<h2 id="label-1.1.3+-2F+2011-08-27">1.1.3 / 2011-08-27<span><a href="#label-1.1.3+-2F+2011-08-27">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Converted to &#39;hoe&#39; for release.</p>
+</li><li>
+<p>Converted tests to RSpec 2.</p>
+</li><li>
+<p>Extracted the body of htmldiff into a class available from diff/lcs/htmldiff.</p>
+</li><li>
+<p>Migrated development and issue tracking to GitHub.</p>
+</li><li>
+<p>Bugs fixed:</p>
+</li><li>
+<p>Eliminated the explicit use of RubyGems in both bin/htmldiff and bin/ldiff. Resolves issue <a href="https://github.com/halostatue/diff-lcs/issues/4">#4</a>.</p>
+</li><li>
+<p>Eliminated Ruby warnings. Resolves issue <a href="https://github.com/halostatue/diff-lcs/issues/3">#3</a>.</p>
+</li></ul>
+
+<h2 id="label-1.1.2+-2F+2004-10-20">1.1.2 / 2004-10-20<span><a href="#label-1.1.2+-2F+2004-10-20">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Fixed a problem reported by Mauricio Fernandez in htmldiff.</p>
+</li></ul>
+
+<h2 id="label-1.1.1+-2F+2004-09-25">1.1.1 / 2004-09-25<span><a href="#label-1.1.1+-2F+2004-09-25">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Fixed bug #891 (Set returned from patch command does not contain last equal part).</p>
+</li><li>
+<p>Fixed a problem with callback initialisation code (it assumed that all callbacks passed as classes can be initialised; now, it rescues NoMethodError in the event of private :new being called).</p>
+</li><li>
+<p>Modified the non-initialisable callbacks to have a private new method.</p>
+</li><li>
+<p>Moved ldiff core code to <a href="Diff/LCS/Ldiff.html"><code>Diff::LCS::Ldiff</code></a> (diff/lcs/ldiff.rb).</p>
+</li></ul>
+
+<h2 id="label-1.1.0">1.1.0<span><a href="#label-1.1.0">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Eliminated the need for Diff::LCS::Event and removed it.</p>
+</li><li>
+<p>Added a contextual diff callback, Diff::LCS::ContextDiffCallback.</p>
+</li><li>
+<p>Implemented patching/unpatching for standard <a href="Diff.html"><code>Diff</code></a> callback output formats with both diff and sdiff.</p>
+</li><li>
+<p>Extensive documentation changes.</p>
+</li></ul>
+
+<h2 id="label-1.0.4">1.0.4<span><a href="#label-1.0.4">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Fixed a problem with bin/ldiff output, especially for unified format. Newlines that should have been present weren&#39;t.</p>
+</li><li>
+<p>Changed the .tar.gz installer to generate Windows batch files if ones do not exist already. Removed the existing batch files as they didn&#39;t work.</p>
+</li></ul>
+
+<h2 id="label-1.0.3">1.0.3<span><a href="#label-1.0.3">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Fixed a problem with traverse_sequences where the first difference from the left sequence might not be appropriately captured.</p>
+</li></ul>
+
+<h2 id="label-1.0.2">1.0.2<span><a href="#label-1.0.2">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Fixed an issue with ldiff not working because actions were changed from symbols to strings.</p>
+</li></ul>
+
+<h2 id="label-1.0.1">1.0.1<span><a href="#label-1.0.1">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Minor modifications to the gemspec, the <a href="README_rdoc.html">README</a>.</p>
+</li><li>
+<p>Renamed the diff program to ldiff (as well as the companion batch file) so as to not collide with the standard diff program.</p>
+</li><li>
+<p>Fixed issues with RubyGems. Requires RubyGems &gt; 0.6.1 or &gt;= 0.6.1 with the latest CVS version.</p>
+</li></ul>
+
+<h2 id="label-1.0">1.0<span><a href="#label-1.0">&para;</a> <a href="#top">&uarr;</a></span></h2>
+<ul><li>
+<p>Initial release based mostly on Perl&#39;s Algorithm::Diff.</p>
+</li></ul>
+
+</main>
+
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/LCS.html b/doc/LCS.html
new file mode 100644
index 0000000..ef19930
--- /dev/null
+++ b/doc/LCS.html
@@ -0,0 +1,1119 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>module LCS - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "./";
+ var index_rel_prefix = "./";
+</script>
+
+<script src="./js/navigation.js" defer></script>
+<script src="./js/search.js" defer></script>
+<script src="./js/search_index.js" defer></script>
+<script src="./js/searcher.js" defer></script>
+<script src="./js/darkfish.js" defer></script>
+
+<link href="./css/fonts.css" rel="stylesheet">
+<link href="./css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="module">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="./index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="./table_of_contents.html#pages">Pages</a>
+ <a href="./table_of_contents.html#classes">Classes</a>
+ <a href="./table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+
+ <div id="class-metadata">
+
+
+
+
+
+<!-- Method Quickref -->
+<div id="method-list-section" class="nav-section">
+ <h3>Methods</h3>
+
+ <ul class="link-list" role="directory">
+ <li ><a href="#method-c-LCS">::LCS</a>
+ <li ><a href="#method-c-callbacks_for">::callbacks_for</a>
+ <li ><a href="#method-c-diff">::diff</a>
+ <li ><a href="#method-c-lcs">::lcs</a>
+ <li ><a href="#method-c-patch">::patch</a>
+ <li ><a href="#method-c-patch-21">::patch!</a>
+ <li ><a href="#method-c-sdiff">::sdiff</a>
+ <li ><a href="#method-c-traverse_balanced">::traverse_balanced</a>
+ <li ><a href="#method-c-traverse_sequences">::traverse_sequences</a>
+ <li ><a href="#method-c-unpatch-21">::unpatch!</a>
+ <li ><a href="#method-i-diff">#diff</a>
+ <li ><a href="#method-i-lcs">#lcs</a>
+ <li ><a href="#method-i-patch">#patch</a>
+ <li ><a href="#method-i-patch-21">#patch!</a>
+ <li ><a href="#method-i-patch_me">#patch_me</a>
+ <li ><a href="#method-i-sdiff">#sdiff</a>
+ <li ><a href="#method-i-traverse_balanced">#traverse_balanced</a>
+ <li ><a href="#method-i-traverse_sequences">#traverse_sequences</a>
+ <li ><a href="#method-i-unpatch">#unpatch</a>
+ <li ><a href="#method-i-unpatch-21">#unpatch!</a>
+ <li ><a href="#method-i-unpatch_me">#unpatch_me</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-labelledby="module-LCS">
+ <h1 id="module-LCS" class="module">
+ module LCS
+ </h1>
+
+ <section class="description">
+
+<h2 id="module-LCS-label-How+Diff+Works+-28by+Mark-Jason+Dominus-29">How <a href="Diff.html"><code>Diff</code></a> Works (by Mark-Jason Dominus)<span><a href="#module-LCS-label-How+Diff+Works+-28by+Mark-Jason+Dominus-29">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<p>I once read an article written by the authors of <code>diff</code>; they said that they hard worked very hard on the algorithm until they found the right one.</p>
+
+<p>I think what they ended up using (and I hope someone will correct me, because I am not very confident about this) was the `longest common subsequence&#39; method. In the <a href="LCS.html"><code>LCS</code></a> problem, you have two sequences of items:</p>
+
+<pre class="ruby"><span class="ruby-identifier">a</span> <span class="ruby-identifier">b</span> <span class="ruby-identifier">c</span> <span class="ruby-identifier">d</span> <span class="ruby-identifier">f</span> <span class="ruby-identifier">g</span> <span class="ruby-identifier">h</span> <span class="ruby-identifier">j</span> <span class="ruby-identifier">q</span> <span class="ruby-identifier">z</span>
+<span class="ruby-identifier">a</span> <span class="ruby-identifier">b</span> <span class="ruby-identifier">c</span> <span class="ruby-identifier">d</span> <span class="ruby-identifier">e</span> <span class="ruby-identifier">f</span> <span class="ruby-identifier">g</span> <span class="ruby-identifier">i</span> <span class="ruby-identifier">j</span> <span class="ruby-identifier">k</span> <span class="ruby-identifier">r</span> <span class="ruby-identifier">x</span> <span class="ruby-identifier">y</span> <span class="ruby-identifier">z</span>
+</pre>
+
+<p>and you want to find the longest sequence of items that is present in both original sequences in the same order. That is, you want to find a new sequence <strong>S</strong> which can be obtained from the first sequence by deleting some items, and from the second sequence by deleting other items. You also want <strong>S</strong> to be as long as possible. In this case <strong>S</strong> is:</p>
+
+<pre class="ruby"><span class="ruby-identifier">a</span> <span class="ruby-identifier">b</span> <span class="ruby-identifier">c</span> <span class="ruby-identifier">d</span> <span class="ruby-identifier">f</span> <span class="ruby-identifier">g</span> <span class="ruby-identifier">j</span> <span class="ruby-identifier">z</span>
+</pre>
+
+<p>From there it&#39;s only a small step to get diff-like output:</p>
+
+<pre>e h i k q r x y
++ - + + - + + +</pre>
+
+<p>This module solves the <a href="LCS.html"><code>LCS</code></a> problem. It also includes a canned function to generate <code>diff</code>-like output.</p>
+
+<p>It might seem from the example above that the <a href="LCS.html"><code>LCS</code></a> of two sequences is always pretty obvious, but that&#39;s not always the case, especially when the two sequences have many repeated elements. For example, consider</p>
+
+<pre class="ruby"><span class="ruby-identifier">a</span> <span class="ruby-identifier">x</span> <span class="ruby-identifier">b</span> <span class="ruby-identifier">y</span> <span class="ruby-identifier">c</span> <span class="ruby-identifier">z</span> <span class="ruby-identifier">p</span> <span class="ruby-identifier">d</span> <span class="ruby-identifier">q</span>
+<span class="ruby-identifier">a</span> <span class="ruby-identifier">b</span> <span class="ruby-identifier">c</span> <span class="ruby-identifier">a</span> <span class="ruby-identifier">x</span> <span class="ruby-identifier">b</span> <span class="ruby-identifier">y</span> <span class="ruby-identifier">c</span> <span class="ruby-identifier">z</span>
+</pre>
+
+<p>A naive approach might start by matching up the <code>a</code> and <code>b</code> that appear at the beginning of each sequence, like this:</p>
+
+<pre class="ruby"><span class="ruby-identifier">a</span> <span class="ruby-identifier">x</span> <span class="ruby-identifier">b</span> <span class="ruby-identifier">y</span> <span class="ruby-identifier">c</span> <span class="ruby-identifier">z</span> <span class="ruby-identifier">p</span> <span class="ruby-identifier">d</span> <span class="ruby-identifier">q</span>
+<span class="ruby-identifier">a</span> <span class="ruby-identifier">b</span> <span class="ruby-identifier">c</span> <span class="ruby-identifier">a</span> <span class="ruby-identifier">b</span> <span class="ruby-identifier">y</span> <span class="ruby-identifier">c</span> <span class="ruby-identifier">z</span>
+</pre>
+
+<p>This finds the common subsequence +a b c z+. But actually, the <a href="LCS.html"><code>LCS</code></a> is +a x b y c z+:</p>
+
+<pre class="ruby"> <span class="ruby-identifier">a</span> <span class="ruby-identifier">x</span> <span class="ruby-identifier">b</span> <span class="ruby-identifier">y</span> <span class="ruby-identifier">c</span> <span class="ruby-identifier">z</span> <span class="ruby-identifier">p</span> <span class="ruby-identifier">d</span> <span class="ruby-identifier">q</span>
+<span class="ruby-identifier">a</span> <span class="ruby-identifier">b</span> <span class="ruby-identifier">c</span> <span class="ruby-identifier">a</span> <span class="ruby-identifier">x</span> <span class="ruby-identifier">b</span> <span class="ruby-identifier">y</span> <span class="ruby-identifier">c</span> <span class="ruby-identifier">z</span>
+</pre>
+
+ </section>
+
+ <section id="5Buntitled-5D" class="documentation-section">
+
+
+ <section class="constants-list">
+ <header>
+ <h3>Constants</h3>
+ </header>
+ <dl>
+ <dt id="BalancedCallbacks">BalancedCallbacks
+ <dd><p>This callback object implements the default set of callback events, which only returns the event itself. Note that finished_a and finished_b are not implemented – I haven&#39;t yet figured out where they would be useful.</p>
+
+<p>Note that this is intended to be called as is, e.g.,</p>
+
+<pre class="ruby"><span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-constant">LCS</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">DefaultCallbacks</span>)
+</pre>
+ <dt id="SequenceCallbacks">SequenceCallbacks
+ <dd><p>This callback object implements the default set of callback events, which only returns the event itself. Note that finished_a and finished_b are not implemented – I haven&#39;t yet figured out where they would be useful.</p>
+
+<p>Note that this is intended to be called as is, e.g.,</p>
+
+<pre class="ruby"><span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-constant">LCS</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">DefaultCallbacks</span>)
+</pre>
+ <dt id="VERSION">VERSION
+ <dd>
+ </dl>
+ </section>
+
+
+
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Class Methods</h3>
+ </header>
+
+ <div id="method-c-LCS" class="method-detail method-alias">
+ <div class="method-heading">
+ <span class="method-name">LCS</span><span
+ class="method-args">(seq1, seq2, &amp;block)</span>
+ </div>
+
+ <div class="method-description">
+
+
+ </div>
+
+
+ <div class="aliases">
+ Alias for: <a href="LCS.html#method-c-lcs">lcs</a>
+ </div>
+ </div>
+
+ <div id="method-c-callbacks_for" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">callbacks_for</span><span
+ class="method-args">(callbacks)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="callbacks_for-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 52</span>
+<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">callbacks_for</span>(<span class="ruby-identifier">callbacks</span>)
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">rescue</span> <span class="ruby-identifier">callbacks</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-c-diff" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">diff</span><span
+ class="method-args">(seq1, seq2, callbacks = nil, &amp;block)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p><a href="LCS.html#method-i-diff"><code>diff</code></a> computes the smallest set of additions and deletions necessary to turn the first sequence into the second, and returns a description of these changes.</p>
+
+<p>See Diff::LCS::DiffCallbacks for the default behaviour. An alternate behaviour may be implemented with Diff::LCS::ContextDiffCallbacks. If a Class argument is provided for <code>callbacks</code>, <a href="LCS.html#method-i-diff"><code>diff</code></a> will attempt to initialise it. If the <code>callbacks</code> object (possibly initialised) responds to finish, it will be called.</p>
+
+ <div class="method-source-code" id="diff-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 168</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">diff</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">callbacks</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-comment"># :yields diff changes:</span>
+ <span class="ruby-identifier">diff_traversal</span>(<span class="ruby-value">:diff</span>, <span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">callbacks</span> <span class="ruby-operator">||</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">DiffCallbacks</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-c-lcs" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">lcs</span><span
+ class="method-args">(seq1, seq2, &amp;block)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="lcs-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 144</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">lcs</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-comment">#:yields seq1[i] for each matched:</span>
+ <span class="ruby-identifier">matches</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Internals</span>.<span class="ruby-identifier">lcs</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>)
+ <span class="ruby-identifier">ret</span> = []
+ <span class="ruby-identifier">string</span> = <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">String</span>
+ <span class="ruby-identifier">matches</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">_e</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
+ <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">matches</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">nil?</span>
+
+ <span class="ruby-identifier">v</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">i</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">i</span>]
+ <span class="ruby-identifier">v</span> = <span class="ruby-identifier">block</span>[<span class="ruby-identifier">v</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">block</span>
+ <span class="ruby-identifier">ret</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">v</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-identifier">ret</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+ <div class="aliases">
+ Also aliased as: <a href="LCS.html#method-c-LCS">LCS</a>
+ </div>
+
+ </div>
+
+ <div id="method-c-patch" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">patch</span><span
+ class="method-args">(src, patchset, direction = nil)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Applies a <code>patchset</code> to the sequence <code>src</code> according to the <code>direction</code> (<code>:patch</code> or <code>:unpatch</code>), producing a new sequence.</p>
+
+<p>If the <code>direction</code> is not specified, <a href="LCS.html#method-c-patch"><code>Diff::LCS::patch</code></a> will attempt to discover the direction of the <code>patchset</code>.</p>
+
+<p>A <code>patchset</code> can be considered to apply forward (<code>:patch</code>) if the following expression is true:</p>
+
+<pre>patch(s1, diff(s1, s2)) -&gt; s2</pre>
+
+<p>A <code>patchset</code> can be considered to apply backward (<code>:unpatch</code>) if the following expression is true:</p>
+
+<pre>patch(s2, diff(s1, s2)) -&gt; s1</pre>
+
+<p>If the <code>patchset</code> contains no changes, the <code>src</code> value will be returned as either <code>src.dup</code> or <code>src</code>. A <code>patchset</code> can be deemed as having no changes if the following predicate returns true:</p>
+
+<pre class="ruby"><span class="ruby-identifier">patchset</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword">or</span>
+ <span class="ruby-identifier">patchset</span>.<span class="ruby-identifier">flatten</span>(<span class="ruby-value">1</span>).<span class="ruby-identifier">all?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">change</span><span class="ruby-operator">|</span> <span class="ruby-identifier">change</span>.<span class="ruby-identifier">unchanged?</span> }
+</pre>
+
+<h3 id="method-c-patch-label-Patchsets">Patchsets<span><a href="#method-c-patch-label-Patchsets">&para;</a> <a href="#top">&uarr;</a></span></h3>
+
+<p>A <code>patchset</code> is always an enumerable sequence of changes, hunks of changes, or a mix of the two. A hunk of changes is an enumerable sequence of changes:</p>
+
+<pre class="ruby">[ <span class="ruby-comment"># patchset</span>
+ <span class="ruby-comment"># change</span>
+ [ <span class="ruby-comment"># hunk</span>
+ <span class="ruby-comment"># change</span>
+ ]
+]
+</pre>
+
+<p>The <code>patch</code> method accepts <code>patchset</code>s that are enumerable sequences containing either Diff::LCS::Change objects (or a subclass) or the array representations of those objects. Prior to application, array representations of Diff::LCS::Change objects will be reified.</p>
+
+ <div class="method-source-code" id="patch-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 624</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">patch</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">patchset</span>, <span class="ruby-identifier">direction</span> = <span class="ruby-keyword">nil</span>)
+ <span class="ruby-comment"># Normalize the patchset.</span>
+ <span class="ruby-identifier">has_changes</span>, <span class="ruby-identifier">patchset</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Internals</span>.<span class="ruby-identifier">analyze_patchset</span>(<span class="ruby-identifier">patchset</span>)
+
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">src</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:dup</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">src</span>.<span class="ruby-identifier">dup</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">src</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">has_changes</span>
+
+ <span class="ruby-identifier">string</span> = <span class="ruby-identifier">src</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">String</span>)
+ <span class="ruby-comment"># Start with a new empty type of the source&#39;s class</span>
+ <span class="ruby-identifier">res</span> = <span class="ruby-identifier">src</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>
+
+ <span class="ruby-identifier">direction</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Internals</span>.<span class="ruby-identifier">intuit_diff_direction</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">patchset</span>)
+
+ <span class="ruby-identifier">ai</span> = <span class="ruby-identifier">bj</span> = <span class="ruby-value">0</span>
+
+ <span class="ruby-identifier">patch_map</span> = <span class="ruby-constant">PATCH_MAP</span>[<span class="ruby-identifier">direction</span>]
+
+ <span class="ruby-identifier">patchset</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">change</span><span class="ruby-operator">|</span>
+ <span class="ruby-comment"># Both Change and ContextChange support #action</span>
+ <span class="ruby-identifier">action</span> = <span class="ruby-identifier">patch_map</span>[<span class="ruby-identifier">change</span>.<span class="ruby-identifier">action</span>]
+
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">change</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">direction</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-value">:patch</span>
+ <span class="ruby-identifier">el</span> = <span class="ruby-identifier">change</span>.<span class="ruby-identifier">new_element</span>
+ <span class="ruby-identifier">op</span> = <span class="ruby-identifier">change</span>.<span class="ruby-identifier">old_position</span>
+ <span class="ruby-identifier">np</span> = <span class="ruby-identifier">change</span>.<span class="ruby-identifier">new_position</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-value">:unpatch</span>
+ <span class="ruby-identifier">el</span> = <span class="ruby-identifier">change</span>.<span class="ruby-identifier">old_element</span>
+ <span class="ruby-identifier">op</span> = <span class="ruby-identifier">change</span>.<span class="ruby-identifier">new_position</span>
+ <span class="ruby-identifier">np</span> = <span class="ruby-identifier">change</span>.<span class="ruby-identifier">old_position</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">action</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;-&#39;</span> <span class="ruby-comment"># Remove details from the old string</span>
+ <span class="ruby-keyword">while</span> <span class="ruby-identifier">ai</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">op</span>
+ <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">ai</span>])
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;+&#39;</span>
+ <span class="ruby-keyword">while</span> <span class="ruby-identifier">bj</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">np</span>
+ <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">ai</span>])
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">el</span>
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;=&#39;</span>
+ <span class="ruby-comment"># This only appears in sdiff output with the SDiff callback.</span>
+ <span class="ruby-comment"># Therefore, we only need to worry about dealing with a single</span>
+ <span class="ruby-comment"># element.</span>
+ <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">el</span>
+
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;!&#39;</span>
+ <span class="ruby-keyword">while</span> <span class="ruby-identifier">ai</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">op</span>
+ <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">ai</span>])
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+
+ <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">el</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Change</span>
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">action</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;-&#39;</span>
+ <span class="ruby-keyword">while</span> <span class="ruby-identifier">ai</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">change</span>.<span class="ruby-identifier">position</span>
+ <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">ai</span>])
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;+&#39;</span>
+ <span class="ruby-keyword">while</span> <span class="ruby-identifier">bj</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">change</span>.<span class="ruby-identifier">position</span>
+ <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">ai</span>])
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+
+ <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">change</span>.<span class="ruby-identifier">element</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-keyword">while</span> <span class="ruby-identifier">ai</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">src</span>.<span class="ruby-identifier">size</span>
+ <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">src</span>[<span class="ruby-identifier">ai</span>])
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-identifier">res</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-c-patch-21" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">patch!</span><span
+ class="method-args">(src, patchset)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Given a set of patchset, convert the current version to the next version. Does no auto-discovery.</p>
+
+ <div class="method-source-code" id="patch-21-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 734</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">patch!</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">patchset</span>)
+ <span class="ruby-identifier">patch</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">patchset</span>, <span class="ruby-value">:patch</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-c-sdiff" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">sdiff</span><span
+ class="method-args">(seq1, seq2, callbacks = nil, &amp;block)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p><a href="LCS.html#method-i-sdiff"><code>sdiff</code></a> computes all necessary components to show two sequences and their minimized differences side by side, just like the Unix utility <em>sdiff</em> does:</p>
+
+<pre>old &lt; -
+same same
+before | after
+- &gt; new</pre>
+
+<p>See Diff::LCS::SDiffCallbacks for the default behaviour. An alternate behaviour may be implemented with Diff::LCS::ContextDiffCallbacks. If a Class argument is provided for <code>callbacks</code>, <a href="LCS.html#method-i-diff"><code>diff</code></a> will attempt to initialise it. If the <code>callbacks</code> object (possibly initialised) responds to finish, it will be called.</p>
+
+<p>Each element of a returned array is a Diff::LCS::ContextChange object, which can be implicitly converted to an array.</p>
+
+<pre class="ruby"><span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">sdiff</span>(<span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">action</span>, (<span class="ruby-identifier">old_pos</span>, <span class="ruby-identifier">old_element</span>), (<span class="ruby-identifier">new_pos</span>, <span class="ruby-identifier">new_element</span>)<span class="ruby-operator">|</span>
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">action</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;!&#39;</span>
+ <span class="ruby-comment"># replace</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;-&#39;</span>
+ <span class="ruby-comment"># delete</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;+&#39;</span>
+ <span class="ruby-comment"># insert</span>
+ <span class="ruby-keyword">end</span>
+<span class="ruby-keyword">end</span>
+</pre>
+
+ <div class="method-source-code" id="sdiff-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 200</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sdiff</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">callbacks</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-comment">#:yields diff changes:</span>
+ <span class="ruby-identifier">diff_traversal</span>(<span class="ruby-value">:sdiff</span>, <span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">callbacks</span> <span class="ruby-operator">||</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">SDiffCallbacks</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-c-traverse_balanced" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">traverse_balanced</span><span
+ class="method-args">(seq1, seq2, callbacks = Diff::LCS::BalancedCallbacks) { |event| ... }</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p><a href="LCS.html#method-i-traverse_balanced"><code>traverse_balanced</code></a> is an alternative to <a href="LCS.html#method-i-traverse_sequences"><code>traverse_sequences</code></a>. It uses a different algorithm to iterate through the entries in the computed longest common subsequence. Instead of viewing the changes as insertions or deletions from one of the sequences, <a href="LCS.html#method-i-traverse_balanced"><code>traverse_balanced</code></a> will report <em>changes</em> between the sequences.</p>
+
+<p>The arguments to <a href="LCS.html#method-i-traverse_balanced"><code>traverse_balanced</code></a> are the two sequences to traverse and a callback object, like this:</p>
+
+<pre class="ruby"><span class="ruby-identifier">traverse_balanced</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextDiffCallbacks</span>.<span class="ruby-identifier">new</span>)
+</pre>
+
+<p><a href="LCS.html#method-i-sdiff"><code>sdiff</code></a> is implemented with <a href="LCS.html#method-i-traverse_balanced"><code>traverse_balanced</code></a>.</p>
+
+<h2 id="method-c-traverse_balanced-label-Callback+Methods">Callback Methods<span><a href="#method-c-traverse_balanced-label-Callback+Methods">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<p>Optional callback methods are <em>emphasized</em>.</p>
+<dl class="rdoc-list note-list"><dt>callbacks#match
+<dd>
+<p>Called when <code>a</code> and <code>b</code> are pointing to common elements in <code>A</code> and <code>B</code>.</p>
+</dd><dt>callbacks#discard_a
+<dd>
+<p>Called when <code>a</code> is pointing to an element not in <code>B</code>.</p>
+</dd><dt>callbacks#discard_b
+<dd>
+<p>Called when <code>b</code> is pointing to an element not in <code>A</code>.</p>
+</dd><dt><em>callbacks#change</em>
+<dd>
+<p>Called when <code>a</code> and <code>b</code> are pointing to the same relative position, but <code>A[a]</code> and <code>B[b]</code> are not the same; a <em>change</em> has occurred.</p>
+</dd></dl>
+
+<p><a href="LCS.html#method-i-traverse_balanced"><code>traverse_balanced</code></a> might be a bit slower than <a href="LCS.html#method-i-traverse_sequences"><code>traverse_sequences</code></a>, noticable only while processing huge amounts of data.</p>
+
+<h2 id="method-c-traverse_balanced-label-Algorithm">Algorithm<span><a href="#method-c-traverse_balanced-label-Algorithm">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<pre>a---+
+ v
+A = a b c e h j l m n p
+B = b c d e f j k l m r s t
+ ^
+b---+</pre>
+
+<h3 id="method-c-traverse_balanced-label-Matches">Matches<span><a href="#method-c-traverse_balanced-label-Matches">&para;</a> <a href="#top">&uarr;</a></span></h3>
+
+<p>If there are two arrows (<code>a</code> and <code>b</code>) pointing to elements of sequences <code>A</code> and <code>B</code>, the arrows will initially point to the first elements of their respective sequences. <a href="LCS.html#method-i-traverse_sequences"><code>traverse_sequences</code></a> will advance the arrows through the sequences one element at a time, calling a method on the user-specified callback object before each advance. It will advance the arrows in such a way that if there are elements <code>A[i]</code> and <code>B[j]</code> which are both equal and part of the longest common subsequence, there will be some moment during the execution of <a href="LCS.html#method-i-traverse_sequences"><code>traverse_sequences</code></a> when arrow <code>a</code> is pointing to <code>A[i]</code> and arrow <code>b</code> is pointing to <code>B[j]</code>. When this happens, <a href="LCS.html#method-i-traverse_sequences"><code>traverse_sequences</code></a> will call <code>callbacks#match</code> and then it will advance both arrows.</p>
+
+<h3 id="method-c-traverse_balanced-label-Discards">Discards<span><a href="#method-c-traverse_balanced-label-Discards">&para;</a> <a href="#top">&uarr;</a></span></h3>
+
+<p>Otherwise, one of the arrows is pointing to an element of its sequence that is not part of the longest common subsequence. <a href="LCS.html#method-i-traverse_sequences"><code>traverse_sequences</code></a> will advance that arrow and will call <code>callbacks#discard_a</code> or <code>callbacks#discard_b</code>, depending on which arrow it advanced.</p>
+
+<h3 id="method-c-traverse_balanced-label-Changes">Changes<span><a href="#method-c-traverse_balanced-label-Changes">&para;</a> <a href="#top">&uarr;</a></span></h3>
+
+<p>If both <code>a</code> and <code>b</code> point to elements that are not part of the longest common subsequence, then <a href="LCS.html#method-i-traverse_sequences"><code>traverse_sequences</code></a> will try to call <code>callbacks#change</code> and advance both arrows. If <code>callbacks#change</code> is not implemented, then <code>callbacks#discard_a</code> and <code>callbacks#discard_b</code> will be called in turn.</p>
+
+<p>The methods for <code>callbacks#match</code>, <code>callbacks#discard_a</code>, <code>callbacks#discard_b</code>, and <code>callbacks#change</code> are invoked with an event comprising the action (“=”, “+”, “-”, or “!”, respectively), the indicies <code>i</code> and <code>j</code>, and the elements <code>A[i]</code> and <code>B[j]</code>. Return values are discarded by <a href="LCS.html#method-i-traverse_balanced"><code>traverse_balanced</code></a>.</p>
+
+<h3 id="method-c-traverse_balanced-label-Context">Context<span><a href="#method-c-traverse_balanced-label-Context">&para;</a> <a href="#top">&uarr;</a></span></h3>
+
+<p>Note that <code>i</code> and <code>j</code> may not be the same index position, even if <code>a</code> and <code>b</code> are considered to be pointing to matching or changed elements.</p>
+
+ <div class="method-source-code" id="traverse_balanced-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 475</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">traverse_balanced</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">callbacks</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">BalancedCallbacks</span>)
+ <span class="ruby-identifier">matches</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Internals</span>.<span class="ruby-identifier">lcs</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>)
+ <span class="ruby-identifier">a_size</span> = <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">size</span>
+ <span class="ruby-identifier">b_size</span> = <span class="ruby-identifier">seq2</span>.<span class="ruby-identifier">size</span>
+ <span class="ruby-identifier">ai</span> = <span class="ruby-identifier">bj</span> = <span class="ruby-identifier">mb</span> = <span class="ruby-value">0</span>
+ <span class="ruby-identifier">ma</span> = <span class="ruby-value">-1</span>
+ <span class="ruby-identifier">string</span> = <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">String</span>)
+
+ <span class="ruby-comment"># Process all the lines in the match vector.</span>
+ <span class="ruby-identifier">loop</span> <span class="ruby-keyword">do</span>
+ <span class="ruby-comment"># Find next match indices +ma+ and +mb+</span>
+ <span class="ruby-identifier">loop</span> <span class="ruby-keyword">do</span>
+ <span class="ruby-identifier">ma</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">break</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">ma</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">matches</span>.<span class="ruby-identifier">size</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">matches</span>[<span class="ruby-identifier">ma</span>].<span class="ruby-identifier">nil?</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">ma</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">matches</span>.<span class="ruby-identifier">size</span> <span class="ruby-comment"># end of matches?</span>
+
+ <span class="ruby-identifier">mb</span> = <span class="ruby-identifier">matches</span>[<span class="ruby-identifier">ma</span>]
+
+ <span class="ruby-comment"># Change(seq2)</span>
+ <span class="ruby-keyword">while</span> (<span class="ruby-identifier">ai</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">ma</span>) <span class="ruby-keyword">or</span> (<span class="ruby-identifier">bj</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">mb</span>)
+ <span class="ruby-identifier">ax</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>]
+ <span class="ruby-identifier">bx</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>]
+
+ <span class="ruby-keyword">case</span> [(<span class="ruby-identifier">ai</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">ma</span>), (<span class="ruby-identifier">bj</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">mb</span>)]
+ <span class="ruby-keyword">when</span> [<span class="ruby-keyword">true</span>, <span class="ruby-keyword">true</span>]
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:change</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;!&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">change</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;-&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">discard_a</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-identifier">ax</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>]
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;+&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">discard_b</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">when</span> [<span class="ruby-keyword">true</span>, <span class="ruby-keyword">false</span>]
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;-&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">discard_a</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">when</span> [<span class="ruby-keyword">false</span>, <span class="ruby-keyword">true</span>]
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;+&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">discard_b</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-comment"># Match</span>
+ <span class="ruby-identifier">ax</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>]
+ <span class="ruby-identifier">bx</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>]
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;=&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-keyword">while</span> (<span class="ruby-identifier">ai</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">a_size</span>) <span class="ruby-keyword">or</span> (<span class="ruby-identifier">bj</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">b_size</span>)
+ <span class="ruby-identifier">ax</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>]
+ <span class="ruby-identifier">bx</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>]
+
+ <span class="ruby-keyword">case</span> [(<span class="ruby-identifier">ai</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">a_size</span>), (<span class="ruby-identifier">bj</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">b_size</span>)]
+ <span class="ruby-keyword">when</span> [<span class="ruby-keyword">true</span>, <span class="ruby-keyword">true</span>]
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:change</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;!&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">change</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;-&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">discard_a</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-identifier">ax</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>]
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;+&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">discard_b</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">when</span> [<span class="ruby-keyword">true</span>, <span class="ruby-keyword">false</span>]
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;-&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">discard_a</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">when</span> [<span class="ruby-keyword">false</span>, <span class="ruby-keyword">true</span>]
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;+&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">discard_b</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-c-traverse_sequences" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">traverse_sequences</span><span
+ class="method-args">(seq1, seq2, callbacks = Diff::LCS::SequenceCallbacks) { |event| ... }</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p><a href="LCS.html#method-i-traverse_sequences"><code>traverse_sequences</code></a> is the most general facility provided by this module; <a href="LCS.html#method-i-diff"><code>diff</code></a> and <a href="LCS.html#method-i-lcs"><code>lcs</code></a> are implemented as calls to it.</p>
+
+<p>The arguments to <a href="LCS.html#method-i-traverse_sequences"><code>traverse_sequences</code></a> are the two sequences to traverse, and a callback object, like this:</p>
+
+<pre class="ruby"><span class="ruby-identifier">traverse_sequences</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextDiffCallbacks</span>.<span class="ruby-identifier">new</span>)
+</pre>
+
+<h2 id="method-c-traverse_sequences-label-Callback+Methods">Callback Methods<span><a href="#method-c-traverse_sequences-label-Callback+Methods">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<p>Optional callback methods are <em>emphasized</em>.</p>
+<dl class="rdoc-list note-list"><dt>callbacks#match
+<dd>
+<p>Called when <code>a</code> and <code>b</code> are pointing to common elements in <code>A</code> and <code>B</code>.</p>
+</dd><dt>callbacks#discard_a
+<dd>
+<p>Called when <code>a</code> is pointing to an element not in <code>B</code>.</p>
+</dd><dt>callbacks#discard_b
+<dd>
+<p>Called when <code>b</code> is pointing to an element not in <code>A</code>.</p>
+</dd><dt><em>callbacks#finished_a</em>
+<dd>
+<p>Called when <code>a</code> has reached the end of sequence <code>A</code>.</p>
+</dd><dt><em>callbacks#finished_b</em>
+<dd>
+<p>Called when <code>b</code> has reached the end of sequence <code>B</code>.</p>
+</dd></dl>
+
+<h2 id="method-c-traverse_sequences-label-Algorithm">Algorithm<span><a href="#method-c-traverse_sequences-label-Algorithm">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<pre>a---+
+ v
+A = a b c e h j l m n p
+B = b c d e f j k l m r s t
+ ^
+b---+</pre>
+
+<p>If there are two arrows (<code>a</code> and <code>b</code>) pointing to elements of sequences <code>A</code> and <code>B</code>, the arrows will initially point to the first elements of their respective sequences. <a href="LCS.html#method-i-traverse_sequences"><code>traverse_sequences</code></a> will advance the arrows through the sequences one element at a time, calling a method on the user-specified callback object before each advance. It will advance the arrows in such a way that if there are elements <code>A[i]</code> and <code>B[j]</code> which are both equal and part of the longest common subsequence, there will be some moment during the execution of <a href="LCS.html#method-i-traverse_sequences"><code>traverse_sequences</code></a> when arrow <code>a</code> is pointing to <code>A[i]</code> and arrow <code>b</code> is pointing to <code>B[j]</code>. When this happens, <a href="LCS.html#method-i-traverse_sequences"><code>traverse_sequences</code></a> will call <code>callbacks#match</code> and then it will advance both arrows.</p>
+
+<p>Otherwise, one of the arrows is pointing to an element of its sequence that is not part of the longest common subsequence. <a href="LCS.html#method-i-traverse_sequences"><code>traverse_sequences</code></a> will advance that arrow and will call <code>callbacks#discard_a</code> or <code>callbacks#discard_b</code>, depending on which arrow it advanced. If both arrows point to elements that are not part of the longest common subsequence, then <a href="LCS.html#method-i-traverse_sequences"><code>traverse_sequences</code></a> will advance arrow <code>a</code> and call the appropriate callback, then it will advance arrow <code>b</code> and call the appropriate callback.</p>
+
+<p>The methods for <code>callbacks#match</code>, <code>callbacks#discard_a</code>, and <code>callbacks#discard_b</code> are invoked with an event comprising the action (“=”, “+”, or “-”, respectively), the indicies <code>i</code> and <code>j</code>, and the elements <code>A[i]</code> and <code>B[j]</code>. Return values are discarded by <a href="LCS.html#method-i-traverse_sequences"><code>traverse_sequences</code></a>.</p>
+
+<h3 id="method-c-traverse_sequences-label-End+of+Sequences">End of Sequences<span><a href="#method-c-traverse_sequences-label-End+of+Sequences">&para;</a> <a href="#top">&uarr;</a></span></h3>
+
+<p>If arrow <code>a</code> reaches the end of its sequence before arrow <code>b</code> does, traverse_sequence will try to call <code>callbacks#finished_a</code> with the last index and element of <code>A</code> (<code>A[-1]</code>) and the current index and element of <code>B</code> (<code>B[j]</code>). If <code>callbacks#finished_a</code> does not exist, then <code>callbacks#discard_b</code> will be called on each element of <code>B</code> until the end of the sequence is reached (the call will be done with <code>A[-1]</code> and <code>B[j]</code> for each element).</p>
+
+<p>If <code>b</code> reaches the end of <code>B</code> before <code>a</code> reaches the end of <code>A</code>, <code>callbacks#finished_b</code> will be called with the current index and element of <code>A</code> (<code>A[i]</code>) and the last index and element of <code>B</code> (<code>A[-1]</code>). Again, if <code>callbacks#finished_b</code> does not exist on the callback object, then <code>callbacks#discard_a</code> will be called on each element of <code>A</code> until the end of the sequence is reached (<code>A[i]</code> and <code>B[-1]</code>).</p>
+
+<p>There is a chance that one additional <code>callbacks#discard_a</code> or <code>callbacks#discard_b</code> will be called after the end of the sequence is reached, if <code>a</code> has not yet reached the end of <code>A</code> or <code>b</code> has not yet reached the end of <code>B</code>.</p>
+
+ <div class="method-source-code" id="traverse_sequences-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 285</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">traverse_sequences</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">callbacks</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">SequenceCallbacks</span>) <span class="ruby-comment">#:yields change events:</span>
+ <span class="ruby-identifier">callbacks</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">SequenceCallbacks</span>
+ <span class="ruby-identifier">matches</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Internals</span>.<span class="ruby-identifier">lcs</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>)
+
+ <span class="ruby-identifier">run_finished_a</span> = <span class="ruby-identifier">run_finished_b</span> = <span class="ruby-keyword">false</span>
+ <span class="ruby-identifier">string</span> = <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">String</span>)
+
+ <span class="ruby-identifier">a_size</span> = <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">size</span>
+ <span class="ruby-identifier">b_size</span> = <span class="ruby-identifier">seq2</span>.<span class="ruby-identifier">size</span>
+ <span class="ruby-identifier">ai</span> = <span class="ruby-identifier">bj</span> = <span class="ruby-value">0</span>
+
+ <span class="ruby-identifier">matches</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">b_line</span><span class="ruby-operator">|</span>
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">b_line</span>.<span class="ruby-identifier">nil?</span>
+ <span class="ruby-keyword">unless</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>].<span class="ruby-identifier">nil?</span>
+ <span class="ruby-identifier">ax</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>]
+ <span class="ruby-identifier">bx</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>]
+
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;-&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">discard_a</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">ax</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>]
+
+ <span class="ruby-identifier">loop</span> <span class="ruby-keyword">do</span>
+ <span class="ruby-keyword">break</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">bj</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">b_line</span>
+
+ <span class="ruby-identifier">bx</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>]
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;+&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">discard_b</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-identifier">bx</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>]
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;=&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-comment"># The last entry (if any) processed was a match. +ai+ and +bj+ point just</span>
+ <span class="ruby-comment"># past the last matching lines in their sequences.</span>
+ <span class="ruby-keyword">while</span> (<span class="ruby-identifier">ai</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">a_size</span>) <span class="ruby-keyword">or</span> (<span class="ruby-identifier">bj</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">b_size</span>)
+ <span class="ruby-comment"># last A?</span>
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">ai</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">a_size</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">bj</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">b_size</span>
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:finished_a</span>) <span class="ruby-keyword">and</span> <span class="ruby-operator">!</span><span class="ruby-identifier">run_finished_a</span>
+ <span class="ruby-identifier">ax</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-value">-1</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-value">-1</span>]
+ <span class="ruby-identifier">bx</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>]
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;&gt;&#39;</span>, (<span class="ruby-identifier">a_size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>), <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">finished_a</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">run_finished_a</span> = <span class="ruby-keyword">true</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">ax</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>]
+ <span class="ruby-identifier">loop</span> <span class="ruby-keyword">do</span>
+ <span class="ruby-identifier">bx</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>]
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;+&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">discard_b</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">break</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">bj</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">b_size</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-comment"># last B?</span>
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">bj</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">b_size</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">ai</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">a_size</span>
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:finished_b</span>) <span class="ruby-keyword">and</span> <span class="ruby-operator">!</span><span class="ruby-identifier">run_finished_b</span>
+ <span class="ruby-identifier">ax</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>]
+ <span class="ruby-identifier">bx</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-value">-1</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-value">-1</span>]
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;&lt;&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, (<span class="ruby-identifier">b_size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>), <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">finished_b</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">run_finished_b</span> = <span class="ruby-keyword">true</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">bx</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>]
+ <span class="ruby-identifier">loop</span> <span class="ruby-keyword">do</span>
+ <span class="ruby-identifier">ax</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>]
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;-&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">discard_a</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">break</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">bj</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">b_size</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">ai</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">a_size</span>
+ <span class="ruby-identifier">ax</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>]
+ <span class="ruby-identifier">bx</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>]
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;-&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">discard_a</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">bj</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">b_size</span>
+ <span class="ruby-identifier">ax</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq1</span>[<span class="ruby-identifier">ai</span>]
+ <span class="ruby-identifier">bx</span> = <span class="ruby-identifier">string</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>, <span class="ruby-value">1</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">seq2</span>[<span class="ruby-identifier">bj</span>]
+ <span class="ruby-identifier">event</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;+&#39;</span>, <span class="ruby-identifier">ai</span>, <span class="ruby-identifier">ax</span>, <span class="ruby-identifier">bj</span>, <span class="ruby-identifier">bx</span>)
+ <span class="ruby-identifier">event</span> = <span class="ruby-keyword">yield</span> <span class="ruby-identifier">event</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-identifier">callbacks</span>.<span class="ruby-identifier">discard_b</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">bj</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-c-unpatch-21" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">unpatch!</span><span
+ class="method-args">(src, patchset)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Given a set of patchset, convert the current version to the prior version. Does no auto-discovery.</p>
+
+ <div class="method-source-code" id="unpatch-21-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 728</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">unpatch!</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">patchset</span>)
+ <span class="ruby-identifier">patch</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">patchset</span>, <span class="ruby-value">:unpatch</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Instance Methods</h3>
+ </header>
+
+ <div id="method-i-diff" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">diff</span><span
+ class="method-args">(other, callbacks = nil, &amp;block)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Returns the difference set between <code>self</code> and <code>other</code>. See <a href="LCS.html#method-i-diff"><code>Diff::LCS#diff</code></a>.</p>
+
+ <div class="method-source-code" id="diff-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 75</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">diff</span>(<span class="ruby-identifier">other</span>, <span class="ruby-identifier">callbacks</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+ <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">diff</span>(<span class="ruby-keyword">self</span>, <span class="ruby-identifier">other</span>, <span class="ruby-identifier">callbacks</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-lcs" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">lcs</span><span
+ class="method-args">(other, &amp;block)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Returns an <a href="Array.html"><code>Array</code></a> containing the longest common subsequence(s) between <code>self</code> and <code>other</code>. See <a href="LCS.html#method-i-lcs"><code>Diff::LCS#lcs</code></a>.</p>
+
+<pre class="ruby"><span class="ruby-identifier">lcs</span> = <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">lcs</span>(<span class="ruby-identifier">seq2</span>)
+</pre>
+
+<p>A note when using objects: <a href="LCS.html"><code>Diff::LCS</code></a> only works properly when each object can be used as a key in a Hash, which typically means that the objects must implement Object#eql? in a way that two identical values compare identically for key purposes. That is:</p>
+
+<pre class="ruby"><span class="ruby-constant">O</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;a&#39;</span>).<span class="ruby-identifier">eql?</span>(<span class="ruby-constant">O</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;a&#39;</span>)) <span class="ruby-operator">==</span> <span class="ruby-keyword">true</span>
+</pre>
+
+ <div class="method-source-code" id="lcs-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 70</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">lcs</span>(<span class="ruby-identifier">other</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-comment">#:yields self[i] if there are matched subsequences:</span>
+ <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">lcs</span>(<span class="ruby-keyword">self</span>, <span class="ruby-identifier">other</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-patch" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">patch</span><span
+ class="method-args">(patchset)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Attempts to patch <code>self</code> with the provided <code>patchset</code>. A new sequence based on <code>self</code> and the <code>patchset</code> will be created. See <a href="LCS.html#method-i-patch"><code>Diff::LCS#patch</code></a>. Attempts to autodiscover the direction of the patch.</p>
+
+ <div class="method-source-code" id="patch-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 101</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">patch</span>(<span class="ruby-identifier">patchset</span>)
+ <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">patch</span>(<span class="ruby-keyword">self</span>, <span class="ruby-identifier">patchset</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+ <div class="aliases">
+ Also aliased as: <a href="LCS.html#method-i-unpatch">unpatch</a>
+ </div>
+
+ </div>
+
+ <div id="method-i-patch-21" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">patch!</span><span
+ class="method-args">(patchset)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Attempts to patch <code>self</code> with the provided <code>patchset</code>. A new sequence based on <code>self</code> and the <code>patchset</code> will be created. See <a href="LCS.html#method-i-patch"><code>Diff::LCS#patch</code></a>. Does no patch direction autodiscovery.</p>
+
+ <div class="method-source-code" id="patch-21-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 109</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">patch!</span>(<span class="ruby-identifier">patchset</span>)
+ <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">patch!</span>(<span class="ruby-keyword">self</span>, <span class="ruby-identifier">patchset</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-patch_me" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">patch_me</span><span
+ class="method-args">(patchset)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Attempts to patch <code>self</code> with the provided <code>patchset</code>, using <a href="LCS.html#method-i-patch-21"><code>patch!</code></a>. If the sequence this is used on supports replace, the value of <code>self</code> will be replaced. See <a href="LCS.html#method-i-patch"><code>Diff::LCS#patch</code></a>. Does no patch direction autodiscovery.</p>
+
+ <div class="method-source-code" id="patch_me-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 123</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">patch_me</span>(<span class="ruby-identifier">patchset</span>)
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">respond_to?</span> <span class="ruby-value">:replace</span>
+ <span class="ruby-identifier">replace</span>(<span class="ruby-identifier">patch!</span>(<span class="ruby-identifier">patchset</span>))
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">patch!</span>(<span class="ruby-identifier">patchset</span>)
+ <span class="ruby-keyword">end</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-sdiff" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">sdiff</span><span
+ class="method-args">(other, callbacks = nil, &amp;block)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Returns the balanced (“side-by-side”) difference set between <code>self</code> and <code>other</code>. See <a href="LCS.html#method-i-sdiff"><code>Diff::LCS#sdiff</code></a>.</p>
+
+ <div class="method-source-code" id="sdiff-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 81</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sdiff</span>(<span class="ruby-identifier">other</span>, <span class="ruby-identifier">callbacks</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+ <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">sdiff</span>(<span class="ruby-keyword">self</span>, <span class="ruby-identifier">other</span>, <span class="ruby-identifier">callbacks</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-traverse_balanced" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">traverse_balanced</span><span
+ class="method-args">(other, callbacks = nil, &amp;block)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Traverses the discovered longest common subsequences between <code>self</code> and <code>other</code> using the alternate, balanced algorithm. See <a href="LCS.html#method-i-traverse_balanced"><code>Diff::LCS#traverse_balanced</code></a>.</p>
+
+ <div class="method-source-code" id="traverse_balanced-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 94</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">traverse_balanced</span>(<span class="ruby-identifier">other</span>, <span class="ruby-identifier">callbacks</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+ <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">traverse_balanced</span>(<span class="ruby-keyword">self</span>, <span class="ruby-identifier">other</span>, <span class="ruby-identifier">callbacks</span> <span class="ruby-operator">||</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">BalancedCallbacks</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-traverse_sequences" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">traverse_sequences</span><span
+ class="method-args">(other, callbacks = nil, &amp;block)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Traverses the discovered longest common subsequences between <code>self</code> and <code>other</code>. See <a href="LCS.html#method-i-traverse_sequences"><code>Diff::LCS#traverse_sequences</code></a>.</p>
+
+ <div class="method-source-code" id="traverse_sequences-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 87</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">traverse_sequences</span>(<span class="ruby-identifier">other</span>, <span class="ruby-identifier">callbacks</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+ <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">traverse_sequences</span>(<span class="ruby-keyword">self</span>, <span class="ruby-identifier">other</span>, <span class="ruby-identifier">callbacks</span> <span class="ruby-operator">||</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">SequenceCallbacks</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-unpatch" class="method-detail method-alias">
+ <div class="method-heading">
+ <span class="method-name">unpatch</span><span
+ class="method-args">(patchset)</span>
+ </div>
+
+ <div class="method-description">
+
+
+ </div>
+
+
+ <div class="aliases">
+ Alias for: <a href="LCS.html#method-i-patch">patch</a>
+ </div>
+ </div>
+
+ <div id="method-i-unpatch-21" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">unpatch!</span><span
+ class="method-args">(patchset)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Attempts to unpatch <code>self</code> with the provided <code>patchset</code>. A new sequence based on <code>self</code> and the <code>patchset</code> will be created. See <a href="LCS.html#method-i-unpatch"><code>Diff::LCS#unpatch</code></a>. Does no patch direction autodiscovery.</p>
+
+ <div class="method-source-code" id="unpatch-21-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 116</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">unpatch!</span>(<span class="ruby-identifier">patchset</span>)
+ <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">unpatch!</span>(<span class="ruby-keyword">self</span>, <span class="ruby-identifier">patchset</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-unpatch_me" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">unpatch_me</span><span
+ class="method-args">(patchset)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Attempts to unpatch <code>self</code> with the provided <code>patchset</code>, using <a href="LCS.html#method-i-unpatch-21"><code>unpatch!</code></a>. If the sequence this is used on supports replace, the value of <code>self</code> will be replaced. See <a href="LCS.html#method-i-unpatch"><code>Diff::LCS#unpatch</code></a>. Does no patch direction autodiscovery.</p>
+
+ <div class="method-source-code" id="unpatch_me-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs.rb, line 134</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">unpatch_me</span>(<span class="ruby-identifier">patchset</span>)
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">respond_to?</span> <span class="ruby-value">:replace</span>
+ <span class="ruby-identifier">replace</span>(<span class="ruby-identifier">unpatch!</span>(<span class="ruby-identifier">patchset</span>))
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">unpatch!</span>(<span class="ruby-identifier">patchset</span>)
+ <span class="ruby-keyword">end</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ </section>
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/LCS/Block.html b/doc/LCS/Block.html
new file mode 100644
index 0000000..b786ef6
--- /dev/null
+++ b/doc/LCS/Block.html
@@ -0,0 +1,240 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>class LCS::Block - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "../";
+ var index_rel_prefix = "../";
+</script>
+
+<script src="../js/navigation.js" defer></script>
+<script src="../js/search.js" defer></script>
+<script src="../js/search_index.js" defer></script>
+<script src="../js/searcher.js" defer></script>
+<script src="../js/darkfish.js" defer></script>
+
+<link href="../css/fonts.css" rel="stylesheet">
+<link href="../css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="class">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="../index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="../table_of_contents.html#pages">Pages</a>
+ <a href="../table_of_contents.html#classes">Classes</a>
+ <a href="../table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+
+ <div id="class-metadata">
+
+
+<div id="parent-class-section" class="nav-section">
+ <h3>Parent</h3>
+
+ <p class="link">Object
+</div>
+
+
+
+
+<!-- Method Quickref -->
+<div id="method-list-section" class="nav-section">
+ <h3>Methods</h3>
+
+ <ul class="link-list" role="directory">
+ <li ><a href="#method-c-new">::new</a>
+ <li ><a href="#method-i-diff_size">#diff_size</a>
+ <li ><a href="#method-i-op">#op</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-labelledby="class-LCS::Block">
+ <h1 id="class-LCS::Block" class="class">
+ class LCS::Block
+ </h1>
+
+ <section class="description">
+
+<p>A block is an operation removing, adding, or changing a group of items. Basically, this is just a list of changes, where each change adds or deletes a single item. Used by bin/ldiff.</p>
+
+ </section>
+
+ <section id="5Buntitled-5D" class="documentation-section">
+
+
+
+ <section class="attribute-method-details" class="method-section">
+ <header>
+ <h3>Attributes</h3>
+ </header>
+
+ <div id="attribute-i-changes" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">changes</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ </div>
+ </div>
+ <div id="attribute-i-insert" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">insert</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ </div>
+ </div>
+ <div id="attribute-i-remove" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">remove</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ </div>
+ </div>
+ </section>
+
+
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Class Methods</h3>
+ </header>
+
+ <div id="method-c-new" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">new</span><span
+ class="method-args">(chunk)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="new-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/block.rb, line 9</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">chunk</span>)
+ <span class="ruby-ivar">@changes</span> = []
+ <span class="ruby-ivar">@insert</span> = []
+ <span class="ruby-ivar">@remove</span> = []
+
+ <span class="ruby-identifier">chunk</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
+ <span class="ruby-ivar">@changes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">item</span>
+ <span class="ruby-ivar">@remove</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">item</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">deleting?</span>
+ <span class="ruby-ivar">@insert</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">item</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">adding?</span>
+ <span class="ruby-keyword">end</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Instance Methods</h3>
+ </header>
+
+ <div id="method-i-diff_size" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">diff_size</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="diff_size-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/block.rb, line 21</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">diff_size</span>
+ <span class="ruby-ivar">@insert</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@remove</span>.<span class="ruby-identifier">size</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-op" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">op</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="op-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/block.rb, line 25</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">op</span>
+ <span class="ruby-keyword">case</span> [<span class="ruby-ivar">@remove</span>.<span class="ruby-identifier">empty?</span>, <span class="ruby-ivar">@insert</span>.<span class="ruby-identifier">empty?</span>]
+ <span class="ruby-keyword">when</span> [<span class="ruby-keyword">false</span>, <span class="ruby-keyword">false</span>]
+ <span class="ruby-string">&#39;!&#39;</span>
+ <span class="ruby-keyword">when</span> [<span class="ruby-keyword">false</span>, <span class="ruby-keyword">true</span>]
+ <span class="ruby-string">&#39;-&#39;</span>
+ <span class="ruby-keyword">when</span> [<span class="ruby-keyword">true</span>, <span class="ruby-keyword">false</span>]
+ <span class="ruby-string">&#39;+&#39;</span>
+ <span class="ruby-keyword">else</span> <span class="ruby-comment"># [true, true]</span>
+ <span class="ruby-string">&#39;^&#39;</span>
+ <span class="ruby-keyword">end</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ </section>
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/LCS/Change.html b/doc/LCS/Change.html
new file mode 100644
index 0000000..c714eea
--- /dev/null
+++ b/doc/LCS/Change.html
@@ -0,0 +1,500 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>class LCS::Change - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "../";
+ var index_rel_prefix = "../";
+</script>
+
+<script src="../js/navigation.js" defer></script>
+<script src="../js/search.js" defer></script>
+<script src="../js/search_index.js" defer></script>
+<script src="../js/searcher.js" defer></script>
+<script src="../js/darkfish.js" defer></script>
+
+<link href="../css/fonts.css" rel="stylesheet">
+<link href="../css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="class">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="../index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="../table_of_contents.html#pages">Pages</a>
+ <a href="../table_of_contents.html#classes">Classes</a>
+ <a href="../table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+
+ <div id="class-metadata">
+
+
+<div id="parent-class-section" class="nav-section">
+ <h3>Parent</h3>
+
+ <p class="link">Object
+</div>
+
+
+<div id="includes-section" class="nav-section">
+ <h3>Included Modules</h3>
+
+ <ul class="link-list">
+ <li><span class="include">Comparable</span>
+ </ul>
+</div>
+
+
+
+<!-- Method Quickref -->
+<div id="method-list-section" class="nav-section">
+ <h3>Methods</h3>
+
+ <ul class="link-list" role="directory">
+ <li ><a href="#method-c-from_a">::from_a</a>
+ <li ><a href="#method-c-new">::new</a>
+ <li ><a href="#method-c-valid_action-3F">::valid_action?</a>
+ <li ><a href="#method-i-3C-3D-3E">#&lt;=&gt;</a>
+ <li ><a href="#method-i-3D-3D">#==</a>
+ <li ><a href="#method-i-adding-3F">#adding?</a>
+ <li ><a href="#method-i-changed-3F">#changed?</a>
+ <li ><a href="#method-i-deleting-3F">#deleting?</a>
+ <li ><a href="#method-i-finished_a-3F">#finished_a?</a>
+ <li ><a href="#method-i-finished_b-3F">#finished_b?</a>
+ <li ><a href="#method-i-inspect">#inspect</a>
+ <li ><a href="#method-i-to_a">#to_a</a>
+ <li ><a href="#method-i-to_ary">#to_ary</a>
+ <li ><a href="#method-i-unchanged-3F">#unchanged?</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-labelledby="class-LCS::Change">
+ <h1 id="class-LCS::Change" class="class">
+ class LCS::Change
+ </h1>
+
+ <section class="description">
+
+<p>Represents a simplistic (non-contextual) change. Represents the removal or addition of an element from either the old or the new sequenced enumerable.</p>
+
+ </section>
+
+ <section id="5Buntitled-5D" class="documentation-section">
+
+
+ <section class="constants-list">
+ <header>
+ <h3>Constants</h3>
+ </header>
+ <dl>
+ <dt id="IntClass">IntClass
+ <dd>
+ <dt id="VALID_ACTIONS">VALID_ACTIONS
+ <dd><p>The only actions valid for changes are &#39;+&#39; (add), &#39;-&#39; (delete), &#39;=&#39; (no change), &#39;!&#39; (changed), &#39;&lt;&#39; (tail changes from first sequence), or &#39;&gt;&#39; (tail changes from second sequence). The last two (&#39;&lt;&gt;&#39;) are only found with <a href="../LCS.html#method-c-diff"><code>Diff::LCS::diff</code></a> and <a href="../LCS.html#method-c-sdiff"><code>Diff::LCS::sdiff</code></a>.</p>
+ </dl>
+ </section>
+
+ <section class="attribute-method-details" class="method-section">
+ <header>
+ <h3>Attributes</h3>
+ </header>
+
+ <div id="attribute-i-action" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">action</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+ <p>Returns the action this <a href="Change.html"><code>Change</code></a> represents.</p>
+ </div>
+ </div>
+ <div id="attribute-i-element" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">element</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+ <p>Returns the sequence element of the <a href="Change.html"><code>Change</code></a>.</p>
+ </div>
+ </div>
+ <div id="attribute-i-position" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">position</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+ <p>Returns the position of the <a href="Change.html"><code>Change</code></a>.</p>
+ </div>
+ </div>
+ </section>
+
+
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Class Methods</h3>
+ </header>
+
+ <div id="method-c-from_a" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">from_a</span><span
+ class="method-args">(arr)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="from_a-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 44</span>
+<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">from_a</span>(<span class="ruby-identifier">arr</span>)
+ <span class="ruby-identifier">arr</span> = <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">flatten</span>(<span class="ruby-value">1</span>)
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">size</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-value">5</span>
+ <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span>(<span class="ruby-identifier">arr</span>[<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-value">5</span>]))
+ <span class="ruby-keyword">when</span> <span class="ruby-value">3</span>
+ <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Change</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span>(<span class="ruby-identifier">arr</span>[<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-value">3</span>]))
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">fail</span> <span class="ruby-string">&#39;Invalid change array format provided.&#39;</span>
+ <span class="ruby-keyword">end</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-c-new" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">new</span><span
+ class="method-args">(*args)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="new-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 27</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
+ <span class="ruby-ivar">@action</span>, <span class="ruby-ivar">@position</span>, <span class="ruby-ivar">@element</span> = <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>
+
+ <span class="ruby-identifier">fail</span> <span class="ruby-node">&quot;Invalid Change Action &#39;#{@action}&#39;&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Change</span>.<span class="ruby-identifier">valid_action?</span>(<span class="ruby-ivar">@action</span>)
+ <span class="ruby-identifier">fail</span> <span class="ruby-string">&#39;Invalid Position Type&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@position</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">IntClass</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-c-valid_action-3F" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">valid_action?</span><span
+ class="method-args">(action)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="valid_action-3F-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 15</span>
+<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">valid_action?</span>(<span class="ruby-identifier">action</span>)
+ <span class="ruby-constant">VALID_ACTIONS</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">action</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Instance Methods</h3>
+ </header>
+
+ <div id="method-i-3C-3D-3E" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">&lt;=&gt;</span><span
+ class="method-args">(other)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="3C-3D-3E-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 65</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">&lt;=&gt;</span>(<span class="ruby-identifier">other</span>)
+ <span class="ruby-identifier">r</span> = <span class="ruby-identifier">action</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">action</span>
+ <span class="ruby-identifier">r</span> = <span class="ruby-identifier">position</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">position</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">zero?</span>
+ <span class="ruby-identifier">r</span> = <span class="ruby-identifier">element</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">element</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">zero?</span>
+ <span class="ruby-identifier">r</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-3D-3D" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">==</span><span
+ class="method-args">(other)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="3D-3D-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 58</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">==</span>(<span class="ruby-identifier">other</span>)
+ (<span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">class</span>) <span class="ruby-keyword">and</span>
+ (<span class="ruby-identifier">action</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">action</span>) <span class="ruby-keyword">and</span>
+ (<span class="ruby-identifier">position</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">position</span>) <span class="ruby-keyword">and</span>
+ (<span class="ruby-identifier">element</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">element</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-adding-3F" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">adding?</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="adding-3F-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 72</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">adding?</span>
+ <span class="ruby-ivar">@action</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;+&#39;</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-changed-3F" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">changed?</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="changed-3F-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 84</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">changed?</span>
+ <span class="ruby-ivar">@action</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;!&#39;</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-deleting-3F" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">deleting?</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="deleting-3F-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 76</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">deleting?</span>
+ <span class="ruby-ivar">@action</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;-&#39;</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-finished_a-3F" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">finished_a?</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="finished_a-3F-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 88</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">finished_a?</span>
+ <span class="ruby-ivar">@action</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;&gt;&#39;</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-finished_b-3F" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">finished_b?</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="finished_b-3F-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 92</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">finished_b?</span>
+ <span class="ruby-ivar">@action</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;&lt;&#39;</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-inspect" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">inspect</span><span
+ class="method-args">(*_args)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="inspect-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 34</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">inspect</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">_args</span>)
+ <span class="ruby-node">&quot;#&lt;#{self.class}: #{to_a.inspect}&gt;&quot;</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-to_a" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">to_a</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="to_a-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 38</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_a</span>
+ [<span class="ruby-ivar">@action</span>, <span class="ruby-ivar">@position</span>, <span class="ruby-ivar">@element</span>]
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+ <div class="aliases">
+ Also aliased as: <a href="Change.html#method-i-to_ary">to_ary</a>
+ </div>
+
+ </div>
+
+ <div id="method-i-to_ary" class="method-detail method-alias">
+ <div class="method-heading">
+ <span class="method-name">to_ary</span><span
+ class="method-args">()</span>
+ </div>
+
+ <div class="method-description">
+
+
+ </div>
+
+
+ <div class="aliases">
+ Alias for: <a href="Change.html#method-i-to_a">to_a</a>
+ </div>
+ </div>
+
+ <div id="method-i-unchanged-3F" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">unchanged?</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="unchanged-3F-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 80</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">unchanged?</span>
+ <span class="ruby-ivar">@action</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;=&#39;</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ </section>
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/LCS/ContextChange.html b/doc/LCS/ContextChange.html
new file mode 100644
index 0000000..b9b279c
--- /dev/null
+++ b/doc/LCS/ContextChange.html
@@ -0,0 +1,353 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>class LCS::ContextChange - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "../";
+ var index_rel_prefix = "../";
+</script>
+
+<script src="../js/navigation.js" defer></script>
+<script src="../js/search.js" defer></script>
+<script src="../js/search_index.js" defer></script>
+<script src="../js/searcher.js" defer></script>
+<script src="../js/darkfish.js" defer></script>
+
+<link href="../css/fonts.css" rel="stylesheet">
+<link href="../css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="class">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="../index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="../table_of_contents.html#pages">Pages</a>
+ <a href="../table_of_contents.html#classes">Classes</a>
+ <a href="../table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+
+ <div id="class-metadata">
+
+
+<div id="parent-class-section" class="nav-section">
+ <h3>Parent</h3>
+
+ <p class="link">Diff::LCS::Change
+</div>
+
+
+
+
+<!-- Method Quickref -->
+<div id="method-list-section" class="nav-section">
+ <h3>Methods</h3>
+
+ <ul class="link-list" role="directory">
+ <li ><a href="#method-c-from_a">::from_a</a>
+ <li ><a href="#method-c-new">::new</a>
+ <li ><a href="#method-c-simplify">::simplify</a>
+ <li ><a href="#method-i-3C-3D-3E">#&lt;=&gt;</a>
+ <li ><a href="#method-i-3D-3D">#==</a>
+ <li ><a href="#method-i-to_a">#to_a</a>
+ <li ><a href="#method-i-to_ary">#to_ary</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-labelledby="class-LCS::ContextChange">
+ <h1 id="class-LCS::ContextChange" class="class">
+ class LCS::ContextChange
+ </h1>
+
+ <section class="description">
+
+<p>Represents a contextual change. Contains the position and values of the elements in the old and the new sequenced enumerables as well as the action taken.</p>
+
+ </section>
+
+ <section id="5Buntitled-5D" class="documentation-section">
+
+
+
+ <section class="attribute-method-details" class="method-section">
+ <header>
+ <h3>Attributes</h3>
+ </header>
+
+ <div id="attribute-i-new_element" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">new_element</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+ <p>Returns the new element being changed.</p>
+ </div>
+ </div>
+ <div id="attribute-i-new_position" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">new_position</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+ <p>Returns the new position being changed.</p>
+ </div>
+ </div>
+ <div id="attribute-i-old_element" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">old_element</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+ <p>Returns the old element being changed.</p>
+ </div>
+ </div>
+ <div id="attribute-i-old_position" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">old_position</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+ <p>Returns the old position being changed.</p>
+ </div>
+ </div>
+ </section>
+
+
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Class Methods</h3>
+ </header>
+
+ <div id="method-c-from_a" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">from_a</span><span
+ class="method-args">(arr)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="from_a-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 132</span>
+<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">from_a</span>(<span class="ruby-identifier">arr</span>)
+ <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Change</span>.<span class="ruby-identifier">from_a</span>(<span class="ruby-identifier">arr</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-c-new" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">new</span><span
+ class="method-args">(*args)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="new-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 114</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
+ <span class="ruby-ivar">@action</span>, <span class="ruby-ivar">@old_position</span>, <span class="ruby-ivar">@old_element</span>, <span class="ruby-ivar">@new_position</span>, <span class="ruby-ivar">@new_element</span> = <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>
+
+ <span class="ruby-identifier">fail</span> <span class="ruby-node">&quot;Invalid Change Action &#39;#{@action}&#39;&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Change</span>.<span class="ruby-identifier">valid_action?</span>(<span class="ruby-ivar">@action</span>)
+ <span class="ruby-identifier">fail</span> <span class="ruby-string">&#39;Invalid (Old) Position Type&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@old_position</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">or</span> <span class="ruby-ivar">@old_position</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">IntClass</span>
+ <span class="ruby-identifier">fail</span> <span class="ruby-string">&#39;Invalid (New) Position Type&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@new_position</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">or</span> <span class="ruby-ivar">@new_position</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">IntClass</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-c-simplify" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">simplify</span><span
+ class="method-args">(event)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Simplifies a context change for use in some diff callbacks. &#39;&lt;&#39; actions are converted to &#39;-&#39; and &#39;&gt;&#39; actions are converted to &#39;+&#39;.</p>
+
+ <div class="method-source-code" id="simplify-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 138</span>
+<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">simplify</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">ea</span> = <span class="ruby-identifier">event</span>.<span class="ruby-identifier">to_a</span>
+
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">ea</span>[<span class="ruby-value">0</span>]
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;-&#39;</span>
+ <span class="ruby-identifier">ea</span>[<span class="ruby-value">2</span>][<span class="ruby-value">1</span>] = <span class="ruby-keyword">nil</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;&lt;&#39;</span>
+ <span class="ruby-identifier">ea</span>[<span class="ruby-value">0</span>] = <span class="ruby-string">&#39;-&#39;</span>
+ <span class="ruby-identifier">ea</span>[<span class="ruby-value">2</span>][<span class="ruby-value">1</span>] = <span class="ruby-keyword">nil</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;+&#39;</span>
+ <span class="ruby-identifier">ea</span>[<span class="ruby-value">1</span>][<span class="ruby-value">1</span>] = <span class="ruby-keyword">nil</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;&gt;&#39;</span>
+ <span class="ruby-identifier">ea</span>[<span class="ruby-value">0</span>] = <span class="ruby-string">&#39;+&#39;</span>
+ <span class="ruby-identifier">ea</span>[<span class="ruby-value">1</span>][<span class="ruby-value">1</span>] = <span class="ruby-keyword">nil</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">from_a</span>(<span class="ruby-identifier">ea</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Instance Methods</h3>
+ </header>
+
+ <div id="method-i-3C-3D-3E" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">&lt;=&gt;</span><span
+ class="method-args">(other)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="3C-3D-3E-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 166</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">&lt;=&gt;</span>(<span class="ruby-identifier">other</span>)
+ <span class="ruby-identifier">r</span> = <span class="ruby-ivar">@action</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">action</span>
+ <span class="ruby-identifier">r</span> = <span class="ruby-ivar">@old_position</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">old_position</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">zero?</span>
+ <span class="ruby-identifier">r</span> = <span class="ruby-ivar">@new_position</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">new_position</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">zero?</span>
+ <span class="ruby-identifier">r</span> = <span class="ruby-ivar">@old_element</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">old_element</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">zero?</span>
+ <span class="ruby-identifier">r</span> = <span class="ruby-ivar">@new_element</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">new_element</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">zero?</span>
+ <span class="ruby-identifier">r</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-3D-3D" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">==</span><span
+ class="method-args">(other)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="3D-3D-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 157</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">==</span>(<span class="ruby-identifier">other</span>)
+ (<span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">class</span>) <span class="ruby-keyword">and</span>
+ (<span class="ruby-ivar">@action</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">action</span>) <span class="ruby-keyword">and</span>
+ (<span class="ruby-ivar">@old_position</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">old_position</span>) <span class="ruby-keyword">and</span>
+ (<span class="ruby-ivar">@new_position</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">new_position</span>) <span class="ruby-keyword">and</span>
+ (<span class="ruby-ivar">@old_element</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">old_element</span>) <span class="ruby-keyword">and</span>
+ (<span class="ruby-ivar">@new_element</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">new_element</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-to_a" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">to_a</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="to_a-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/change.rb, line 122</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_a</span>
+ [
+ <span class="ruby-ivar">@action</span>,
+ [<span class="ruby-ivar">@old_position</span>, <span class="ruby-ivar">@old_element</span>],
+ [<span class="ruby-ivar">@new_position</span>, <span class="ruby-ivar">@new_element</span>]
+ ]
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+ <div class="aliases">
+ Also aliased as: <a href="ContextChange.html#method-i-to_ary">to_ary</a>
+ </div>
+
+ </div>
+
+ <div id="method-i-to_ary" class="method-detail method-alias">
+ <div class="method-heading">
+ <span class="method-name">to_ary</span><span
+ class="method-args">()</span>
+ </div>
+
+ <div class="method-description">
+
+
+ </div>
+
+
+ <div class="aliases">
+ Alias for: <a href="ContextChange.html#method-i-to_a">to_a</a>
+ </div>
+ </div>
+
+ </section>
+
+ </section>
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/LCS/ContextDiffCallbacks.html b/doc/LCS/ContextDiffCallbacks.html
new file mode 100644
index 0000000..2a1345b
--- /dev/null
+++ b/doc/LCS/ContextDiffCallbacks.html
@@ -0,0 +1,255 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>class LCS::ContextDiffCallbacks - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "../";
+ var index_rel_prefix = "../";
+</script>
+
+<script src="../js/navigation.js" defer></script>
+<script src="../js/search.js" defer></script>
+<script src="../js/search_index.js" defer></script>
+<script src="../js/searcher.js" defer></script>
+<script src="../js/darkfish.js" defer></script>
+
+<link href="../css/fonts.css" rel="stylesheet">
+<link href="../css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="class">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="../index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="../table_of_contents.html#pages">Pages</a>
+ <a href="../table_of_contents.html#classes">Classes</a>
+ <a href="../table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+<div class="nav-section">
+ <h3>Table of Contents</h3>
+
+ <ul class="link-list" role="directory">
+ <li><a href="#class-LCS::ContextDiffCallbacks-label-Use">Use</a>
+ <li><a href="#class-LCS::ContextDiffCallbacks-label-Simplified+Array+Format">Simplified Array Format</a>
+ </ul>
+</div>
+
+
+ <div id="class-metadata">
+
+
+<div id="parent-class-section" class="nav-section">
+ <h3>Parent</h3>
+
+ <p class="link">Diff::LCS::DiffCallbacks
+</div>
+
+
+
+
+<!-- Method Quickref -->
+<div id="method-list-section" class="nav-section">
+ <h3>Methods</h3>
+
+ <ul class="link-list" role="directory">
+ <li ><a href="#method-i-change">#change</a>
+ <li ><a href="#method-i-discard_a">#discard_a</a>
+ <li ><a href="#method-i-discard_b">#discard_b</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-labelledby="class-LCS::ContextDiffCallbacks">
+ <h1 id="class-LCS::ContextDiffCallbacks" class="class">
+ class LCS::ContextDiffCallbacks
+ </h1>
+
+ <section class="description">
+
+<p>This will produce a compound array of contextual diff change objects. Each element in the diffs array is a “hunk” array, where each element in each “hunk” array is a single change. Each change is a Diff::LCS::ContextChange that contains both the old index and new index values for the change. The “hunk” provides the full context for the changes. Both old and new objects will be presented for changed objects. <code>nil</code> will be substituted for a discarded object.</p>
+
+<pre class="ruby"><span class="ruby-identifier">seq1</span> = <span class="ruby-node">%w(a b c e h j l m n p)</span>
+<span class="ruby-identifier">seq2</span> = <span class="ruby-node">%w(b c d e f j k l m r s t)</span>
+
+<span class="ruby-identifier">diffs</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">diff</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextDiffCallbacks</span>)
+ <span class="ruby-comment"># This example shows a simplified array format.</span>
+ <span class="ruby-comment"># [ [ [ &#39;-&#39;, [ 0, &#39;a&#39; ], [ 0, nil ] ] ], # 1</span>
+ <span class="ruby-comment"># [ [ &#39;+&#39;, [ 3, nil ], [ 2, &#39;d&#39; ] ] ], # 2</span>
+ <span class="ruby-comment"># [ [ &#39;-&#39;, [ 4, &#39;h&#39; ], [ 4, nil ] ], # 3</span>
+ <span class="ruby-comment"># [ &#39;+&#39;, [ 5, nil ], [ 4, &#39;f&#39; ] ] ],</span>
+ <span class="ruby-comment"># [ [ &#39;+&#39;, [ 6, nil ], [ 6, &#39;k&#39; ] ] ], # 4</span>
+ <span class="ruby-comment"># [ [ &#39;-&#39;, [ 8, &#39;n&#39; ], [ 9, nil ] ], # 5</span>
+ <span class="ruby-comment"># [ &#39;+&#39;, [ 9, nil ], [ 9, &#39;r&#39; ] ],</span>
+ <span class="ruby-comment"># [ &#39;-&#39;, [ 9, &#39;p&#39; ], [ 10, nil ] ],</span>
+ <span class="ruby-comment"># [ &#39;+&#39;, [ 10, nil ], [ 10, &#39;s&#39; ] ],</span>
+ <span class="ruby-comment"># [ &#39;+&#39;, [ 10, nil ], [ 11, &#39;t&#39; ] ] ] ]</span>
+</pre>
+
+<p>The five hunks shown are comprised of individual changes; if there is a related set of changes, they are still shown individually.</p>
+
+<p>This callback can also be used with <a href="../LCS.html#method-i-sdiff"><code>Diff::LCS#sdiff</code></a>, which will produce results like:</p>
+
+<pre class="ruby"><span class="ruby-identifier">diffs</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">sdiff</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextCallbacks</span>)
+ <span class="ruby-comment"># This example shows a simplified array format.</span>
+ <span class="ruby-comment"># [ [ [ &quot;-&quot;, [ 0, &quot;a&quot; ], [ 0, nil ] ] ], # 1</span>
+ <span class="ruby-comment"># [ [ &quot;+&quot;, [ 3, nil ], [ 2, &quot;d&quot; ] ] ], # 2</span>
+ <span class="ruby-comment"># [ [ &quot;!&quot;, [ 4, &quot;h&quot; ], [ 4, &quot;f&quot; ] ] ], # 3</span>
+ <span class="ruby-comment"># [ [ &quot;+&quot;, [ 6, nil ], [ 6, &quot;k&quot; ] ] ], # 4</span>
+ <span class="ruby-comment"># [ [ &quot;!&quot;, [ 8, &quot;n&quot; ], [ 9, &quot;r&quot; ] ], # 5</span>
+ <span class="ruby-comment"># [ &quot;!&quot;, [ 9, &quot;p&quot; ], [ 10, &quot;s&quot; ] ],</span>
+ <span class="ruby-comment"># [ &quot;+&quot;, [ 10, nil ], [ 11, &quot;t&quot; ] ] ] ]</span>
+</pre>
+
+<p>The five hunks are still present, but are significantly shorter in total presentation, because changed items are shown as changes (“!”) instead of potentially “mismatched” pairs of additions and deletions.</p>
+
+<p>The result of this operation is similar to that of Diff::LCS::SDiffCallbacks. They may be compared as:</p>
+
+<pre class="ruby"><span class="ruby-identifier">s</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">sdiff</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>).<span class="ruby-identifier">reject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">action</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;=&quot;</span> }
+<span class="ruby-identifier">c</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">sdiff</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextDiffCallbacks</span>).<span class="ruby-identifier">flatten</span>(<span class="ruby-value">1</span>)
+
+<span class="ruby-identifier">s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">c</span> <span class="ruby-comment"># -&gt; true</span>
+</pre>
+
+<h3 id="class-LCS::ContextDiffCallbacks-label-Use">Use<span><a href="#class-LCS::ContextDiffCallbacks-label-Use">&para;</a> <a href="#top">&uarr;</a></span></h3>
+
+<p>This callback object must be initialised and can be used by the <a href="../LCS.html#method-i-diff"><code>Diff::LCS#diff</code></a> or <a href="../LCS.html#method-i-sdiff"><code>Diff::LCS#sdiff</code></a> methods.</p>
+
+<pre class="ruby"><span class="ruby-identifier">cbo</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextDiffCallbacks</span>.<span class="ruby-identifier">new</span>
+<span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-constant">LCS</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">cbo</span>)
+<span class="ruby-identifier">cbo</span>.<span class="ruby-identifier">finish</span>
+</pre>
+
+<p>Note that the call to finish is absolutely necessary, or the last set of changes will not be visible. Alternatively, can be used as:</p>
+
+<pre class="ruby"><span class="ruby-identifier">cbo</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextDiffCallbacks</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">tcbo</span><span class="ruby-operator">|</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-constant">LCS</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">tcbo</span>) }
+</pre>
+
+<p>The necessary finish call will be made.</p>
+
+<h3 id="class-LCS::ContextDiffCallbacks-label-Simplified+Array+Format">Simplified <a href="../Array.html"><code>Array</code></a> Format<span><a href="#class-LCS::ContextDiffCallbacks-label-Simplified+Array+Format">&para;</a> <a href="#top">&uarr;</a></span></h3>
+
+<p>The simplified array format used in the example above can be obtained with:</p>
+
+<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;pp&#39;</span>
+<span class="ruby-identifier">pp</span> <span class="ruby-identifier">diffs</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">to_a</span> } }
+</pre>
+
+ </section>
+
+ <section id="5Buntitled-5D" class="documentation-section">
+
+
+
+
+
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Instance Methods</h3>
+ </header>
+
+ <div id="method-i-change" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">change</span><span
+ class="method-args">(event)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="change-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 232</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-ivar">@hunk</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">simplify</span>(<span class="ruby-identifier">event</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-discard_a" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">discard_a</span><span
+ class="method-args">(event)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="discard_a-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 224</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">discard_a</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-ivar">@hunk</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">simplify</span>(<span class="ruby-identifier">event</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-discard_b" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">discard_b</span><span
+ class="method-args">(event)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="discard_b-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 228</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">discard_b</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-ivar">@hunk</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">simplify</span>(<span class="ruby-identifier">event</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ </section>
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/LCS/DefaultCallbacks.html b/doc/LCS/DefaultCallbacks.html
new file mode 100644
index 0000000..a63bb94
--- /dev/null
+++ b/doc/LCS/DefaultCallbacks.html
@@ -0,0 +1,207 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>class LCS::SequenceCallbacks - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "../";
+ var index_rel_prefix = "../";
+</script>
+
+<script src="../js/navigation.js" defer></script>
+<script src="../js/search.js" defer></script>
+<script src="../js/search_index.js" defer></script>
+<script src="../js/searcher.js" defer></script>
+<script src="../js/darkfish.js" defer></script>
+
+<link href="../css/fonts.css" rel="stylesheet">
+<link href="../css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="class">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="../index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="../table_of_contents.html#pages">Pages</a>
+ <a href="../table_of_contents.html#classes">Classes</a>
+ <a href="../table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+
+ <div id="class-metadata">
+
+
+<div id="parent-class-section" class="nav-section">
+ <h3>Parent</h3>
+
+ <p class="link">Object
+</div>
+
+
+
+
+<!-- Method Quickref -->
+<div id="method-list-section" class="nav-section">
+ <h3>Methods</h3>
+
+ <ul class="link-list" role="directory">
+ <li ><a href="#method-c-change">::change</a>
+ <li ><a href="#method-c-discard_a">::discard_a</a>
+ <li ><a href="#method-c-discard_b">::discard_b</a>
+ <li ><a href="#method-c-match">::match</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-labelledby="class-LCS::SequenceCallbacks">
+ <h1 id="class-LCS::SequenceCallbacks" class="class">
+ class LCS::SequenceCallbacks
+ </h1>
+
+ <section class="description">
+
+<p>This callback object implements the default set of callback events, which only returns the event itself. Note that finished_a and finished_b are not implemented – I haven&#39;t yet figured out where they would be useful.</p>
+
+<p>Note that this is intended to be called as is, e.g.,</p>
+
+<pre class="ruby"><span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-constant">LCS</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">DefaultCallbacks</span>)
+</pre>
+
+ </section>
+
+ <section id="5Buntitled-5D" class="documentation-section">
+
+
+
+
+
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Class Methods</h3>
+ </header>
+
+ <div id="method-c-change" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">change</span><span
+ class="method-args">(event)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Called when both the old and new values have changed.</p>
+
+ <div class="method-source-code" id="change-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 32</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">event</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-c-discard_a" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">discard_a</span><span
+ class="method-args">(event)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Called when the old value is discarded in favour of the new value.</p>
+
+ <div class="method-source-code" id="discard_a-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 22</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">discard_a</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">event</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-c-discard_b" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">discard_b</span><span
+ class="method-args">(event)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Called when the new value is discarded in favour of the old value.</p>
+
+ <div class="method-source-code" id="discard_b-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 27</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">discard_b</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">event</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-c-match" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">match</span><span
+ class="method-args">(event)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Called when two items match.</p>
+
+ <div class="method-source-code" id="match-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 17</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">match</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-identifier">event</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ </section>
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/LCS/DiffCallbacks.html b/doc/LCS/DiffCallbacks.html
new file mode 100644
index 0000000..d82b399
--- /dev/null
+++ b/doc/LCS/DiffCallbacks.html
@@ -0,0 +1,305 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>class LCS::DiffCallbacks - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "../";
+ var index_rel_prefix = "../";
+</script>
+
+<script src="../js/navigation.js" defer></script>
+<script src="../js/search.js" defer></script>
+<script src="../js/search_index.js" defer></script>
+<script src="../js/searcher.js" defer></script>
+<script src="../js/darkfish.js" defer></script>
+
+<link href="../css/fonts.css" rel="stylesheet">
+<link href="../css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="class">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="../index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="../table_of_contents.html#pages">Pages</a>
+ <a href="../table_of_contents.html#classes">Classes</a>
+ <a href="../table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+<div class="nav-section">
+ <h3>Table of Contents</h3>
+
+ <ul class="link-list" role="directory">
+ <li><a href="#class-LCS::DiffCallbacks-label-Use">Use</a>
+ <li><a href="#class-LCS::DiffCallbacks-label-Simplified+Array+Format">Simplified Array Format</a>
+ </ul>
+</div>
+
+
+ <div id="class-metadata">
+
+
+<div id="parent-class-section" class="nav-section">
+ <h3>Parent</h3>
+
+ <p class="link">Object
+</div>
+
+
+
+
+<!-- Method Quickref -->
+<div id="method-list-section" class="nav-section">
+ <h3>Methods</h3>
+
+ <ul class="link-list" role="directory">
+ <li ><a href="#method-c-new">::new</a>
+ <li ><a href="#method-i-discard_a">#discard_a</a>
+ <li ><a href="#method-i-discard_b">#discard_b</a>
+ <li ><a href="#method-i-finish">#finish</a>
+ <li ><a href="#method-i-match">#match</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-labelledby="class-LCS::DiffCallbacks">
+ <h1 id="class-LCS::DiffCallbacks" class="class">
+ class LCS::DiffCallbacks
+ </h1>
+
+ <section class="description">
+
+<p>This will produce a compound array of simple diff change objects. Each element in the <a href="DiffCallbacks.html#attribute-i-diffs"><code>diffs</code></a> array is a <code>hunk</code> or <code>hunk</code> array, where each element in each <code>hunk</code> array is a single Change object representing the addition or removal of a single element from one of the two tested sequences. The <code>hunk</code> provides the full context for the changes.</p>
+
+<pre class="ruby"><span class="ruby-identifier">diffs</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">diff</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>)
+ <span class="ruby-comment"># This example shows a simplified array format.</span>
+ <span class="ruby-comment"># [ [ [ &#39;-&#39;, 0, &#39;a&#39; ] ], # 1</span>
+ <span class="ruby-comment"># [ [ &#39;+&#39;, 2, &#39;d&#39; ] ], # 2</span>
+ <span class="ruby-comment"># [ [ &#39;-&#39;, 4, &#39;h&#39; ], # 3</span>
+ <span class="ruby-comment"># [ &#39;+&#39;, 4, &#39;f&#39; ] ],</span>
+ <span class="ruby-comment"># [ [ &#39;+&#39;, 6, &#39;k&#39; ] ], # 4</span>
+ <span class="ruby-comment"># [ [ &#39;-&#39;, 8, &#39;n&#39; ], # 5</span>
+ <span class="ruby-comment"># [ &#39;-&#39;, 9, &#39;p&#39; ],</span>
+ <span class="ruby-comment"># [ &#39;+&#39;, 9, &#39;r&#39; ],</span>
+ <span class="ruby-comment"># [ &#39;+&#39;, 10, &#39;s&#39; ],</span>
+ <span class="ruby-comment"># [ &#39;+&#39;, 11, &#39;t&#39; ] ] ]</span>
+</pre>
+
+<p>There are five hunks here. The first hunk says that the <code>a</code> at position 0 of the first sequence should be deleted (<code>&#39;-&#39;</code>). The second hunk says that the <code>d</code> at position 2 of the second sequence should be inserted (<code>&#39;+&#39;</code>). The third hunk says that the <code>h</code> at position 4 of the first sequence should be removed and replaced with the <code>f</code> from position 4 of the second sequence. The other two hunks are described similarly.</p>
+
+<h3 id="class-LCS::DiffCallbacks-label-Use">Use<span><a href="#class-LCS::DiffCallbacks-label-Use">&para;</a> <a href="#top">&uarr;</a></span></h3>
+
+<p>This callback object must be initialised and is used by the <a href="../LCS.html#method-i-diff"><code>Diff::LCS#diff</code></a> method.</p>
+
+<pre class="ruby"><span class="ruby-identifier">cbo</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">DiffCallbacks</span>.<span class="ruby-identifier">new</span>
+<span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-constant">LCS</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">cbo</span>)
+<span class="ruby-identifier">cbo</span>.<span class="ruby-identifier">finish</span>
+</pre>
+
+<p>Note that the call to <a href="DiffCallbacks.html#method-i-finish"><code>finish</code></a> is absolutely necessary, or the last set of changes will not be visible. Alternatively, can be used as:</p>
+
+<pre class="ruby"><span class="ruby-identifier">cbo</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">DiffCallbacks</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">tcbo</span><span class="ruby-operator">|</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-constant">LCS</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">tcbo</span>) }
+</pre>
+
+<p>The necessary <a href="DiffCallbacks.html#method-i-finish"><code>finish</code></a> call will be made.</p>
+
+<h3 id="class-LCS::DiffCallbacks-label-Simplified+Array+Format">Simplified <a href="../Array.html"><code>Array</code></a> Format<span><a href="#class-LCS::DiffCallbacks-label-Simplified+Array+Format">&para;</a> <a href="#top">&uarr;</a></span></h3>
+
+<p>The simplified array format used in the example above can be obtained with:</p>
+
+<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;pp&#39;</span>
+<span class="ruby-identifier">pp</span> <span class="ruby-identifier">diffs</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">to_a</span> } }
+</pre>
+
+ </section>
+
+ <section id="5Buntitled-5D" class="documentation-section">
+
+
+
+ <section class="attribute-method-details" class="method-section">
+ <header>
+ <h3>Attributes</h3>
+ </header>
+
+ <div id="attribute-i-diffs" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">diffs</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+ <p>Returns the difference set collected during the diff process.</p>
+ </div>
+ </div>
+ </section>
+
+
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Class Methods</h3>
+ </header>
+
+ <div id="method-c-new" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">new</span><span
+ class="method-args">() { |self| ... }</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="new-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 110</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span> <span class="ruby-comment"># :yields self:</span>
+ <span class="ruby-ivar">@hunk</span> = []
+ <span class="ruby-ivar">@diffs</span> = []
+
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">block_given?</span>
+
+ <span class="ruby-keyword">begin</span>
+ <span class="ruby-keyword">yield</span> <span class="ruby-keyword">self</span>
+ <span class="ruby-keyword">ensure</span>
+ <span class="ruby-identifier">finish</span>
+ <span class="ruby-keyword">end</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Instance Methods</h3>
+ </header>
+
+ <div id="method-i-discard_a" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">discard_a</span><span
+ class="method-args">(event)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="discard_a-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 133</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">discard_a</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-ivar">@hunk</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Change</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;-&#39;</span>, <span class="ruby-identifier">event</span>.<span class="ruby-identifier">old_position</span>, <span class="ruby-identifier">event</span>.<span class="ruby-identifier">old_element</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-discard_b" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">discard_b</span><span
+ class="method-args">(event)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="discard_b-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 137</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">discard_b</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-ivar">@hunk</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Change</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;+&#39;</span>, <span class="ruby-identifier">event</span>.<span class="ruby-identifier">new_position</span>, <span class="ruby-identifier">event</span>.<span class="ruby-identifier">new_element</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-finish" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">finish</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Finalizes the diff process. If an unprocessed hunk still exists, then it is appended to the diff list.</p>
+
+ <div class="method-source-code" id="finish-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 125</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">finish</span>
+ <span class="ruby-identifier">finish_hunk</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-match" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">match</span><span
+ class="method-args">(_event)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="match-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 129</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">match</span>(<span class="ruby-identifier">_event</span>)
+ <span class="ruby-identifier">finish_hunk</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ </section>
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/LCS/HTMLDiff.html b/doc/LCS/HTMLDiff.html
new file mode 100644
index 0000000..19314fc
--- /dev/null
+++ b/doc/LCS/HTMLDiff.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>class LCS::HTMLDiff - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "../";
+ var index_rel_prefix = "../";
+</script>
+
+<script src="../js/navigation.js" defer></script>
+<script src="../js/search.js" defer></script>
+<script src="../js/search_index.js" defer></script>
+<script src="../js/searcher.js" defer></script>
+<script src="../js/darkfish.js" defer></script>
+
+<link href="../css/fonts.css" rel="stylesheet">
+<link href="../css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="class">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="../index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="../table_of_contents.html#pages">Pages</a>
+ <a href="../table_of_contents.html#classes">Classes</a>
+ <a href="../table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+
+ <div id="class-metadata">
+
+
+<div id="parent-class-section" class="nav-section">
+ <h3>Parent</h3>
+
+ <p class="link">Object
+</div>
+
+
+
+
+<!-- Method Quickref -->
+<div id="method-list-section" class="nav-section">
+ <h3>Methods</h3>
+
+ <ul class="link-list" role="directory">
+ <li ><a href="#method-c-new">::new</a>
+ <li ><a href="#method-i-run">#run</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-labelledby="class-LCS::HTMLDiff">
+ <h1 id="class-LCS::HTMLDiff" class="class">
+ class LCS::HTMLDiff
+ </h1>
+
+ <section class="description">
+
+<p>Produce a simple HTML diff view.</p>
+
+ </section>
+
+ <section id="5Buntitled-5D" class="documentation-section">
+
+
+ <section class="constants-list">
+ <header>
+ <h3>Constants</h3>
+ </header>
+ <dl>
+ <dt id="DEFAULT_CSS">DEFAULT_CSS
+ <dd>
+ <dt id="DEFAULT_OPTIONS">DEFAULT_OPTIONS
+ <dd>
+ </dl>
+ </section>
+
+ <section class="attribute-method-details" class="method-section">
+ <header>
+ <h3>Attributes</h3>
+ </header>
+
+ <div id="attribute-i-options" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">options</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ </div>
+ </div>
+ </section>
+
+
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Class Methods</h3>
+ </header>
+
+ <div id="method-c-new" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">new</span><span
+ class="method-args">(left, right, options = nil)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="new-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/htmldiff.rb, line 90</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">left</span>, <span class="ruby-identifier">right</span>, <span class="ruby-identifier">options</span> = <span class="ruby-keyword">nil</span>)
+ <span class="ruby-ivar">@left</span> = <span class="ruby-identifier">left</span>
+ <span class="ruby-ivar">@right</span> = <span class="ruby-identifier">right</span>
+ <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>
+
+ <span class="ruby-ivar">@options</span> = <span class="ruby-constant">DEFAULT_OPTIONS</span>.<span class="ruby-identifier">dup</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">nil?</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Instance Methods</h3>
+ </header>
+
+ <div id="method-i-run" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">run</span><span
+ class="method-args">()</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="run-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/htmldiff.rb, line 112</span>
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">run</span>
+ <span class="ruby-identifier">verify_options</span>
+
+ <span class="ruby-keyword">if</span> <span class="ruby-ivar">@options</span>[<span class="ruby-value">:expand_tabs</span>].<span class="ruby-identifier">positive?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">can_expand_tabs</span>
+ <span class="ruby-identifier">formatter</span> = <span class="ruby-constant">Text</span><span class="ruby-operator">::</span><span class="ruby-constant">Format</span>.<span class="ruby-identifier">new</span>
+ <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">tabstop</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-value">:expand_tabs</span>]
+
+ <span class="ruby-ivar">@left</span>.<span class="ruby-identifier">map!</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">expand</span>(<span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span>) <span class="ruby-keyword">end</span>
+ <span class="ruby-ivar">@right</span>.<span class="ruby-identifier">map!</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> <span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">expand</span>(<span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span>) <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-ivar">@left</span>.<span class="ruby-identifier">map!</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> <span class="ruby-constant">CGI</span>.<span class="ruby-identifier">escapeHTML</span>(<span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span>) <span class="ruby-keyword">end</span>
+ <span class="ruby-ivar">@right</span>.<span class="ruby-identifier">map!</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> <span class="ruby-constant">CGI</span>.<span class="ruby-identifier">escapeHTML</span>(<span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span>) <span class="ruby-keyword">end</span>
+
+ <span class="ruby-ivar">@options</span>[<span class="ruby-value">:output</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">&lt;&lt;-OUTPUT</span>
+<span class="ruby-value">&lt;html&gt;
+ &lt;head&gt;
+ &lt;title&gt;#{@options[:title]}&lt;/title&gt;
+ &lt;style type=&quot;text/css&quot;&gt;
+ #{@options[:css]}
+ &lt;/style&gt;
+ &lt;/head&gt;
+ &lt;body&gt;
+ &lt;h1&gt;#{@options[:title]}&lt;/h1&gt;
+ &lt;p&gt;Legend: &lt;span class=&quot;only_a&quot;&gt;Only in Old&lt;/span&gt;&amp;nbsp;
+ &lt;span class=&quot;only_b&quot;&gt;Only in New&lt;/span&gt;&lt;/p&gt;
+ &lt;div class=&quot;diff&quot;&gt;
+</span><span class="ruby-identifier"> OUTPUT</span>
+
+ <span class="ruby-identifier">callbacks</span> = <span class="ruby-constant">Callbacks</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@options</span>[<span class="ruby-value">:output</span>])
+ <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">traverse_sequences</span>(<span class="ruby-ivar">@left</span>, <span class="ruby-ivar">@right</span>, <span class="ruby-identifier">callbacks</span>)
+
+ <span class="ruby-ivar">@options</span>[<span class="ruby-value">:output</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">&lt;&lt;-OUTPUT</span>
+<span class="ruby-value"> &lt;/div&gt;
+ &lt;/body&gt;
+&lt;/html&gt;
+</span><span class="ruby-identifier"> OUTPUT</span>
+ <span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ </section>
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/LCS/Hunk.html b/doc/LCS/Hunk.html
new file mode 100644
index 0000000..0a22329
--- /dev/null
+++ b/doc/LCS/Hunk.html
@@ -0,0 +1,397 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>class LCS::Hunk - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "../";
+ var index_rel_prefix = "../";
+</script>
+
+<script src="../js/navigation.js" defer></script>
+<script src="../js/search.js" defer></script>
+<script src="../js/search_index.js" defer></script>
+<script src="../js/searcher.js" defer></script>
+<script src="../js/darkfish.js" defer></script>
+
+<link href="../css/fonts.css" rel="stylesheet">
+<link href="../css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="class">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="../index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="../table_of_contents.html#pages">Pages</a>
+ <a href="../table_of_contents.html#classes">Classes</a>
+ <a href="../table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+
+ <div id="class-metadata">
+
+
+<div id="parent-class-section" class="nav-section">
+ <h3>Parent</h3>
+
+ <p class="link">Object
+</div>
+
+
+
+
+<!-- Method Quickref -->
+<div id="method-list-section" class="nav-section">
+ <h3>Methods</h3>
+
+ <ul class="link-list" role="directory">
+ <li ><a href="#method-c-new">::new</a>
+ <li ><a href="#method-i-diff">#diff</a>
+ <li ><a href="#method-i-merge">#merge</a>
+ <li ><a href="#method-i-missing_last_newline-3F">#missing_last_newline?</a>
+ <li ><a href="#method-i-overlaps-3F">#overlaps?</a>
+ <li ><a href="#method-i-unshift">#unshift</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-labelledby="class-LCS::Hunk">
+ <h1 id="class-LCS::Hunk" class="class">
+ class LCS::Hunk
+ </h1>
+
+ <section class="description">
+
+<p>A <a href="Hunk.html"><code>Hunk</code></a> is a group of Blocks which overlap because of the context surrounding each block. (So if we&#39;re not using context, every hunk will contain one block.) Used in the diff program (bin/ldiff).</p>
+
+ </section>
+
+ <section id="5Buntitled-5D" class="documentation-section">
+
+
+
+ <section class="attribute-method-details" class="method-section">
+ <header>
+ <h3>Attributes</h3>
+ </header>
+
+ <div id="attribute-i-blocks" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">blocks</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ </div>
+ </div>
+ <div id="attribute-i-end_new" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">end_new</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ </div>
+ </div>
+ <div id="attribute-i-end_old" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">end_old</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ </div>
+ </div>
+ <div id="attribute-i-file_length_difference" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">file_length_difference</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ </div>
+ </div>
+ <div id="attribute-i-flag_context" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">flag_context</span><span
+ class="attribute-access-type">[RW]</span>
+ </div>
+
+ <div class="method-description">
+ <p>Change the “start” and “end” fields to note that context should be added to this hunk.</p>
+ </div>
+ </div>
+ <div id="attribute-i-start_new" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">start_new</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ </div>
+ </div>
+ <div id="attribute-i-start_old" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">start_old</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+
+ </div>
+ </div>
+ </section>
+
+
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Class Methods</h3>
+ </header>
+
+ <div id="method-c-new" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">new</span><span
+ class="method-args">(data_old, data_new, piece, flag_context, file_length_difference)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Create a hunk using references to both the old and new data, as well as the piece of data.</p>
+
+ <div class="method-source-code" id="new-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/hunk.rb, line 16</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">data_old</span>, <span class="ruby-identifier">data_new</span>, <span class="ruby-identifier">piece</span>, <span class="ruby-identifier">flag_context</span>, <span class="ruby-identifier">file_length_difference</span>)
+ <span class="ruby-comment"># At first, a hunk will have just one Block in it</span>
+ <span class="ruby-ivar">@blocks</span> = [<span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">Block</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">piece</span>)]
+
+ <span class="ruby-keyword">if</span> <span class="ruby-ivar">@blocks</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">remove</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@blocks</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">insert</span>.<span class="ruby-identifier">empty?</span>
+ <span class="ruby-identifier">fail</span> <span class="ruby-node">&quot;Cannot build a hunk from #{piece.inspect}; has no add or remove actions&quot;</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-keyword">if</span> <span class="ruby-constant">String</span>.<span class="ruby-identifier">method_defined?</span>(<span class="ruby-value">:encoding</span>)
+ <span class="ruby-ivar">@preferred_data_encoding</span> = <span class="ruby-identifier">data_old</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">data_new</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value">0</span>, <span class="ruby-string">&#39;&#39;</span>)).<span class="ruby-identifier">encoding</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-ivar">@data_old</span> = <span class="ruby-identifier">data_old</span>
+ <span class="ruby-ivar">@data_new</span> = <span class="ruby-identifier">data_new</span>
+
+ <span class="ruby-identifier">before</span> = <span class="ruby-identifier">after</span> = <span class="ruby-identifier">file_length_difference</span>
+ <span class="ruby-identifier">after</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@blocks</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">diff_size</span>
+ <span class="ruby-ivar">@file_length_difference</span> = <span class="ruby-identifier">after</span> <span class="ruby-comment"># The caller must get this manually</span>
+ <span class="ruby-ivar">@max_diff_size</span> = <span class="ruby-ivar">@blocks</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">diff_size</span>.<span class="ruby-identifier">abs</span> }.<span class="ruby-identifier">max</span>
+
+
+ <span class="ruby-comment"># Save the start &amp; end of each array. If the array doesn&#39;t exist (e.g.,</span>
+ <span class="ruby-comment"># we&#39;re only adding items in this block), then figure out the line number</span>
+ <span class="ruby-comment"># based on the line number of the other file and the current difference in</span>
+ <span class="ruby-comment"># file lengths.</span>
+ <span class="ruby-keyword">if</span> <span class="ruby-ivar">@blocks</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">remove</span>.<span class="ruby-identifier">empty?</span>
+ <span class="ruby-identifier">a1</span> = <span class="ruby-identifier">a2</span> = <span class="ruby-keyword">nil</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">a1</span> = <span class="ruby-ivar">@blocks</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">remove</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">position</span>
+ <span class="ruby-identifier">a2</span> = <span class="ruby-ivar">@blocks</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">remove</span>[<span class="ruby-value">-1</span>].<span class="ruby-identifier">position</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-keyword">if</span> <span class="ruby-ivar">@blocks</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">insert</span>.<span class="ruby-identifier">empty?</span>
+ <span class="ruby-identifier">b1</span> = <span class="ruby-identifier">b2</span> = <span class="ruby-keyword">nil</span>
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">b1</span> = <span class="ruby-ivar">@blocks</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">insert</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">position</span>
+ <span class="ruby-identifier">b2</span> = <span class="ruby-ivar">@blocks</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">insert</span>[<span class="ruby-value">-1</span>].<span class="ruby-identifier">position</span>
+ <span class="ruby-keyword">end</span>
+
+ <span class="ruby-ivar">@start_old</span> = <span class="ruby-identifier">a1</span> <span class="ruby-operator">||</span> (<span class="ruby-identifier">b1</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">before</span>)
+ <span class="ruby-ivar">@start_new</span> = <span class="ruby-identifier">b1</span> <span class="ruby-operator">||</span> (<span class="ruby-identifier">a1</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">before</span>)
+ <span class="ruby-ivar">@end_old</span> = <span class="ruby-identifier">a2</span> <span class="ruby-operator">||</span> (<span class="ruby-identifier">b2</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">after</span>)
+ <span class="ruby-ivar">@end_new</span> = <span class="ruby-identifier">b2</span> <span class="ruby-operator">||</span> (<span class="ruby-identifier">a2</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">after</span>)
+
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">flag_context</span> = <span class="ruby-identifier">flag_context</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Instance Methods</h3>
+ </header>
+
+ <div id="method-i-diff" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">diff</span><span
+ class="method-args">(format, last = false)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Returns a diff string based on a format.</p>
+
+ <div class="method-source-code" id="diff-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/hunk.rb, line 116</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">diff</span>(<span class="ruby-identifier">format</span>, <span class="ruby-identifier">last</span> = <span class="ruby-keyword">false</span>)
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">format</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-value">:old</span>
+ <span class="ruby-identifier">old_diff</span>(<span class="ruby-identifier">last</span>)
+ <span class="ruby-keyword">when</span> <span class="ruby-value">:unified</span>
+ <span class="ruby-identifier">unified_diff</span>(<span class="ruby-identifier">last</span>)
+ <span class="ruby-keyword">when</span> <span class="ruby-value">:context</span>
+ <span class="ruby-identifier">context_diff</span>(<span class="ruby-identifier">last</span>)
+ <span class="ruby-keyword">when</span> <span class="ruby-value">:ed</span>
+ <span class="ruby-keyword">self</span>
+ <span class="ruby-keyword">when</span> <span class="ruby-value">:reverse_ed</span>, <span class="ruby-value">:ed_finish</span>
+ <span class="ruby-identifier">ed_diff</span>(<span class="ruby-identifier">format</span>, <span class="ruby-identifier">last</span>)
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-identifier">fail</span> <span class="ruby-node">&quot;Unknown diff format #{format}.&quot;</span>
+ <span class="ruby-keyword">end</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-merge" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">merge</span><span
+ class="method-args">(hunk)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Merges this hunk and the provided hunk together if they overlap. Returns a truthy value so that if there is no overlap, you can know the merge was skipped.</p>
+
+ <div class="method-source-code" id="merge-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/hunk.rb, line 98</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">merge</span>(<span class="ruby-identifier">hunk</span>)
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">overlaps?</span>(<span class="ruby-identifier">hunk</span>)
+
+ <span class="ruby-ivar">@start_old</span> = <span class="ruby-identifier">hunk</span>.<span class="ruby-identifier">start_old</span>
+ <span class="ruby-ivar">@start_new</span> = <span class="ruby-identifier">hunk</span>.<span class="ruby-identifier">start_new</span>
+ <span class="ruby-identifier">blocks</span>.<span class="ruby-identifier">unshift</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">hunk</span>.<span class="ruby-identifier">blocks</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+ <div class="aliases">
+ Also aliased as: <a href="Hunk.html#method-i-unshift">unshift</a>
+ </div>
+
+ </div>
+
+ <div id="method-i-missing_last_newline-3F" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">missing_last_newline?</span><span
+ class="method-args">(data)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="missing_last_newline-3F-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/hunk.rb, line 326</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">missing_last_newline?</span>(<span class="ruby-identifier">data</span>)
+ <span class="ruby-identifier">newline</span> = <span class="ruby-identifier">encode</span>(<span class="ruby-string">&quot;\n&quot;</span>)
+
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">data</span>[<span class="ruby-value">-2</span>]
+ <span class="ruby-identifier">data</span>[<span class="ruby-value">-2</span>].<span class="ruby-identifier">end_with?</span>(<span class="ruby-identifier">newline</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">data</span>[<span class="ruby-value">-1</span>].<span class="ruby-identifier">end_with?</span>(<span class="ruby-identifier">newline</span>)
+ <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">data</span>[<span class="ruby-value">-1</span>]
+ <span class="ruby-operator">!</span><span class="ruby-identifier">data</span>[<span class="ruby-value">-1</span>].<span class="ruby-identifier">end_with?</span>(<span class="ruby-identifier">newline</span>)
+ <span class="ruby-keyword">else</span>
+ <span class="ruby-keyword">true</span>
+ <span class="ruby-keyword">end</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-overlaps-3F" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">overlaps?</span><span
+ class="method-args">(hunk)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+ <p>Determines whether there is an overlap between this hunk and the provided hunk. This will be true if the difference between the two hunks start or end positions is within one position of each other.</p>
+
+ <div class="method-source-code" id="overlaps-3F-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/hunk.rb, line 110</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">overlaps?</span>(<span class="ruby-identifier">hunk</span>)
+ <span class="ruby-identifier">hunk</span> <span class="ruby-keyword">and</span> (((<span class="ruby-ivar">@start_old</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">hunk</span>.<span class="ruby-identifier">end_old</span>) <span class="ruby-operator">&lt;=</span> <span class="ruby-value">1</span>) <span class="ruby-keyword">or</span>
+ ((<span class="ruby-ivar">@start_new</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">hunk</span>.<span class="ruby-identifier">end_new</span>) <span class="ruby-operator">&lt;=</span> <span class="ruby-value">1</span>))
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-unshift" class="method-detail method-alias">
+ <div class="method-heading">
+ <span class="method-name">unshift</span><span
+ class="method-args">(hunk)</span>
+ </div>
+
+ <div class="method-description">
+
+
+ </div>
+
+
+ <div class="aliases">
+ Alias for: <a href="Hunk.html#method-i-merge">merge</a>
+ </div>
+ </div>
+
+ </section>
+
+ </section>
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/LCS/SDiffCallbacks.html b/doc/LCS/SDiffCallbacks.html
new file mode 100644
index 0000000..46b385f
--- /dev/null
+++ b/doc/LCS/SDiffCallbacks.html
@@ -0,0 +1,312 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>class LCS::SDiffCallbacks - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "../";
+ var index_rel_prefix = "../";
+</script>
+
+<script src="../js/navigation.js" defer></script>
+<script src="../js/search.js" defer></script>
+<script src="../js/search_index.js" defer></script>
+<script src="../js/searcher.js" defer></script>
+<script src="../js/darkfish.js" defer></script>
+
+<link href="../css/fonts.css" rel="stylesheet">
+<link href="../css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="class">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="../index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="../table_of_contents.html#pages">Pages</a>
+ <a href="../table_of_contents.html#classes">Classes</a>
+ <a href="../table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+<div class="nav-section">
+ <h3>Table of Contents</h3>
+
+ <ul class="link-list" role="directory">
+ <li><a href="#class-LCS::SDiffCallbacks-label-Use">Use</a>
+ <li><a href="#class-LCS::SDiffCallbacks-label-Simplified+Array+Format">Simplified Array Format</a>
+ </ul>
+</div>
+
+
+ <div id="class-metadata">
+
+
+<div id="parent-class-section" class="nav-section">
+ <h3>Parent</h3>
+
+ <p class="link">Object
+</div>
+
+
+
+
+<!-- Method Quickref -->
+<div id="method-list-section" class="nav-section">
+ <h3>Methods</h3>
+
+ <ul class="link-list" role="directory">
+ <li ><a href="#method-c-new">::new</a>
+ <li ><a href="#method-i-change">#change</a>
+ <li ><a href="#method-i-discard_a">#discard_a</a>
+ <li ><a href="#method-i-discard_b">#discard_b</a>
+ <li ><a href="#method-i-match">#match</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-labelledby="class-LCS::SDiffCallbacks">
+ <h1 id="class-LCS::SDiffCallbacks" class="class">
+ class LCS::SDiffCallbacks
+ </h1>
+
+ <section class="description">
+
+<p>This will produce a simple array of diff change objects. Each element in the <a href="SDiffCallbacks.html#attribute-i-diffs"><code>diffs</code></a> array is a single ContextChange. In the set of <a href="SDiffCallbacks.html#attribute-i-diffs"><code>diffs</code></a> provided by <a href="SDiffCallbacks.html"><code>SDiffCallbacks</code></a>, both old and new objects will be presented for both changed &lt;strong&gt;and unchanged&lt;/strong&gt; objects. <code>nil</code> will be substituted for a discarded object.</p>
+
+<p>The diffset produced by this callback, when provided to <a href="../LCS.html#method-i-sdiff"><code>Diff::LCS#sdiff</code></a>, will compute and display the necessary components to show two sequences and their minimized differences side by side, just like the Unix utility <code>sdiff</code>.</p>
+
+<pre>same same
+before | after
+old &lt; -
+- &gt; new
+
+seq1 = %w(a b c e h j l m n p)
+seq2 = %w(b c d e f j k l m r s t)
+
+diffs = Diff::LCS.sdiff(seq1, seq2)
+ # This example shows a simplified array format.
+ # [ [ &quot;-&quot;, [ 0, &quot;a&quot;], [ 0, nil ] ],
+ # [ &quot;=&quot;, [ 1, &quot;b&quot;], [ 0, &quot;b&quot; ] ],
+ # [ &quot;=&quot;, [ 2, &quot;c&quot;], [ 1, &quot;c&quot; ] ],
+ # [ &quot;+&quot;, [ 3, nil], [ 2, &quot;d&quot; ] ],
+ # [ &quot;=&quot;, [ 3, &quot;e&quot;], [ 3, &quot;e&quot; ] ],
+ # [ &quot;!&quot;, [ 4, &quot;h&quot;], [ 4, &quot;f&quot; ] ],
+ # [ &quot;=&quot;, [ 5, &quot;j&quot;], [ 5, &quot;j&quot; ] ],
+ # [ &quot;+&quot;, [ 6, nil], [ 6, &quot;k&quot; ] ],
+ # [ &quot;=&quot;, [ 6, &quot;l&quot;], [ 7, &quot;l&quot; ] ],
+ # [ &quot;=&quot;, [ 7, &quot;m&quot;], [ 8, &quot;m&quot; ] ],
+ # [ &quot;!&quot;, [ 8, &quot;n&quot;], [ 9, &quot;r&quot; ] ],
+ # [ &quot;!&quot;, [ 9, &quot;p&quot;], [ 10, &quot;s&quot; ] ],
+ # [ &quot;+&quot;, [ 10, nil], [ 11, &quot;t&quot; ] ] ]</pre>
+
+<p>The result of this operation is similar to that of Diff::LCS::ContextDiffCallbacks. They may be compared as:</p>
+
+<pre class="ruby"><span class="ruby-identifier">s</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">sdiff</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>).<span class="ruby-identifier">reject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">action</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;=&quot;</span> }
+<span class="ruby-identifier">c</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">sdiff</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextDiffCallbacks</span>).<span class="ruby-identifier">flatten</span>(<span class="ruby-value">1</span>)
+
+<span class="ruby-identifier">s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">c</span> <span class="ruby-comment"># -&gt; true</span>
+</pre>
+
+<h3 id="class-LCS::SDiffCallbacks-label-Use">Use<span><a href="#class-LCS::SDiffCallbacks-label-Use">&para;</a> <a href="#top">&uarr;</a></span></h3>
+
+<p>This callback object must be initialised and is used by the <a href="../LCS.html#method-i-sdiff"><code>Diff::LCS#sdiff</code></a> method.</p>
+
+<pre class="ruby"><span class="ruby-identifier">cbo</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">SDiffCallbacks</span>.<span class="ruby-identifier">new</span>
+<span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-constant">LCS</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">cbo</span>)
+</pre>
+
+<p>As with the other initialisable callback objects, Diff::LCS::SDiffCallbacks can be initialised with a block. As there is no “fininishing” to be done, this has no effect on the state of the object.</p>
+
+<pre class="ruby"><span class="ruby-identifier">cbo</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">SDiffCallbacks</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">tcbo</span><span class="ruby-operator">|</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-constant">LCS</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">tcbo</span>) }
+</pre>
+
+<h3 id="class-LCS::SDiffCallbacks-label-Simplified+Array+Format">Simplified <a href="../Array.html"><code>Array</code></a> Format<span><a href="#class-LCS::SDiffCallbacks-label-Simplified+Array+Format">&para;</a> <a href="#top">&uarr;</a></span></h3>
+
+<p>The simplified array format used in the example above can be obtained with:</p>
+
+<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;pp&#39;</span>
+<span class="ruby-identifier">pp</span> <span class="ruby-identifier">diffs</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_a</span> }
+</pre>
+
+ </section>
+
+ <section id="5Buntitled-5D" class="documentation-section">
+
+
+
+ <section class="attribute-method-details" class="method-section">
+ <header>
+ <h3>Attributes</h3>
+ </header>
+
+ <div id="attribute-i-diffs" class="method-detail">
+ <div class="method-heading attribute-method-heading">
+ <span class="method-name">diffs</span><span
+ class="attribute-access-type">[R]</span>
+ </div>
+
+ <div class="method-description">
+ <p>Returns the difference set collected during the diff process.</p>
+ </div>
+ </div>
+ </section>
+
+
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Class Methods</h3>
+ </header>
+
+ <div id="method-c-new" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">new</span><span
+ class="method-args">() { |self| ... }</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="new-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 305</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span> <span class="ruby-comment">#:yields self:</span>
+ <span class="ruby-ivar">@diffs</span> = []
+ <span class="ruby-keyword">yield</span> <span class="ruby-keyword">self</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
+ <header>
+ <h3>Public Instance Methods</h3>
+ </header>
+
+ <div id="method-i-change" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">change</span><span
+ class="method-args">(event)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="change-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 322</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-ivar">@diffs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">simplify</span>(<span class="ruby-identifier">event</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-discard_a" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">discard_a</span><span
+ class="method-args">(event)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="discard_a-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 314</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">discard_a</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-ivar">@diffs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">simplify</span>(<span class="ruby-identifier">event</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-discard_b" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">discard_b</span><span
+ class="method-args">(event)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="discard_b-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 318</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">discard_b</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-ivar">@diffs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">simplify</span>(<span class="ruby-identifier">event</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div id="method-i-match" class="method-detail ">
+ <div class="method-heading">
+ <span class="method-name">match</span><span
+ class="method-args">(event)</span>
+ <span class="method-click-advice">click to toggle source</span>
+ </div>
+
+ <div class="method-description">
+
+
+ <div class="method-source-code" id="match-source">
+ <pre><span class="ruby-comment"># File lib/diff/lcs/callbacks.rb, line 310</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">match</span>(<span class="ruby-identifier">event</span>)
+ <span class="ruby-ivar">@diffs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span><span class="ruby-operator">::</span><span class="ruby-constant">ContextChange</span>.<span class="ruby-identifier">simplify</span>(<span class="ruby-identifier">event</span>)
+<span class="ruby-keyword">end</span></pre>
+ </div>
+ </div>
+
+
+ </div>
+
+ </section>
+
+ </section>
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/License_md.html b/doc/License_md.html
new file mode 100644
index 0000000..c0fd8e4
--- /dev/null
+++ b/doc/License_md.html
@@ -0,0 +1,110 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>License - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "./";
+ var index_rel_prefix = "./";
+</script>
+
+<script src="./js/navigation.js" defer></script>
+<script src="./js/search.js" defer></script>
+<script src="./js/search_index.js" defer></script>
+<script src="./js/searcher.js" defer></script>
+<script src="./js/darkfish.js" defer></script>
+
+<link href="./css/fonts.css" rel="stylesheet">
+<link href="./css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="file">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="./index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="./table_of_contents.html#pages">Pages</a>
+ <a href="./table_of_contents.html#classes">Classes</a>
+ <a href="./table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+
+ <div id="project-metadata">
+
+<div id="fileindex-section" class="nav-section">
+ <h3>Pages</h3>
+
+ <ul class="link-list">
+ <li><a href="./Code-of-Conduct_md.html">Code-of-Conduct</a>
+ <li><a href="./Contributing_md.html">Contributing</a>
+ <li><a href="./History_md.html">History</a>
+ <li><a href="./License_md.html">License</a>
+ <li><a href="./Manifest_txt.html">Manifest</a>
+ <li><a href="./README_rdoc.html">README</a>
+ <li><a href="./docs/COPYING_txt.html">COPYING</a>
+ <li><a href="./docs/artistic_txt.html">artistic</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-label="Page License.md">
+
+<p>== <a href="License_md.html">License</a></p>
+
+<p>This software is available under three licenses: the GNU GPL version 2 (or at your option, a later version), the Perl Artistic license, or the MIT license. Note that my preference for licensing is the MIT license, but Algorithm::Diff was dually originally licensed with the Perl Artistic and the GNU GPL (“the same terms as Perl itself”) and given that the Ruby implementation originally hewed pretty closely to the Perl version, I must maintain the additional licensing terms.</p>
+<ul><li>
+<p>Copyright 2004–2013 Austin Ziegler.</p>
+</li><li>
+<p>Adapted from Algorithm::Diff (Perl) by Ned Konz and a Smalltalk version by Mario I. Wolczko.</p>
+</li></ul>
+
+<p>=== MIT <a href="License_md.html">License</a></p>
+
+<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
+
+<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
+
+<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
+
+<p>=== Perl Artistic <a href="License_md.html">License</a> (version 2) See the file <a href="docs/artistic_txt.html">docs/artistic.txt</a> in the main distribution.</p>
+
+<p>=== GNU GPL version 2 See the file <a href="docs/COPYING_txt.html">docs/COPYING.txt</a> in the main distribution.</p>
+
+</main>
+
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/Manifest_txt.html b/doc/Manifest_txt.html
new file mode 100644
index 0000000..4f36eee
--- /dev/null
+++ b/doc/Manifest_txt.html
@@ -0,0 +1,91 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>Manifest - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "./";
+ var index_rel_prefix = "./";
+</script>
+
+<script src="./js/navigation.js" defer></script>
+<script src="./js/search.js" defer></script>
+<script src="./js/search_index.js" defer></script>
+<script src="./js/searcher.js" defer></script>
+<script src="./js/darkfish.js" defer></script>
+
+<link href="./css/fonts.css" rel="stylesheet">
+<link href="./css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="file">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="./index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="./table_of_contents.html#pages">Pages</a>
+ <a href="./table_of_contents.html#classes">Classes</a>
+ <a href="./table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+
+ <div id="project-metadata">
+
+<div id="fileindex-section" class="nav-section">
+ <h3>Pages</h3>
+
+ <ul class="link-list">
+ <li><a href="./Code-of-Conduct_md.html">Code-of-Conduct</a>
+ <li><a href="./Contributing_md.html">Contributing</a>
+ <li><a href="./History_md.html">History</a>
+ <li><a href="./License_md.html">License</a>
+ <li><a href="./Manifest_txt.html">Manifest</a>
+ <li><a href="./README_rdoc.html">README</a>
+ <li><a href="./docs/COPYING_txt.html">COPYING</a>
+ <li><a href="./docs/artistic_txt.html">artistic</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-label="Page Manifest.txt">
+
+<p>.rspec <a href="Code-of-Conduct_md.html">Code-of-Conduct.md</a> <a href="Contributing_md.html">Contributing.md</a> <a href="History_md.html">History.md</a> <a href="License_md.html">License.md</a> <a href="Manifest_txt.html">Manifest.txt</a> <a href="README_rdoc.html">README.rdoc</a> Rakefile bin/htmldiff bin/ldiff <a href="docs/COPYING_txt.html">docs/COPYING.txt</a> <a href="docs/artistic_txt.html">docs/artistic.txt</a> lib/diff-lcs.rb lib/diff/lcs.rb lib/diff/lcs/array.rb lib/diff/lcs/backports.rb lib/diff/lcs/block.rb lib/diff/lcs/callbacks.rb lib/diff/lcs/change.rb lib/diff/lcs/htmldiff.rb lib/diff/lcs/hunk.rb lib/diff/lcs/internals.rb lib/diff/lcs/ldiff.rb lib/diff/lcs/string.rb spec/change_spec.rb spec/diff_spec.rb spec/fixtures/aX spec/fixtures/bXaX spec/fixtures/ds1.csv spec/fixtures/ds2.csv spec/fixtures/ldiff/output.diff spec/fixtures/ldiff/output.diff-c spec/fixtures/ldiff/output.diff-e spec/fixtures/ldiff/output.diff-f spec/fixtures/ldiff/output.diff-u spec/fixtures/ldiff/output.diff.chef spec/fixtures/ldiff/output.diff.chef-c spec/fixtures/ldiff/output.diff.chef-e spec/fixtures/ldiff/output.diff.chef-f spec/fixtures/ldiff/output.diff.chef-u spec/fixtures/ldiff/output.diff.chef2 spec/fixtures/ldiff/output.diff.chef2-c spec/fixtures/ldiff/output.diff.chef2-d spec/fixtures/ldiff/output.diff.chef2-e spec/fixtures/ldiff/output.diff.chef2-f spec/fixtures/ldiff/output.diff.chef2-u spec/fixtures/new-chef spec/fixtures/new-chef2 spec/fixtures/old-chef spec/fixtures/old-chef2 spec/hunk_spec.rb spec/issues_spec.rb spec/lcs_spec.rb spec/ldiff_spec.rb spec/patch_spec.rb spec/sdiff_spec.rb spec/spec_helper.rb spec/traverse_balanced_spec.rb spec/traverse_sequences_spec.rb</p>
+
+</main>
+
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/README_rdoc.html b/doc/README_rdoc.html
new file mode 100644
index 0000000..8b2478e
--- /dev/null
+++ b/doc/README_rdoc.html
@@ -0,0 +1,170 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>README - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "./";
+ var index_rel_prefix = "./";
+</script>
+
+<script src="./js/navigation.js" defer></script>
+<script src="./js/search.js" defer></script>
+<script src="./js/search_index.js" defer></script>
+<script src="./js/searcher.js" defer></script>
+<script src="./js/darkfish.js" defer></script>
+
+<link href="./css/fonts.css" rel="stylesheet">
+<link href="./css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="file">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="./index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="./table_of_contents.html#pages">Pages</a>
+ <a href="./table_of_contents.html#classes">Classes</a>
+ <a href="./table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+<div class="nav-section">
+ <h3>Table of Contents</h3>
+
+ <ul class="link-list" role="directory">
+ <li><a href="#label-Diff-3A-3ALCS">Diff::LCS</a>
+ <li><a href="#label-Description">Description</a>
+ <li><a href="#label-Synopsis">Synopsis</a>
+ <li><a href="#label-History">History</a>
+ </ul>
+</div>
+
+
+ <div id="project-metadata">
+
+<div id="fileindex-section" class="nav-section">
+ <h3>Pages</h3>
+
+ <ul class="link-list">
+ <li><a href="./Code-of-Conduct_md.html">Code-of-Conduct</a>
+ <li><a href="./Contributing_md.html">Contributing</a>
+ <li><a href="./History_md.html">History</a>
+ <li><a href="./License_md.html">License</a>
+ <li><a href="./Manifest_txt.html">Manifest</a>
+ <li><a href="./README_rdoc.html">README</a>
+ <li><a href="./docs/COPYING_txt.html">COPYING</a>
+ <li><a href="./docs/artistic_txt.html">artistic</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-label="Page README.rdoc">
+
+<h1 id="label-Diff-3A-3ALCS"><a href="LCS.html"><code>Diff::LCS</code></a><span><a href="#label-Diff-3A-3ALCS">&para;</a> <a href="#top">&uarr;</a></span></h1>
+<dl class="rdoc-list note-list"><dt>home
+<dd>
+<p><a href="https://github.com/halostatue/diff-lcs">github.com/halostatue/diff-lcs</a></p>
+</dd><dt>code
+<dd>
+<p><a href="https://github.com/halostatue/diff-lcs">github.com/halostatue/diff-lcs</a></p>
+</dd><dt>bugs
+<dd>
+<p><a href="https://github.com/halostatue/diff-lcs/issues">github.com/halostatue/diff-lcs/issues</a></p>
+</dd><dt>rdoc
+<dd>
+<p><a href="http://rubydoc.info/github/halostatue/diff-lcs">rubydoc.info/github/halostatue/diff-lcs</a></p>
+</dd><dt>continuous integration
+<dd>
+<p><a href="https://github.com/halostatue/diff-lcs/actions"><img src="https://github.com/halostatue/diff-lcs/workflows/CI/badge.svg" /></a></p>
+</dd></dl>
+
+<h2 id="label-Description">Description<span><a href="#label-Description">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<p><a href="LCS.html"><code>Diff::LCS</code></a> computes the difference between two Enumerable sequences using the McIlroy-Hunt longest common subsequence (<a href="LCS.html"><code>LCS</code></a>) algorithm. It includes utilities to create a simple HTML diff output format and a standard diff-like tool.</p>
+
+<p>This is release 1.4.3, providing a simple extension that allows for Diff::LCS::Change objects to be treated implicitly as arrays and fixes a number of formatting issues.</p>
+
+<p>Ruby versions below 2.5 are soft-deprecated, which means that older versions are no longer part of the CI test suite. If any changes have been introduced that break those versions, bug reports and patches will be accepted, but it will be up to the reporter to verify any fixes prior to release. The next major release will completely break compatibility.</p>
+
+<h2 id="label-Synopsis">Synopsis<span><a href="#label-Synopsis">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<p>Using this module is quite simple. By default, <a href="LCS.html"><code>Diff::LCS</code></a> does not extend objects with the <a href="LCS.html"><code>Diff::LCS</code></a> interface, but will be called as if it were a function:</p>
+
+<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;diff/lcs&#39;</span>
+
+<span class="ruby-identifier">seq1</span> = <span class="ruby-node">%w(a b c e h j l m n p)</span>
+<span class="ruby-identifier">seq2</span> = <span class="ruby-node">%w(b c d e f j k l m r s t)</span>
+
+<span class="ruby-identifier">lcs</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-constant">LCS</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>)
+<span class="ruby-identifier">diffs</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">diff</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>)
+<span class="ruby-identifier">sdiff</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">sdiff</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>)
+<span class="ruby-identifier">seq</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">traverse_sequences</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">callback_obj</span>)
+<span class="ruby-identifier">bal</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">traverse_balanced</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">callback_obj</span>)
+<span class="ruby-identifier">seq2</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">patch!</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">diffs</span>)
+<span class="ruby-identifier">seq1</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">unpatch!</span>(<span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">diffs</span>)
+<span class="ruby-identifier">seq2</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">patch!</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">sdiff</span>)
+<span class="ruby-identifier">seq1</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">unpatch!</span>(<span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">sdiff</span>)
+</pre>
+
+<p>Objects can be extended with Diff::LCS:</p>
+
+<pre class="ruby"><span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">extend</span>(<span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>)
+<span class="ruby-identifier">lcs</span> = <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">lcs</span>(<span class="ruby-identifier">seq2</span>)
+<span class="ruby-identifier">diffs</span> = <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">diff</span>(<span class="ruby-identifier">seq2</span>)
+<span class="ruby-identifier">sdiff</span> = <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">sdiff</span>(<span class="ruby-identifier">seq2</span>)
+<span class="ruby-identifier">seq</span> = <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">traverse_sequences</span>(<span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">callback_obj</span>)
+<span class="ruby-identifier">bal</span> = <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">traverse_balanced</span>(<span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">callback_obj</span>)
+<span class="ruby-identifier">seq2</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">patch!</span>(<span class="ruby-identifier">diffs</span>)
+<span class="ruby-identifier">seq1</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">seq2</span>.<span class="ruby-identifier">unpatch!</span>(<span class="ruby-identifier">diffs</span>)
+<span class="ruby-identifier">seq2</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">patch!</span>(<span class="ruby-identifier">sdiff</span>)
+<span class="ruby-identifier">seq1</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">seq2</span>.<span class="ruby-identifier">unpatch!</span>(<span class="ruby-identifier">sdiff</span>)
+</pre>
+
+<p>By requiring &#39;diff/lcs/array&#39; or &#39;diff/lcs/string&#39;, <a href="Array.html"><code>Array</code></a> or <a href="String.html"><code>String</code></a> will be extended for use this way.</p>
+
+<p>Note that <a href="LCS.html"><code>Diff::LCS</code></a> requires a sequenced enumerable container, which means that the order of enumeration is both predictable and consistent for the same set of data. While it is theoretically possible to generate a diff for an unordered hash, it will only be meaningful if the enumeration of the hashes is consistent. In general, this will mean that containers that behave like <a href="String.html"><code>String</code></a> or <a href="Array.html"><code>Array</code></a> will perform best.</p>
+
+<h2 id="label-History"><a href="History_md.html">History</a><span><a href="#label-History">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<p><a href="LCS.html"><code>Diff::LCS</code></a> is a port of Perl&#39;s Algorithm::Diff that uses the McIlroy-Hunt longest common subsequence (<a href="LCS.html"><code>LCS</code></a>) algorithm to compute intelligent differences between two sequenced enumerable containers. The implementation is based on Mario I. Wolczko&#39;s <a href="ftp://st.cs.uiuc.edu/pub/Smalltalk/MANCHESTER/manchester/4.0/diff.st">Smalltalk version 1.2</a> (1993) and Ned Konz&#39;s Perl version <a href="http://search.cpan.org/~nedkonz/Algorithm-Diff-1.15/">Algorithm::Diff 1.15</a>. <a href="LCS.html#method-i-sdiff"><code>Diff::LCS#sdiff</code></a> and <a href="LCS.html#method-i-traverse_balanced"><code>Diff::LCS#traverse_balanced</code></a> were originally written for the Perl version by Mike Schilli.</p>
+
+<p>The algorithm is described in <em>A Fast Algorithm for Computing Longest Common Subsequences</em>, CACM, vol.20, no.5, pp.350-353, May 1977, with a few minor improvements to improve the speed. A simplified description of the algorithm, originally written for the Perl version, was written by Mark-Jason Dominus.</p>
+
+</main>
+
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/String.html b/doc/String.html
new file mode 100644
index 0000000..18d26b9
--- /dev/null
+++ b/doc/String.html
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>class String - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "./";
+ var index_rel_prefix = "./";
+</script>
+
+<script src="./js/navigation.js" defer></script>
+<script src="./js/search.js" defer></script>
+<script src="./js/search_index.js" defer></script>
+<script src="./js/searcher.js" defer></script>
+<script src="./js/darkfish.js" defer></script>
+
+<link href="./css/fonts.css" rel="stylesheet">
+<link href="./css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="class">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="./index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="./table_of_contents.html#pages">Pages</a>
+ <a href="./table_of_contents.html#classes">Classes</a>
+ <a href="./table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+
+ <div id="class-metadata">
+
+
+<div id="parent-class-section" class="nav-section">
+ <h3>Parent</h3>
+
+ <p class="link">Object
+</div>
+
+
+<div id="includes-section" class="nav-section">
+ <h3>Included Modules</h3>
+
+ <ul class="link-list">
+ <li><a class="include" href="LCS.html">LCS</a>
+ </ul>
+</div>
+
+
+
+ </div>
+</nav>
+
+<main role="main" aria-labelledby="class-String">
+ <h1 id="class-String" class="class">
+ class String
+ </h1>
+
+ <section class="description">
+
+ </section>
+
+ <section id="5Buntitled-5D" class="documentation-section">
+
+
+
+
+
+ </section>
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/created.rid b/doc/created.rid
new file mode 100644
index 0000000..6ca4fff
--- /dev/null
+++ b/doc/created.rid
@@ -0,0 +1,21 @@
+Thu, 23 Dec 2021 00:51:29 -0500
+lib/diff/lcs/ldiff.rb Thu, 23 Dec 2021 00:51:24 -0500
+lib/diff/lcs/change.rb Thu, 23 Dec 2021 00:51:24 -0500
+lib/diff/lcs/string.rb Thu, 23 Dec 2021 00:51:24 -0500
+lib/diff/lcs/block.rb Thu, 23 Dec 2021 00:51:24 -0500
+lib/diff/lcs/array.rb Thu, 23 Dec 2021 00:51:24 -0500
+lib/diff/lcs/callbacks.rb Thu, 23 Dec 2021 00:51:24 -0500
+lib/diff/lcs/backports.rb Thu, 23 Dec 2021 00:51:24 -0500
+lib/diff/lcs/hunk.rb Thu, 23 Dec 2021 00:51:24 -0500
+lib/diff/lcs/internals.rb Thu, 23 Dec 2021 00:51:24 -0500
+lib/diff/lcs/htmldiff.rb Thu, 23 Dec 2021 00:51:24 -0500
+lib/diff/lcs.rb Thu, 23 Dec 2021 00:51:24 -0500
+lib/diff-lcs.rb Thu, 23 Dec 2021 00:51:24 -0500
+Code-of-Conduct.md Thu, 23 Dec 2021 00:51:24 -0500
+Contributing.md Thu, 23 Dec 2021 00:51:24 -0500
+History.md Thu, 23 Dec 2021 00:51:24 -0500
+License.md Thu, 23 Dec 2021 00:51:24 -0500
+Manifest.txt Thu, 23 Dec 2021 00:51:24 -0500
+README.rdoc Thu, 23 Dec 2021 00:51:24 -0500
+docs/COPYING.txt Thu, 23 Dec 2021 00:51:24 -0500
+docs/artistic.txt Thu, 23 Dec 2021 00:51:24 -0500
diff --git a/doc/css/fonts.css b/doc/css/fonts.css
new file mode 100644
index 0000000..57302b5
--- /dev/null
+++ b/doc/css/fonts.css
@@ -0,0 +1,167 @@
+/*
+ * Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
+ * with Reserved Font Name "Source". All Rights Reserved. Source is a
+ * trademark of Adobe Systems Incorporated in the United States and/or other
+ * countries.
+ *
+ * This Font Software is licensed under the SIL Open Font License, Version
+ * 1.1.
+ *
+ * This license is copied below, and is also available with a FAQ at:
+ * http://scripts.sil.org/OFL
+ */
+
+@font-face {
+ font-family: "Source Code Pro";
+ font-style: normal;
+ font-weight: 400;
+ src: local("Source Code Pro"),
+ local("SourceCodePro-Regular"),
+ url("../fonts/SourceCodePro-Regular.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "Source Code Pro";
+ font-style: normal;
+ font-weight: 700;
+ src: local("Source Code Pro Bold"),
+ local("SourceCodePro-Bold"),
+ url("../fonts/SourceCodePro-Bold.ttf") format("truetype");
+}
+
+/*
+ * Copyright (c) 2010, Łukasz Dziedzic (dziedzic@typoland.com),
+ * with Reserved Font Name Lato.
+ *
+ * This Font Software is licensed under the SIL Open Font License, Version
+ * 1.1.
+ *
+ * This license is copied below, and is also available with a FAQ at:
+ * http://scripts.sil.org/OFL
+ */
+
+@font-face {
+ font-family: "Lato";
+ font-style: normal;
+ font-weight: 300;
+ src: local("Lato Light"),
+ local("Lato-Light"),
+ url("../fonts/Lato-Light.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "Lato";
+ font-style: italic;
+ font-weight: 300;
+ src: local("Lato Light Italic"),
+ local("Lato-LightItalic"),
+ url("../fonts/Lato-LightItalic.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "Lato";
+ font-style: normal;
+ font-weight: 700;
+ src: local("Lato Regular"),
+ local("Lato-Regular"),
+ url("../fonts/Lato-Regular.ttf") format("truetype");
+}
+
+@font-face {
+ font-family: "Lato";
+ font-style: italic;
+ font-weight: 700;
+ src: local("Lato Italic"),
+ local("Lato-Italic"),
+ url("../fonts/Lato-RegularItalic.ttf") format("truetype");
+}
+
+/*
+ * -----------------------------------------------------------
+ * SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+ * -----------------------------------------------------------
+ *
+ * PREAMBLE
+ * The goals of the Open Font License (OFL) are to stimulate worldwide
+ * development of collaborative font projects, to support the font creation
+ * efforts of academic and linguistic communities, and to provide a free and
+ * open framework in which fonts may be shared and improved in partnership
+ * with others.
+ *
+ * The OFL allows the licensed fonts to be used, studied, modified and
+ * redistributed freely as long as they are not sold by themselves. The
+ * fonts, including any derivative works, can be bundled, embedded,
+ * redistributed and/or sold with any software provided that any reserved
+ * names are not used by derivative works. The fonts and derivatives,
+ * however, cannot be released under any other type of license. The
+ * requirement for fonts to remain under this license does not apply
+ * to any document created using the fonts or their derivatives.
+ *
+ * DEFINITIONS
+ * "Font Software" refers to the set of files released by the Copyright
+ * Holder(s) under this license and clearly marked as such. This may
+ * include source files, build scripts and documentation.
+ *
+ * "Reserved Font Name" refers to any names specified as such after the
+ * copyright statement(s).
+ *
+ * "Original Version" refers to the collection of Font Software components as
+ * distributed by the Copyright Holder(s).
+ *
+ * "Modified Version" refers to any derivative made by adding to, deleting,
+ * or substituting -- in part or in whole -- any of the components of the
+ * Original Version, by changing formats or by porting the Font Software to a
+ * new environment.
+ *
+ * "Author" refers to any designer, engineer, programmer, technical
+ * writer or other person who contributed to the Font Software.
+ *
+ * PERMISSION & CONDITIONS
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of the Font Software, to use, study, copy, merge, embed, modify,
+ * redistribute, and sell modified and unmodified copies of the Font
+ * Software, subject to the following conditions:
+ *
+ * 1) Neither the Font Software nor any of its individual components,
+ * in Original or Modified Versions, may be sold by itself.
+ *
+ * 2) Original or Modified Versions of the Font Software may be bundled,
+ * redistributed and/or sold with any software, provided that each copy
+ * contains the above copyright notice and this license. These can be
+ * included either as stand-alone text files, human-readable headers or
+ * in the appropriate machine-readable metadata fields within text or
+ * binary files as long as those fields can be easily viewed by the user.
+ *
+ * 3) No Modified Version of the Font Software may use the Reserved Font
+ * Name(s) unless explicit written permission is granted by the corresponding
+ * Copyright Holder. This restriction only applies to the primary font name as
+ * presented to the users.
+ *
+ * 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+ * Software shall not be used to promote, endorse or advertise any
+ * Modified Version, except to acknowledge the contribution(s) of the
+ * Copyright Holder(s) and the Author(s) or with their explicit written
+ * permission.
+ *
+ * 5) The Font Software, modified or unmodified, in part or in whole,
+ * must be distributed entirely under this license, and must not be
+ * distributed under any other license. The requirement for fonts to
+ * remain under this license does not apply to any document created
+ * using the Font Software.
+ *
+ * TERMINATION
+ * This license becomes null and void if any of the above conditions are
+ * not met.
+ *
+ * DISCLAIMER
+ * THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ * OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+ * DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+ * OTHER DEALINGS IN THE FONT SOFTWARE.
+ */
+
diff --git a/doc/css/rdoc.css b/doc/css/rdoc.css
new file mode 100644
index 0000000..ebe2e93
--- /dev/null
+++ b/doc/css/rdoc.css
@@ -0,0 +1,639 @@
+/*
+ * "Darkfish" Rdoc CSS
+ * $Id: rdoc.css 54 2009-01-27 01:09:48Z deveiant $
+ *
+ * Author: Michael Granger <ged@FaerieMUD.org>
+ *
+ */
+
+/* vim: ft=css et sw=2 ts=2 sts=2 */
+/* Base Green is: #6C8C22 */
+
+.hide { display: none !important; }
+
+* { padding: 0; margin: 0; }
+
+body {
+ background: #fafafa;
+ font-family: Lato, sans-serif;
+ font-weight: 300;
+}
+
+h1 span,
+h2 span,
+h3 span,
+h4 span,
+h5 span,
+h6 span {
+ position: relative;
+
+ display: none;
+ padding-left: 1em;
+ line-height: 0;
+ vertical-align: baseline;
+ font-size: 10px;
+}
+
+h1 span { top: -1.3em; }
+h2 span { top: -1.2em; }
+h3 span { top: -1.0em; }
+h4 span { top: -0.8em; }
+h5 span { top: -0.5em; }
+h6 span { top: -0.5em; }
+
+h1:hover span,
+h2:hover span,
+h3:hover span,
+h4:hover span,
+h5:hover span,
+h6:hover span {
+ display: inline;
+}
+
+h1:target,
+h2:target,
+h3:target,
+h4:target,
+h5:target,
+h6:target {
+ margin-left: -10px;
+ border-left: 10px solid #f1edba;
+}
+
+:link,
+:visited {
+ color: #6C8C22;
+ text-decoration: none;
+}
+
+:link:hover,
+:visited:hover {
+ border-bottom: 1px dotted #6C8C22;
+}
+
+code,
+pre {
+ font-family: "Source Code Pro", Monaco, monospace;
+ background-color: rgba(27,31,35,0.05);
+ padding: 0em 0.2em;
+ border-radius: 0.2em;
+}
+
+table {
+ margin: 0;
+ border-spacing: 0;
+ border-collapse: collapse;
+}
+
+table tr th, table tr td {
+ padding: 0.2em 0.4em;
+ border: 1px solid #ccc;
+}
+
+table tr th {
+ background-color: #eceaed;
+}
+
+table tr:nth-child(even) td {
+ background-color: #f5f4f6;
+}
+
+/* @group Generic Classes */
+
+.initially-hidden {
+ display: none;
+}
+
+#search-field {
+ width: 98%;
+ background: white;
+ border: none;
+ height: 1.5em;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ text-align: left;
+}
+#search-field:focus {
+ background: #f1edba;
+}
+#search-field:-moz-placeholder,
+#search-field::-webkit-input-placeholder {
+ font-weight: bold;
+ color: #666;
+}
+
+.missing-docs {
+ font-size: 120%;
+ background: white url(../images/wrench_orange.png) no-repeat 4px center;
+ color: #ccc;
+ line-height: 2em;
+ border: 1px solid #d00;
+ opacity: 1;
+ padding-left: 20px;
+ text-indent: 24px;
+ letter-spacing: 3px;
+ font-weight: bold;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+}
+
+.target-section {
+ border: 2px solid #dcce90;
+ border-left-width: 8px;
+ padding: 0 1em;
+ background: #fff3c2;
+}
+
+/* @end */
+
+/* @group Index Page, Standalone file pages */
+.table-of-contents ul {
+ margin: 1em;
+ list-style: none;
+}
+
+.table-of-contents ul ul {
+ margin-top: 0.25em;
+}
+
+.table-of-contents ul :link,
+.table-of-contents ul :visited {
+ font-size: 16px;
+}
+
+.table-of-contents li {
+ margin-bottom: 0.25em;
+}
+
+.table-of-contents li .toc-toggle {
+ width: 16px;
+ height: 16px;
+ background: url(../images/add.png) no-repeat;
+}
+
+.table-of-contents li .toc-toggle.open {
+ background: url(../images/delete.png) no-repeat;
+}
+
+/* @end */
+
+/* @group Top-Level Structure */
+
+nav {
+ float: left;
+ width: 260px;
+ font-family: Helvetica, sans-serif;
+ font-size: 14px;
+ border-right: 1px solid #ccc;
+}
+
+main {
+ display: block;
+ margin: 0 2em 5em 260px;
+ padding-left: 20px;
+ min-width: 340px;
+ font-size: 16px;
+}
+
+main h1,
+main h2,
+main h3,
+main h4,
+main h5,
+main h6 {
+ font-family: Helvetica, sans-serif;
+}
+
+.table-of-contents main {
+ margin-left: 2em;
+}
+
+#validator-badges {
+ clear: both;
+ margin: 1em 1em 2em;
+ font-size: smaller;
+}
+
+/* @end */
+
+/* @group navigation */
+nav {
+ margin-bottom: 1em;
+}
+
+nav .nav-section {
+ margin-top: 2em;
+ border-top: 2px solid #aaa;
+ font-size: 90%;
+ overflow: hidden;
+}
+
+nav h2 {
+ margin: 0;
+ padding: 2px 8px 2px 8px;
+ background-color: #e8e8e8;
+ color: #555;
+ font-size: 125%;
+ text-align: center;
+}
+
+nav h3,
+#table-of-contents-navigation {
+ margin: 0;
+ padding: 2px 8px 2px 8px;
+ text-align: right;
+ background-color: #e8e8e8;
+ color: #555;
+}
+
+nav ul,
+nav dl,
+nav p {
+ padding: 4px 8px 0;
+ list-style: none;
+}
+
+#project-navigation .nav-section {
+ margin: 0;
+ border-top: 0;
+}
+
+#home-section h2 {
+ text-align: center;
+}
+
+#table-of-contents-navigation {
+ font-size: 1.2em;
+ font-weight: bold;
+ text-align: center;
+}
+
+#search-section {
+ margin-top: 0;
+ border-top: 0;
+}
+
+#search-field-wrapper {
+ border-top: 1px solid #aaa;
+ border-bottom: 1px solid #aaa;
+ padding: 3px 8px;
+ background-color: #e8e8e8;
+ color: #555;
+}
+
+ul.link-list li {
+ white-space: nowrap;
+ line-height: 1.4em;
+}
+
+ul.link-list .type {
+ font-size: 8px;
+ text-transform: uppercase;
+ color: white;
+ background: #969696;
+ padding: 2px 4px;
+ -webkit-border-radius: 5px;
+}
+
+dl.note-list dt {
+ float: left;
+ margin-right: 1em;
+}
+
+.calls-super {
+ background: url(../images/arrow_up.png) no-repeat right center;
+}
+
+/* @end */
+
+/* @group Documentation Section */
+main {
+ color: #333;
+}
+
+main > h1:first-child,
+main > h2:first-child,
+main > h3:first-child,
+main > h4:first-child,
+main > h5:first-child,
+main > h6:first-child {
+ margin-top: 0px;
+}
+
+main sup {
+ vertical-align: super;
+ font-size: 0.8em;
+}
+
+/* The heading with the class name */
+main h1[class] {
+ margin-top: 0;
+ margin-bottom: 1em;
+ font-size: 2em;
+ color: #6C8C22;
+}
+
+main h1 {
+ margin: 2em 0 0.5em;
+ font-size: 1.7em;
+}
+
+main h2 {
+ margin: 2em 0 0.5em;
+ font-size: 1.5em;
+}
+
+main h3 {
+ margin: 2em 0 0.5em;
+ font-size: 1.2em;
+}
+
+main h4 {
+ margin: 2em 0 0.5em;
+ font-size: 1.1em;
+}
+
+main h5 {
+ margin: 2em 0 0.5em;
+ font-size: 1em;
+}
+
+main h6 {
+ margin: 2em 0 0.5em;
+ font-size: 1em;
+}
+
+main p {
+ margin: 0 0 0.5em;
+ line-height: 1.4em;
+}
+
+main pre {
+ margin: 1.2em 0.5em;
+ padding: 1em;
+ font-size: 0.8em;
+}
+
+main hr {
+ margin: 1.5em 1em;
+ border: 2px solid #ddd;
+}
+
+main blockquote {
+ margin: 0 2em 1.2em 1.2em;
+ padding-left: 0.5em;
+ border-left: 2px solid #ddd;
+}
+
+main ol,
+main ul {
+ margin: 1em 2em;
+}
+
+main li > p {
+ margin-bottom: 0.5em;
+}
+
+main dl {
+ margin: 1em 0.5em;
+}
+
+main dt {
+ margin-bottom: 0.5em;
+ font-weight: bold;
+}
+
+main dd {
+ margin: 0 1em 1em 0.5em;
+}
+
+main header h2 {
+ margin-top: 2em;
+ border-width: 0;
+ border-top: 4px solid #bbb;
+ font-size: 130%;
+}
+
+main header h3 {
+ margin: 2em 0 1.5em;
+ border-width: 0;
+ border-top: 3px solid #bbb;
+ font-size: 120%;
+}
+
+.documentation-section-title {
+ position: relative;
+}
+.documentation-section-title .section-click-top {
+ position: absolute;
+ top: 6px;
+ left: 12px;
+ font-size: 10px;
+ color: #9b9877;
+ visibility: hidden;
+ padding-left: 0.5px;
+}
+
+.documentation-section-title:hover .section-click-top {
+ visibility: visible;
+}
+
+.constants-list > dl {
+ margin: 1em 0 2em;
+ border: 0;
+}
+
+.constants-list > dl dt {
+ margin-bottom: 0.75em;
+ padding-left: 0;
+ font-family: "Source Code Pro", Monaco, monospace;
+ font-size: 110%;
+}
+
+.constants-list > dl dt a {
+ color: inherit;
+}
+
+.constants-list > dl dd {
+ margin: 0 0 2em 0;
+ padding: 0;
+ color: #666;
+}
+
+.documentation-section h2 {
+ position: relative;
+}
+
+.documentation-section h2 a {
+ position: absolute;
+ top: 8px;
+ right: 10px;
+ font-size: 12px;
+ color: #9b9877;
+ visibility: hidden;
+}
+
+.documentation-section h2:hover a {
+ visibility: visible;
+}
+
+/* @group Method Details */
+
+main .method-source-code {
+ max-height: 0;
+ overflow: hidden;
+ transition-duration: 200ms;
+ transition-delay: 0ms;
+ transition-property: all;
+ transition-timing-function: ease-in-out;
+}
+
+main .method-source-code.active-menu {
+ max-height: 100vh;
+}
+
+main .method-description .method-calls-super {
+ color: #333;
+ font-weight: bold;
+}
+
+main .method-detail {
+ margin-bottom: 2.5em;
+ cursor: pointer;
+}
+
+main .method-detail:target {
+ margin-left: -10px;
+ border-left: 10px solid #f1edba;
+}
+
+main .method-heading {
+ position: relative;
+ font-family: "Source Code Pro", Monaco, monospace;
+ font-size: 110%;
+ font-weight: bold;
+ color: #333;
+}
+main .method-heading :link,
+main .method-heading :visited {
+ color: inherit;
+}
+main .method-click-advice {
+ position: absolute;
+ top: 2px;
+ right: 5px;
+ font-size: 12px;
+ color: #9b9877;
+ visibility: hidden;
+ padding-right: 20px;
+ line-height: 20px;
+ background: url(../images/zoom.png) no-repeat right top;
+}
+main .method-heading:hover .method-click-advice {
+ visibility: visible;
+}
+
+main .method-alias .method-heading {
+ color: #666;
+}
+
+main .method-description,
+main .aliases {
+ margin-top: 0.75em;
+ color: #333;
+}
+
+main .aliases {
+ padding-top: 4px;
+ font-style: italic;
+ cursor: default;
+}
+main .method-description ul {
+ margin-left: 1.5em;
+}
+
+main #attribute-method-details .method-detail:hover {
+ background-color: transparent;
+ cursor: default;
+}
+main .attribute-access-type {
+ text-transform: uppercase;
+ padding: 0 1em;
+}
+/* @end */
+
+/* @end */
+
+/* @group Source Code */
+
+pre {
+ margin: 0.5em 0;
+ border: 1px dashed #999;
+ padding: 0.5em;
+ background: #262626;
+ color: white;
+ overflow: auto;
+}
+
+.ruby-constant { color: #7fffd4; background: transparent; }
+.ruby-keyword { color: #00ffff; background: transparent; }
+.ruby-ivar { color: #eedd82; background: transparent; }
+.ruby-operator { color: #00ffee; background: transparent; }
+.ruby-identifier { color: #ffdead; background: transparent; }
+.ruby-node { color: #ffa07a; background: transparent; }
+.ruby-comment { color: #dc0000; background: transparent; }
+.ruby-regexp { color: #ffa07a; background: transparent; }
+.ruby-value { color: #7fffd4; background: transparent; }
+
+/* @end */
+
+
+/* @group search results */
+#search-results {
+ font-family: Lato, sans-serif;
+ font-weight: 300;
+}
+
+#search-results .search-match {
+ font-family: Helvetica, sans-serif;
+ font-weight: normal;
+}
+
+#search-results .search-selected {
+ background: #e8e8e8;
+ border-bottom: 1px solid transparent;
+}
+
+#search-results li {
+ list-style: none;
+ border-bottom: 1px solid #aaa;
+ margin-bottom: 0.5em;
+}
+
+#search-results li:last-child {
+ border-bottom: none;
+ margin-bottom: 0;
+}
+
+#search-results li p {
+ padding: 0;
+ margin: 0.5em;
+}
+
+#search-results .search-namespace {
+ font-weight: bold;
+}
+
+#search-results li em {
+ background: yellow;
+ font-style: normal;
+}
+
+#search-results pre {
+ margin: 0.5em;
+ font-family: "Source Code Pro", Monaco, monospace;
+}
+
+/* @end */
+
diff --git a/doc/docs/COPYING_txt.html b/doc/docs/COPYING_txt.html
new file mode 100644
index 0000000..b0b2816
--- /dev/null
+++ b/doc/docs/COPYING_txt.html
@@ -0,0 +1,299 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>COPYING - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "../";
+ var index_rel_prefix = "../";
+</script>
+
+<script src="../js/navigation.js" defer></script>
+<script src="../js/search.js" defer></script>
+<script src="../js/search_index.js" defer></script>
+<script src="../js/searcher.js" defer></script>
+<script src="../js/darkfish.js" defer></script>
+
+<link href="../css/fonts.css" rel="stylesheet">
+<link href="../css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="file">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="../index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="../table_of_contents.html#pages">Pages</a>
+ <a href="../table_of_contents.html#classes">Classes</a>
+ <a href="../table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+
+ <div id="project-metadata">
+
+<div id="fileindex-section" class="nav-section">
+ <h3>Pages</h3>
+
+ <ul class="link-list">
+ <li><a href="../Code-of-Conduct_md.html">Code-of-Conduct</a>
+ <li><a href="../Contributing_md.html">Contributing</a>
+ <li><a href="../History_md.html">History</a>
+ <li><a href="../License_md.html">License</a>
+ <li><a href="../Manifest_txt.html">Manifest</a>
+ <li><a href="../README_rdoc.html">README</a>
+ <li><a href="../docs/COPYING_txt.html">COPYING</a>
+ <li><a href="../docs/artistic_txt.html">artistic</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-label="Page docs/COPYING.txt">
+
+<pre> GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your</pre>
+
+<p>freedom to share and change it. By contrast, the GNU General Public <a href="../License_md.html">License</a> is intended to guarantee your freedom to share and change free software–to make sure the software is free for all its users. This General Public <a href="../License_md.html">License</a> applies to most of the Free Software Foundation&#39;s software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public <a href="../License_md.html">License</a> instead.) You can apply it to your programs, too.</p>
+
+<pre>When we speak of free software, we are referring to freedom, not</pre>
+
+<p>price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.</p>
+
+<pre>To protect your rights, we need to make restrictions that forbid</pre>
+
+<p>anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.</p>
+
+<pre>For example, if you distribute copies of such a program, whether</pre>
+
+<p>gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.</p>
+
+<pre>We protect your rights with two steps: (1) copyright the software, and</pre>
+
+<p>(2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.</p>
+
+<pre>Also, for each author&#39;s protection and ours, we want to make certain</pre>
+
+<p>that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors&#39; reputations.</p>
+
+<pre>Finally, any free program is threatened constantly by software</pre>
+
+<p>patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone&#39;s free use or not licensed at all.</p>
+
+<pre>The precise terms and conditions for copying, distribution and</pre>
+
+<p>modification follow.</p>
+
+<pre> GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains</pre>
+
+<p>a notice placed by the copyright holder saying it may be distributed under the terms of this General Public <a href="../License_md.html">License</a>. The “Program”, below, refers to any such program or work, and a “work based on the Program” means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term “modification”.) Each licensee is addressed as “you”.</p>
+
+<p>Activities other than copying, distribution and modification are not covered by this <a href="../License_md.html">License</a>; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.</p>
+
+<pre>1. You may copy and distribute verbatim copies of the Program&#39;s</pre>
+
+<p>source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this <a href="../License_md.html">License</a> and to the absence of any warranty; and give any other recipients of the Program a copy of this <a href="../License_md.html">License</a> along with the Program.</p>
+
+<p>You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.</p>
+
+<pre class="ruby"><span class="ruby-value">2</span>. <span class="ruby-constant">You</span> <span class="ruby-identifier">may</span> <span class="ruby-identifier">modify</span> <span class="ruby-identifier">your</span> <span class="ruby-identifier">copy</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">copies</span> <span class="ruby-identifier">of</span> <span class="ruby-identifier">the</span> <span class="ruby-constant">Program</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">any</span> <span class="ruby-identifier">portion</span>
+</pre>
+
+<p>of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:</p>
+
+<pre>a) You must cause the modified files to carry prominent notices
+stating that you changed the files and the date of any change.
+
+b) You must cause any work that you distribute or publish, that in
+whole or in part contains or is derived from the Program or any
+part thereof, to be licensed as a whole at no charge to all third
+parties under the terms of this License.
+
+c) If the modified program normally reads commands interactively
+when run, you must cause it, when started running for such
+interactive use in the most ordinary way, to print or display an
+announcement including an appropriate copyright notice and a
+notice that there is no warranty (or else, saying that you provide
+a warranty) and that users may redistribute the program under
+these conditions, and telling the user how to view a copy of this
+License. (Exception: if the Program itself is interactive but
+does not normally print such an announcement, your work based on
+the Program is not required to print an announcement.)</pre>
+
+<p>These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this <a href="../License_md.html">License</a>, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this <a href="../License_md.html">License</a>, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.</p>
+
+<p>Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.</p>
+
+<p>In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this <a href="../License_md.html">License</a>.</p>
+
+<pre>3. You may copy and distribute the Program (or a work based on it,</pre>
+
+<p>under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:</p>
+
+<pre>a) Accompany it with the complete corresponding machine-readable
+source code, which must be distributed under the terms of Sections
+1 and 2 above on a medium customarily used for software interchange; or,
+
+b) Accompany it with a written offer, valid for at least three
+years, to give any third party, for a charge no more than your
+cost of physically performing source distribution, a complete
+machine-readable copy of the corresponding source code, to be
+distributed under the terms of Sections 1 and 2 above on a medium
+customarily used for software interchange; or,
+
+c) Accompany it with the information you received as to the offer
+to distribute corresponding source code. (This alternative is
+allowed only for noncommercial distribution and only if you
+received the program in object code or executable form with such
+an offer, in accord with Subsection b above.)</pre>
+
+<p>The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.</p>
+
+<p>If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.</p>
+
+<pre>4. You may not copy, modify, sublicense, or distribute the Program</pre>
+
+<p>except as expressly provided under this <a href="../License_md.html">License</a>. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this <a href="../License_md.html">License</a>. However, parties who have received copies, or rights, from you under this <a href="../License_md.html">License</a> will not have their licenses terminated so long as such parties remain in full compliance.</p>
+
+<pre>5. You are not required to accept this License, since you have not</pre>
+
+<p>signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this <a href="../License_md.html">License</a>. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this <a href="../License_md.html">License</a> to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.</p>
+
+<pre>6. Each time you redistribute the Program (or any work based on the</pre>
+
+<p>Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients&#39; exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this <a href="../License_md.html">License</a>.</p>
+
+<pre>7. If, as a consequence of a court judgment or allegation of patent</pre>
+
+<p>infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this <a href="../License_md.html">License</a>, they do not excuse you from the conditions of this <a href="../License_md.html">License</a>. If you cannot distribute so as to satisfy simultaneously your obligations under this <a href="../License_md.html">License</a> and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this <a href="../License_md.html">License</a> would be to refrain entirely from distribution of the Program.</p>
+
+<p>If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.</p>
+
+<p>It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.</p>
+
+<p>This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this <a href="../License_md.html">License</a>.</p>
+
+<pre>8. If the distribution and/or use of the Program is restricted in</pre>
+
+<p>certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this <a href="../License_md.html">License</a> may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this <a href="../License_md.html">License</a> incorporates the limitation as if written in the body of this <a href="../License_md.html">License</a>.</p>
+
+<pre>9. The Free Software Foundation may publish revised and/or new versions</pre>
+
+<p>of the General Public <a href="../License_md.html">License</a> from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.</p>
+
+<p>Each version is given a distinguishing version number. If the Program specifies a version number of this <a href="../License_md.html">License</a> which applies to it and “any later version”, you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this <a href="../License_md.html">License</a>, you may choose any version ever published by the Free Software Foundation.</p>
+
+<pre class="ruby"><span class="ruby-value">10</span>. <span class="ruby-constant">If</span> <span class="ruby-identifier">you</span> <span class="ruby-identifier">wish</span> <span class="ruby-identifier">to</span> <span class="ruby-identifier">incorporate</span> <span class="ruby-identifier">parts</span> <span class="ruby-identifier">of</span> <span class="ruby-identifier">the</span> <span class="ruby-constant">Program</span> <span class="ruby-identifier">into</span> <span class="ruby-identifier">other</span> <span class="ruby-identifier">free</span>
+</pre>
+
+<p>programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.</p>
+
+<pre> NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY</pre>
+
+<p>FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</p>
+
+<pre class="ruby"><span class="ruby-value">12</span>. <span class="ruby-constant">IN</span> <span class="ruby-constant">NO</span> <span class="ruby-constant">EVENT</span> <span class="ruby-constant">UNLESS</span> <span class="ruby-constant">REQUIRED</span> <span class="ruby-constant">BY</span> <span class="ruby-constant">APPLICABLE</span> <span class="ruby-constant">LAW</span> <span class="ruby-constant">OR</span> <span class="ruby-constant">AGREED</span> <span class="ruby-constant">TO</span> <span class="ruby-constant">IN</span> <span class="ruby-constant">WRITING</span>
+</pre>
+
+<p>WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
+
+<pre> END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest</pre>
+
+<p>possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.</p>
+
+<pre>To do so, attach the following notices to the program. It is safest</pre>
+
+<p>to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.</p>
+
+<pre>&lt;one line to give the program&#39;s name and a brief idea of what it does.&gt;
+Copyright (C) &lt;year&gt; &lt;name of author&gt;
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.</pre>
+
+<p>Also add information on how to contact you by electronic and paper mail.</p>
+
+<p>If the program is interactive, make it output a short notice like this when it starts in an interactive mode:</p>
+
+<pre>Gnomovision version 69, Copyright (C) year name of author
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w&#39;.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c&#39; for details.</pre>
+
+<p>The hypothetical commands `show w&#39; and `show c&#39; should show the appropriate parts of the General Public <a href="../License_md.html">License</a>. Of course, the commands you use may be called something other than `show w&#39; and `show c&#39;; they could even be mouse-clicks or menu items–whatever suits your program.</p>
+
+<p>You should also get your employer (if you work as a programmer) or your school, if any, to sign a “copyright disclaimer” for the program, if necessary. Here is a sample; alter the names:</p>
+
+<pre>Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+`Gnomovision&#39; (which makes passes at compilers) written by James Hacker.
+
+&lt;signature of Ty Coon&gt;, 1 April 1989
+Ty Coon, President of Vice</pre>
+
+<p>This General Public <a href="../License_md.html">License</a> does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public <a href="../License_md.html">License</a> instead of this <a href="../License_md.html">License</a>.</p>
+
+</main>
+
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/docs/artistic_txt.html b/doc/docs/artistic_txt.html
new file mode 100644
index 0000000..9410972
--- /dev/null
+++ b/doc/docs/artistic_txt.html
@@ -0,0 +1,204 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>artistic - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "../";
+ var index_rel_prefix = "../";
+</script>
+
+<script src="../js/navigation.js" defer></script>
+<script src="../js/search.js" defer></script>
+<script src="../js/search_index.js" defer></script>
+<script src="../js/searcher.js" defer></script>
+<script src="../js/darkfish.js" defer></script>
+
+<link href="../css/fonts.css" rel="stylesheet">
+<link href="../css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="file">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="../index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="../table_of_contents.html#pages">Pages</a>
+ <a href="../table_of_contents.html#classes">Classes</a>
+ <a href="../table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+
+
+ <div id="project-metadata">
+
+<div id="fileindex-section" class="nav-section">
+ <h3>Pages</h3>
+
+ <ul class="link-list">
+ <li><a href="../Code-of-Conduct_md.html">Code-of-Conduct</a>
+ <li><a href="../Contributing_md.html">Contributing</a>
+ <li><a href="../History_md.html">History</a>
+ <li><a href="../License_md.html">License</a>
+ <li><a href="../Manifest_txt.html">Manifest</a>
+ <li><a href="../README_rdoc.html">README</a>
+ <li><a href="../docs/COPYING_txt.html">COPYING</a>
+ <li><a href="../docs/artistic_txt.html">artistic</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main" aria-label="Page docs/artistic.txt">
+
+<p>The “Artistic License”</p>
+
+<pre class="ruby"><span class="ruby-constant">Preamble</span>
+</pre>
+
+<p>The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications.</p>
+
+<p>Definitions:</p>
+
+<pre>&quot;Package&quot; refers to the collection of files distributed by the
+Copyright Holder, and derivatives of that collection of files
+created through textual modification.
+
+&quot;Standard Version&quot; refers to such a Package if it has not been
+modified, or has been modified in accordance with the wishes
+of the Copyright Holder as specified below.
+
+&quot;Copyright Holder&quot; is whoever is named in the copyright or
+copyrights for the package.
+
+&quot;You&quot; is you, if you&#39;re thinking about copying or distributing
+this Package.
+
+&quot;Reasonable copying fee&quot; is whatever you can justify on the
+basis of media cost, duplication charges, time of people involved,
+and so on. (You will not be required to justify it to the
+Copyright Holder, but only to the computing community at large
+as a market that must bear the fee.)
+
+&quot;Freely Available&quot; means that no fee is charged for the item
+itself, though there may be fees involved in handling the item.
+It also means that recipients of the item may redistribute it
+under the same conditions they received it.</pre>
+<ol><li>
+<p>You may make and give away verbatim copies of the source form of the</p>
+</li></ol>
+
+<p>Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers.</p>
+<ol><li>
+<p>You may apply bug fixes, portability fixes and other modifications</p>
+</li></ol>
+
+<p>derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version.</p>
+<ol><li>
+<p>You may otherwise modify your copy of this Package in any way, provided</p>
+</li></ol>
+
+<p>that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following:</p>
+
+<pre>a) place your modifications in the Public Domain or otherwise make them
+Freely Available, such as by posting said modifications to Usenet or
+an equivalent medium, or placing the modifications on a major archive
+site such as uunet.uu.net, or by allowing the Copyright Holder to include
+your modifications in the Standard Version of the Package.
+
+b) use the modified Package only within your corporation or organization.
+
+c) rename any non-standard executables so the names do not conflict
+with standard executables, which must also be provided, and provide
+a separate manual page for each non-standard executable that clearly
+documents how it differs from the Standard Version.
+
+d) make other distribution arrangements with the Copyright Holder.</pre>
+<ol><li>
+<p>You may distribute the programs of this Package in object code or</p>
+</li></ol>
+
+<p>executable form, provided that you do at least ONE of the following:</p>
+
+<pre>a) distribute a Standard Version of the executables and library files,
+together with instructions (in the manual page or equivalent) on where
+to get the Standard Version.
+
+b) accompany the distribution with the machine-readable source of
+the Package with your modifications.
+
+c) give non-standard executables non-standard names, and clearly
+document the differences in manual pages (or equivalent), together
+with instructions on where to get the Standard Version.
+
+d) make other distribution arrangements with the Copyright Holder.</pre>
+<ol><li>
+<p>You may charge a reasonable copying fee for any distribution of this</p>
+</li></ol>
+
+<p>Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. You may embed this Package&#39;s interpreter within an executable of yours (by linking); this shall be construed as a mere form of aggregation, provided that the complete Standard Version of the interpreter is so embedded.</p>
+<ol><li>
+<p>The scripts and library files supplied as input to or produced as</p>
+</li></ol>
+
+<p>output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whoever generated them, and may be sold commercially, and may be aggregated with this Package. If such scripts or library files are aggregated with this Package via the so-called “undump” or “unexec” methods of producing a binary executable image, then distribution of such an image shall neither be construed as a distribution of this Package nor shall it fall under the restrictions of Paragraphs 3 and 4, provided that you do not represent such an executable image as a Standard Version of this Package.</p>
+<ol><li>
+<p>C subroutines (or comparably compiled subroutines in other</p>
+</li></ol>
+
+<p>languages) supplied by you and linked into this Package in order to emulate subroutines and variables of the language defined by this Package shall not be considered part of this Package, but are the equivalent of input as in Paragraph 6, provided these subroutines do not change the language in any way that would cause it to fail the regression tests for the language.</p>
+<ol><li>
+<p>Aggregation of this Package with a commercial distribution is always</p>
+</li></ol>
+
+<p>permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package&#39;s interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package.</p>
+<ol><li>
+<p>The name of the Copyright Holder may not be used to endorse or promote</p>
+</li></ol>
+
+<p>products derived from this software without specific prior written permission.</p>
+<ol><li>
+<p>THIS PACKAGE IS PROVIDED “AS IS” AND WITHOUT ANY EXPRESS OR</p>
+</li></ol>
+
+<p>IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.</p>
+
+<pre class="ruby"><span class="ruby-constant">The</span> <span class="ruby-constant">End</span>
+</pre>
+
+</main>
+
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/fonts/Lato-Light.ttf b/doc/fonts/Lato-Light.ttf
new file mode 100644
index 0000000..b49dd43
--- /dev/null
+++ b/doc/fonts/Lato-Light.ttf
Binary files differ
diff --git a/doc/fonts/Lato-LightItalic.ttf b/doc/fonts/Lato-LightItalic.ttf
new file mode 100644
index 0000000..7959fef
--- /dev/null
+++ b/doc/fonts/Lato-LightItalic.ttf
Binary files differ
diff --git a/doc/fonts/Lato-Regular.ttf b/doc/fonts/Lato-Regular.ttf
new file mode 100644
index 0000000..839cd58
--- /dev/null
+++ b/doc/fonts/Lato-Regular.ttf
Binary files differ
diff --git a/doc/fonts/Lato-RegularItalic.ttf b/doc/fonts/Lato-RegularItalic.ttf
new file mode 100644
index 0000000..bababa0
--- /dev/null
+++ b/doc/fonts/Lato-RegularItalic.ttf
Binary files differ
diff --git a/doc/fonts/SourceCodePro-Bold.ttf b/doc/fonts/SourceCodePro-Bold.ttf
new file mode 100644
index 0000000..61e3090
--- /dev/null
+++ b/doc/fonts/SourceCodePro-Bold.ttf
Binary files differ
diff --git a/doc/fonts/SourceCodePro-Regular.ttf b/doc/fonts/SourceCodePro-Regular.ttf
new file mode 100644
index 0000000..85686d9
--- /dev/null
+++ b/doc/fonts/SourceCodePro-Regular.ttf
Binary files differ
diff --git a/doc/images/add.png b/doc/images/add.png
new file mode 100644
index 0000000..6332fef
--- /dev/null
+++ b/doc/images/add.png
Binary files differ
diff --git a/doc/images/arrow_up.png b/doc/images/arrow_up.png
new file mode 100644
index 0000000..1ebb193
--- /dev/null
+++ b/doc/images/arrow_up.png
Binary files differ
diff --git a/doc/images/brick.png b/doc/images/brick.png
new file mode 100644
index 0000000..7851cf3
--- /dev/null
+++ b/doc/images/brick.png
Binary files differ
diff --git a/doc/images/brick_link.png b/doc/images/brick_link.png
new file mode 100644
index 0000000..9ebf013
--- /dev/null
+++ b/doc/images/brick_link.png
Binary files differ
diff --git a/doc/images/bug.png b/doc/images/bug.png
new file mode 100644
index 0000000..2d5fb90
--- /dev/null
+++ b/doc/images/bug.png
Binary files differ
diff --git a/doc/images/bullet_black.png b/doc/images/bullet_black.png
new file mode 100644
index 0000000..5761970
--- /dev/null
+++ b/doc/images/bullet_black.png
Binary files differ
diff --git a/doc/images/bullet_toggle_minus.png b/doc/images/bullet_toggle_minus.png
new file mode 100644
index 0000000..b47ce55
--- /dev/null
+++ b/doc/images/bullet_toggle_minus.png
Binary files differ
diff --git a/doc/images/bullet_toggle_plus.png b/doc/images/bullet_toggle_plus.png
new file mode 100644
index 0000000..9ab4a89
--- /dev/null
+++ b/doc/images/bullet_toggle_plus.png
Binary files differ
diff --git a/doc/images/date.png b/doc/images/date.png
new file mode 100644
index 0000000..783c833
--- /dev/null
+++ b/doc/images/date.png
Binary files differ
diff --git a/doc/images/delete.png b/doc/images/delete.png
new file mode 100644
index 0000000..08f2493
--- /dev/null
+++ b/doc/images/delete.png
Binary files differ
diff --git a/doc/images/find.png b/doc/images/find.png
new file mode 100644
index 0000000..1547479
--- /dev/null
+++ b/doc/images/find.png
Binary files differ
diff --git a/doc/images/loadingAnimation.gif b/doc/images/loadingAnimation.gif
new file mode 100644
index 0000000..82290f4
--- /dev/null
+++ b/doc/images/loadingAnimation.gif
Binary files differ
diff --git a/doc/images/macFFBgHack.png b/doc/images/macFFBgHack.png
new file mode 100644
index 0000000..c6473b3
--- /dev/null
+++ b/doc/images/macFFBgHack.png
Binary files differ
diff --git a/doc/images/package.png b/doc/images/package.png
new file mode 100644
index 0000000..da3c2a2
--- /dev/null
+++ b/doc/images/package.png
Binary files differ
diff --git a/doc/images/page_green.png b/doc/images/page_green.png
new file mode 100644
index 0000000..de8e003
--- /dev/null
+++ b/doc/images/page_green.png
Binary files differ
diff --git a/doc/images/page_white_text.png b/doc/images/page_white_text.png
new file mode 100644
index 0000000..813f712
--- /dev/null
+++ b/doc/images/page_white_text.png
Binary files differ
diff --git a/doc/images/page_white_width.png b/doc/images/page_white_width.png
new file mode 100644
index 0000000..1eb8809
--- /dev/null
+++ b/doc/images/page_white_width.png
Binary files differ
diff --git a/doc/images/plugin.png b/doc/images/plugin.png
new file mode 100644
index 0000000..6187b15
--- /dev/null
+++ b/doc/images/plugin.png
Binary files differ
diff --git a/doc/images/ruby.png b/doc/images/ruby.png
new file mode 100644
index 0000000..f763a16
--- /dev/null
+++ b/doc/images/ruby.png
Binary files differ
diff --git a/doc/images/tag_blue.png b/doc/images/tag_blue.png
new file mode 100644
index 0000000..3f02b5f
--- /dev/null
+++ b/doc/images/tag_blue.png
Binary files differ
diff --git a/doc/images/tag_green.png b/doc/images/tag_green.png
new file mode 100644
index 0000000..83ec984
--- /dev/null
+++ b/doc/images/tag_green.png
Binary files differ
diff --git a/doc/images/transparent.png b/doc/images/transparent.png
new file mode 100644
index 0000000..d665e17
--- /dev/null
+++ b/doc/images/transparent.png
Binary files differ
diff --git a/doc/images/wrench.png b/doc/images/wrench.png
new file mode 100644
index 0000000..5c8213f
--- /dev/null
+++ b/doc/images/wrench.png
Binary files differ
diff --git a/doc/images/wrench_orange.png b/doc/images/wrench_orange.png
new file mode 100644
index 0000000..565a933
--- /dev/null
+++ b/doc/images/wrench_orange.png
Binary files differ
diff --git a/doc/images/zoom.png b/doc/images/zoom.png
new file mode 100644
index 0000000..908612e
--- /dev/null
+++ b/doc/images/zoom.png
Binary files differ
diff --git a/doc/index.html b/doc/index.html
new file mode 100644
index 0000000..82b5b02
--- /dev/null
+++ b/doc/index.html
@@ -0,0 +1,184 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "./";
+ var index_rel_prefix = "./";
+</script>
+
+<script src="./js/navigation.js" defer></script>
+<script src="./js/search.js" defer></script>
+<script src="./js/search_index.js" defer></script>
+<script src="./js/searcher.js" defer></script>
+<script src="./js/darkfish.js" defer></script>
+
+<link href="./css/fonts.css" rel="stylesheet">
+<link href="./css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" role="document" class="file">
+<nav role="navigation">
+ <div id="project-navigation">
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
+ <h2>
+ <a href="./index.html" rel="home">Home</a>
+ </h2>
+
+ <div id="table-of-contents-navigation">
+ <a href="./table_of_contents.html#pages">Pages</a>
+ <a href="./table_of_contents.html#classes">Classes</a>
+ <a href="./table_of_contents.html#methods">Methods</a>
+ </div>
+</div>
+
+
+ <div id="search-section" role="search" class="project-section initially-hidden">
+ <form action="#" method="get" accept-charset="utf-8">
+ <div id="search-field-wrapper">
+ <input id="search-field" role="combobox" aria-label="Search"
+ aria-autocomplete="list" aria-controls="search-results"
+ type="text" name="search" placeholder="Search" spellcheck="false"
+ title="Type to search, Up and Down to navigate, Enter to load">
+ </div>
+
+ <ul id="search-results" aria-label="Search Results"
+ aria-busy="false" aria-expanded="false"
+ aria-atomic="false" class="initially-hidden"></ul>
+ </form>
+</div>
+
+ </div>
+
+ <div id="project-metadata">
+
+<div id="fileindex-section" class="nav-section">
+ <h3>Pages</h3>
+
+ <ul class="link-list">
+ <li><a href="./Code-of-Conduct_md.html">Code-of-Conduct</a>
+ <li><a href="./Contributing_md.html">Contributing</a>
+ <li><a href="./History_md.html">History</a>
+ <li><a href="./License_md.html">License</a>
+ <li><a href="./Manifest_txt.html">Manifest</a>
+ <li><a href="./README_rdoc.html">README</a>
+ <li><a href="./docs/COPYING_txt.html">COPYING</a>
+ <li><a href="./docs/artistic_txt.html">artistic</a>
+ </ul>
+</div>
+
+ <div id="classindex-section" class="nav-section">
+ <h3>Class and Module Index</h3>
+
+ <ul class="link-list">
+ <li><a href="./Array.html">Array</a>
+ <li><a href="./Diff.html">Diff</a>
+ <li><a href="./Diff/LCS/Internals.html">Diff::LCS::Internals</a>
+ <li><a href="./Diff/LCS/Ldiff.html">Diff::LCS::Ldiff</a>
+ <li><a href="./Fixnum.html">Fixnum</a>
+ <li><a href="./LCS.html">LCS</a>
+ <li><a href="./LCS.html">LCS</a>
+ <li><a href="./LCS/DefaultCallbacks.html">LCS::BalancedCallbacks</a>
+ <li><a href="./LCS/Block.html">LCS::Block</a>
+ <li><a href="./LCS/Change.html">LCS::Change</a>
+ <li><a href="./LCS/ContextChange.html">LCS::ContextChange</a>
+ <li><a href="./LCS/ContextDiffCallbacks.html">LCS::ContextDiffCallbacks</a>
+ <li><a href="./LCS/DefaultCallbacks.html">LCS::DefaultCallbacks</a>
+ <li><a href="./LCS/DiffCallbacks.html">LCS::DiffCallbacks</a>
+ <li><a href="./LCS/HTMLDiff.html">LCS::HTMLDiff</a>
+ <li><a href="./LCS/Hunk.html">LCS::Hunk</a>
+ <li><a href="./LCS/SDiffCallbacks.html">LCS::SDiffCallbacks</a>
+ <li><a href="./LCS/DefaultCallbacks.html">LCS::SequenceCallbacks</a>
+ <li><a href="./String.html">String</a>
+ </ul>
+</div>
+
+ </div>
+</nav>
+
+<main role="main">
+
+
+<h1 id="label-Diff-3A-3ALCS"><a href="LCS.html"><code>Diff::LCS</code></a><span><a href="#label-Diff-3A-3ALCS">&para;</a> <a href="#top">&uarr;</a></span></h1>
+<dl class="rdoc-list note-list"><dt>home
+<dd>
+<p><a href="https://github.com/halostatue/diff-lcs">github.com/halostatue/diff-lcs</a></p>
+</dd><dt>code
+<dd>
+<p><a href="https://github.com/halostatue/diff-lcs">github.com/halostatue/diff-lcs</a></p>
+</dd><dt>bugs
+<dd>
+<p><a href="https://github.com/halostatue/diff-lcs/issues">github.com/halostatue/diff-lcs/issues</a></p>
+</dd><dt>rdoc
+<dd>
+<p><a href="http://rubydoc.info/github/halostatue/diff-lcs">rubydoc.info/github/halostatue/diff-lcs</a></p>
+</dd><dt>continuous integration
+<dd>
+<p><a href="https://github.com/halostatue/diff-lcs/actions"><img src="https://github.com/halostatue/diff-lcs/workflows/CI/badge.svg" /></a></p>
+</dd></dl>
+
+<h2 id="label-Description">Description<span><a href="#label-Description">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<p><a href="LCS.html"><code>Diff::LCS</code></a> computes the difference between two Enumerable sequences using the McIlroy-Hunt longest common subsequence (<a href="LCS.html"><code>LCS</code></a>) algorithm. It includes utilities to create a simple HTML diff output format and a standard diff-like tool.</p>
+
+<p>This is release 1.4.3, providing a simple extension that allows for Diff::LCS::Change objects to be treated implicitly as arrays and fixes a number of formatting issues.</p>
+
+<p>Ruby versions below 2.5 are soft-deprecated, which means that older versions are no longer part of the CI test suite. If any changes have been introduced that break those versions, bug reports and patches will be accepted, but it will be up to the reporter to verify any fixes prior to release. The next major release will completely break compatibility.</p>
+
+<h2 id="label-Synopsis">Synopsis<span><a href="#label-Synopsis">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<p>Using this module is quite simple. By default, <a href="LCS.html"><code>Diff::LCS</code></a> does not extend objects with the <a href="LCS.html"><code>Diff::LCS</code></a> interface, but will be called as if it were a function:</p>
+
+<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;diff/lcs&#39;</span>
+
+<span class="ruby-identifier">seq1</span> = <span class="ruby-node">%w(a b c e h j l m n p)</span>
+<span class="ruby-identifier">seq2</span> = <span class="ruby-node">%w(b c d e f j k l m r s t)</span>
+
+<span class="ruby-identifier">lcs</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-constant">LCS</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>)
+<span class="ruby-identifier">diffs</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">diff</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>)
+<span class="ruby-identifier">sdiff</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">sdiff</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>)
+<span class="ruby-identifier">seq</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">traverse_sequences</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">callback_obj</span>)
+<span class="ruby-identifier">bal</span> = <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">traverse_balanced</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">callback_obj</span>)
+<span class="ruby-identifier">seq2</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">patch!</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">diffs</span>)
+<span class="ruby-identifier">seq1</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">unpatch!</span>(<span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">diffs</span>)
+<span class="ruby-identifier">seq2</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">patch!</span>(<span class="ruby-identifier">seq1</span>, <span class="ruby-identifier">sdiff</span>)
+<span class="ruby-identifier">seq1</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>.<span class="ruby-identifier">unpatch!</span>(<span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">sdiff</span>)
+</pre>
+
+<p>Objects can be extended with Diff::LCS:</p>
+
+<pre class="ruby"><span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">extend</span>(<span class="ruby-constant">Diff</span><span class="ruby-operator">::</span><span class="ruby-constant">LCS</span>)
+<span class="ruby-identifier">lcs</span> = <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">lcs</span>(<span class="ruby-identifier">seq2</span>)
+<span class="ruby-identifier">diffs</span> = <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">diff</span>(<span class="ruby-identifier">seq2</span>)
+<span class="ruby-identifier">sdiff</span> = <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">sdiff</span>(<span class="ruby-identifier">seq2</span>)
+<span class="ruby-identifier">seq</span> = <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">traverse_sequences</span>(<span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">callback_obj</span>)
+<span class="ruby-identifier">bal</span> = <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">traverse_balanced</span>(<span class="ruby-identifier">seq2</span>, <span class="ruby-identifier">callback_obj</span>)
+<span class="ruby-identifier">seq2</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">patch!</span>(<span class="ruby-identifier">diffs</span>)
+<span class="ruby-identifier">seq1</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">seq2</span>.<span class="ruby-identifier">unpatch!</span>(<span class="ruby-identifier">diffs</span>)
+<span class="ruby-identifier">seq2</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">seq1</span>.<span class="ruby-identifier">patch!</span>(<span class="ruby-identifier">sdiff</span>)
+<span class="ruby-identifier">seq1</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">seq2</span>.<span class="ruby-identifier">unpatch!</span>(<span class="ruby-identifier">sdiff</span>)
+</pre>
+
+<p>By requiring &#39;diff/lcs/array&#39; or &#39;diff/lcs/string&#39;, <a href="Array.html"><code>Array</code></a> or <a href="String.html"><code>String</code></a> will be extended for use this way.</p>
+
+<p>Note that <a href="LCS.html"><code>Diff::LCS</code></a> requires a sequenced enumerable container, which means that the order of enumeration is both predictable and consistent for the same set of data. While it is theoretically possible to generate a diff for an unordered hash, it will only be meaningful if the enumeration of the hashes is consistent. In general, this will mean that containers that behave like <a href="String.html"><code>String</code></a> or <a href="Array.html"><code>Array</code></a> will perform best.</p>
+
+<h2 id="label-History"><a href="History_md.html">History</a><span><a href="#label-History">&para;</a> <a href="#top">&uarr;</a></span></h2>
+
+<p><a href="LCS.html"><code>Diff::LCS</code></a> is a port of Perl&#39;s Algorithm::Diff that uses the McIlroy-Hunt longest common subsequence (<a href="LCS.html"><code>LCS</code></a>) algorithm to compute intelligent differences between two sequenced enumerable containers. The implementation is based on Mario I. Wolczko&#39;s <a href="ftp://st.cs.uiuc.edu/pub/Smalltalk/MANCHESTER/manchester/4.0/diff.st">Smalltalk version 1.2</a> (1993) and Ned Konz&#39;s Perl version <a href="http://search.cpan.org/~nedkonz/Algorithm-Diff-1.15/">Algorithm::Diff 1.15</a>. <a href="LCS.html#method-i-sdiff"><code>Diff::LCS#sdiff</code></a> and <a href="LCS.html#method-i-traverse_balanced"><code>Diff::LCS#traverse_balanced</code></a> were originally written for the Perl version by Mike Schilli.</p>
+
+<p>The algorithm is described in <em>A Fast Algorithm for Computing Longest Common Subsequences</em>, CACM, vol.20, no.5, pp.350-353, May 1977, with a few minor improvements to improve the speed. A simplified description of the algorithm, originally written for the Perl version, was written by Mark-Jason Dominus.</p>
+
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/doc/js/darkfish.js b/doc/js/darkfish.js
new file mode 100644
index 0000000..111bbf8
--- /dev/null
+++ b/doc/js/darkfish.js
@@ -0,0 +1,84 @@
+/**
+ *
+ * Darkfish Page Functions
+ * $Id: darkfish.js 53 2009-01-07 02:52:03Z deveiant $
+ *
+ * Author: Michael Granger <mgranger@laika.com>
+ *
+ */
+
+/* Provide console simulation for firebug-less environments */
+/*
+if (!("console" in window) || !("firebug" in console)) {
+ var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
+ "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
+
+ window.console = {};
+ for (var i = 0; i < names.length; ++i)
+ window.console[names[i]] = function() {};
+};
+*/
+
+
+function showSource( e ) {
+ var target = e.target;
+ while (!target.classList.contains('method-detail')) {
+ target = target.parentNode;
+ }
+ if (typeof target !== "undefined" && target !== null) {
+ target = target.querySelector('.method-source-code');
+ }
+ if (typeof target !== "undefined" && target !== null) {
+ target.classList.toggle('active-menu')
+ }
+};
+
+function hookSourceViews() {
+ document.querySelectorAll('.method-heading').forEach(function (codeObject) {
+ codeObject.addEventListener('click', showSource);
+ });
+};
+
+function hookSearch() {
+ var input = document.querySelector('#search-field');
+ var result = document.querySelector('#search-results');
+ result.classList.remove("initially-hidden");
+
+ var search_section = document.querySelector('#search-section');
+ search_section.classList.remove("initially-hidden");
+
+ var search = new Search(search_data, input, result);
+
+ search.renderItem = function(result) {
+ var li = document.createElement('li');
+ var html = '';
+
+ // TODO add relative path to <script> per-page
+ html += '<p class="search-match"><a href="' + index_rel_prefix + result.path + '">' + this.hlt(result.title);
+ if (result.params)
+ html += '<span class="params">' + result.params + '</span>';
+ html += '</a>';
+
+
+ if (result.namespace)
+ html += '<p class="search-namespace">' + this.hlt(result.namespace);
+
+ if (result.snippet)
+ html += '<div class="search-snippet">' + result.snippet + '</div>';
+
+ li.innerHTML = html;
+
+ return li;
+ }
+
+ search.select = function(result) {
+ window.location.href = result.firstChild.firstChild.href;
+ }
+
+ search.scrollIntoView = search.scrollInWindow;
+};
+
+document.addEventListener('DOMContentLoaded', function() {
+ hookSourceViews();
+ hookSearch();
+});
diff --git a/doc/js/navigation.js b/doc/js/navigation.js
new file mode 100644
index 0000000..dfad74b
--- /dev/null
+++ b/doc/js/navigation.js
@@ -0,0 +1,105 @@
+/*
+ * Navigation allows movement using the arrow keys through the search results.
+ *
+ * When using this library you will need to set scrollIntoView to the
+ * appropriate function for your layout. Use scrollInWindow if the container
+ * is not scrollable and scrollInElement if the container is a separate
+ * scrolling region.
+ */
+Navigation = new function() {
+ this.initNavigation = function() {
+ var _this = this;
+
+ document.addEventListener('keydown', function(e) {
+ _this.onkeydown(e);
+ });
+
+ this.navigationActive = true;
+ }
+
+ this.setNavigationActive = function(state) {
+ this.navigationActive = state;
+ }
+
+ this.onkeydown = function(e) {
+ if (!this.navigationActive) return;
+ switch(e.keyCode) {
+ case 37: //Event.KEY_LEFT:
+ if (this.moveLeft()) e.preventDefault();
+ break;
+ case 38: //Event.KEY_UP:
+ if (e.keyCode == 38 || e.ctrlKey) {
+ if (this.moveUp()) e.preventDefault();
+ }
+ break;
+ case 39: //Event.KEY_RIGHT:
+ if (this.moveRight()) e.preventDefault();
+ break;
+ case 40: //Event.KEY_DOWN:
+ if (e.keyCode == 40 || e.ctrlKey) {
+ if (this.moveDown()) e.preventDefault();
+ }
+ break;
+ case 13: //Event.KEY_RETURN:
+ if (this.current) e.preventDefault();
+ this.select(this.current);
+ break;
+ }
+ if (e.ctrlKey && e.shiftKey) this.select(this.current);
+ }
+
+ this.moveRight = function() {
+ }
+
+ this.moveLeft = function() {
+ }
+
+ this.move = function(isDown) {
+ }
+
+ this.moveUp = function() {
+ return this.move(false);
+ }
+
+ this.moveDown = function() {
+ return this.move(true);
+ }
+
+ /*
+ * Scrolls to the given element in the scrollable element view.
+ */
+ this.scrollInElement = function(element, view) {
+ var offset, viewHeight, viewScroll, height;
+ offset = element.offsetTop;
+ height = element.offsetHeight;
+ viewHeight = view.offsetHeight;
+ viewScroll = view.scrollTop;
+
+ if (offset - viewScroll + height > viewHeight) {
+ view.scrollTop = offset - viewHeight + height;
+ }
+ if (offset < viewScroll) {
+ view.scrollTop = offset;
+ }
+ }
+
+ /*
+ * Scrolls to the given element in the window. The second argument is
+ * ignored
+ */
+ this.scrollInWindow = function(element, ignored) {
+ var offset, viewHeight, viewScroll, height;
+ offset = element.offsetTop;
+ height = element.offsetHeight;
+ viewHeight = window.innerHeight;
+ viewScroll = window.scrollY;
+
+ if (offset - viewScroll + height > viewHeight) {
+ window.scrollTo(window.scrollX, offset - viewHeight + height);
+ }
+ if (offset < viewScroll) {
+ window.scrollTo(window.scrollX, offset);
+ }
+ }
+}
+
diff --git a/doc/js/navigation.js.gz b/doc/js/navigation.js.gz
new file mode 100644
index 0000000..dbb8b1a
--- /dev/null
+++ b/doc/js/navigation.js.gz
Binary files differ
diff --git a/doc/js/search.js b/doc/js/search.js
new file mode 100644
index 0000000..b558ca5
--- /dev/null
+++ b/doc/js/search.js
@@ -0,0 +1,110 @@
+Search = function(data, input, result) {
+ this.data = data;
+ this.input = input;
+ this.result = result;
+
+ this.current = null;
+ this.view = this.result.parentNode;
+ this.searcher = new Searcher(data.index);
+ this.init();
+}
+
+Search.prototype = Object.assign({}, Navigation, new function() {
+ var suid = 1;
+
+ this.init = function() {
+ var _this = this;
+ var observer = function(e) {
+ switch(e.keyCode) {
+ case 38: // Event.KEY_UP
+ case 40: // Event.KEY_DOWN
+ return;
+ }
+ _this.search(_this.input.value);
+ };
+ this.input.addEventListener('keyup', observer);
+ this.input.addEventListener('click', observer); // mac's clear field
+
+ this.searcher.ready(function(results, isLast) {
+ _this.addResults(results, isLast);
+ })
+
+ this.initNavigation();
+ this.setNavigationActive(false);
+ }
+
+ this.search = function(value, selectFirstMatch) {
+ value = value.trim().toLowerCase();
+ if (value) {
+ this.setNavigationActive(true);
+ } else {
+ this.setNavigationActive(false);
+ }
+
+ if (value == '') {
+ this.lastQuery = value;
+ this.result.innerHTML = '';
+ this.result.setAttribute('aria-expanded', 'false');
+ this.setNavigationActive(false);
+ } else if (value != this.lastQuery) {
+ this.lastQuery = value;
+ this.result.setAttribute('aria-busy', 'true');
+ this.result.setAttribute('aria-expanded', 'true');
+ this.firstRun = true;
+ this.searcher.find(value);
+ }
+ }
+
+ this.addResults = function(results, isLast) {
+ var target = this.result;
+ if (this.firstRun && (results.length > 0 || isLast)) {
+ this.current = null;
+ this.result.innerHTML = '';
+ }
+
+ for (var i=0, l = results.length; i < l; i++) {
+ var item = this.renderItem.call(this, results[i]);
+ item.setAttribute('id', 'search-result-' + target.childElementCount);
+ target.appendChild(item);
+ };
+
+ if (this.firstRun && results.length > 0) {
+ this.firstRun = false;
+ this.current = target.firstChild;
+ this.current.classList.add('search-selected');
+ }
+ //TODO: ECMAScript
+ //if (jQuery.browser.msie) this.$element[0].className += '';
+
+ if (isLast) this.result.setAttribute('aria-busy', 'false');
+ }
+
+ this.move = function(isDown) {
+ if (!this.current) return;
+ var next = isDown ? this.current.nextElementSibling : this.current.previousElementSibling;
+ if (next) {
+ this.current.classList.remove('search-selected');
+ next.classList.add('search-selected');
+ this.input.setAttribute('aria-activedescendant', next.getAttribute('id'));
+ this.scrollIntoView(next, this.view);
+ this.current = next;
+ this.input.value = next.firstChild.firstChild.text;
+ this.input.select();
+ }
+ return true;
+ }
+
+ this.hlt = function(html) {
+ return this.escapeHTML(html).
+ replace(/\u0001/g, '<em>').
+ replace(/\u0002/g, '</em>');
+ }
+
+ this.escapeHTML = function(html) {
+ return html.replace(/[&<>]/g, function(c) {
+ return '&#' + c.charCodeAt(0) + ';';
+ });
+ }
+
+});
+
diff --git a/doc/js/search_index.js b/doc/js/search_index.js
new file mode 100644
index 0000000..97c314a
--- /dev/null
+++ b/doc/js/search_index.js
@@ -0,0 +1 @@
+var search_data = {"index":{"searchIndex":["array","diff","diff::lcs::internals","diff::lcs::ldiff","fixnum","lcs","balancedcallbacks","block","change","contextchange","contextdiffcallbacks","defaultcallbacks","diffcallbacks","htmldiff","hunk","sdiffcallbacks","sequencecallbacks","string","<=>()","<=>()","==()","==()","lcs()","adding?()","analyze_patchset()","callbacks_for()","change()","change()","change()","change()","change()","changed?()","deleting?()","diff()","diff()","diff()","diff_size()","discard_a()","discard_a()","discard_a()","discard_a()","discard_a()","discard_a()","discard_b()","discard_b()","discard_b()","discard_b()","discard_b()","discard_b()","finish()","finished_a?()","finished_b?()","from_a()","from_a()","inspect()","intuit_diff_direction()","lcs()","lcs()","lcs()","match()","match()","match()","match()","match()","merge()","missing_last_newline?()","new()","new()","new()","new()","new()","new()","new()","op()","overlaps?()","patch()","patch()","patch!()","patch!()","patch_me()","positive?()","run()","sdiff()","sdiff()","simplify()","to_a()","to_a()","to_ary()","to_ary()","traverse_balanced()","traverse_balanced()","traverse_sequences()","traverse_sequences()","unchanged?()","unpatch()","unpatch!()","unpatch!()","unpatch_me()","unshift()","valid_action?()","code-of-conduct","contributing","history","license","manifest","readme","copying","artistic"],"longSearchIndex":["array","diff","diff::lcs::internals","diff::lcs::ldiff","fixnum","lcs","lcs::balancedcallbacks","lcs::block","lcs::change","lcs::contextchange","lcs::contextdiffcallbacks","lcs::defaultcallbacks","lcs::diffcallbacks","lcs::htmldiff","lcs::hunk","lcs::sdiffcallbacks","lcs::sequencecallbacks","string","lcs::change#<=>()","lcs::contextchange#<=>()","lcs::change#==()","lcs::contextchange#==()","lcs::lcs()","lcs::change#adding?()","diff::lcs::internals::analyze_patchset()","lcs::callbacks_for()","lcs::contextdiffcallbacks#change()","lcs::defaultcallbacks::change()","lcs::defaultcallbacks::change()","lcs::defaultcallbacks::change()","lcs::sdiffcallbacks#change()","lcs::change#changed?()","lcs::change#deleting?()","lcs::diff()","lcs#diff()","lcs::hunk#diff()","lcs::block#diff_size()","lcs::contextdiffcallbacks#discard_a()","lcs::defaultcallbacks::discard_a()","lcs::defaultcallbacks::discard_a()","lcs::defaultcallbacks::discard_a()","lcs::diffcallbacks#discard_a()","lcs::sdiffcallbacks#discard_a()","lcs::contextdiffcallbacks#discard_b()","lcs::defaultcallbacks::discard_b()","lcs::defaultcallbacks::discard_b()","lcs::defaultcallbacks::discard_b()","lcs::diffcallbacks#discard_b()","lcs::sdiffcallbacks#discard_b()","lcs::diffcallbacks#finish()","lcs::change#finished_a?()","lcs::change#finished_b?()","lcs::change::from_a()","lcs::contextchange::from_a()","lcs::change#inspect()","diff::lcs::internals::intuit_diff_direction()","diff::lcs::internals::lcs()","lcs::lcs()","lcs#lcs()","lcs::defaultcallbacks::match()","lcs::defaultcallbacks::match()","lcs::defaultcallbacks::match()","lcs::diffcallbacks#match()","lcs::sdiffcallbacks#match()","lcs::hunk#merge()","lcs::hunk#missing_last_newline?()","lcs::block::new()","lcs::change::new()","lcs::contextchange::new()","lcs::diffcallbacks::new()","lcs::htmldiff::new()","lcs::hunk::new()","lcs::sdiffcallbacks::new()","lcs::block#op()","lcs::hunk#overlaps?()","lcs#patch()","lcs::patch()","lcs::patch!()","lcs#patch!()","lcs#patch_me()","fixnum#positive?()","lcs::htmldiff#run()","lcs#sdiff()","lcs::sdiff()","lcs::contextchange::simplify()","lcs::change#to_a()","lcs::contextchange#to_a()","lcs::change#to_ary()","lcs::contextchange#to_ary()","lcs::traverse_balanced()","lcs#traverse_balanced()","lcs::traverse_sequences()","lcs#traverse_sequences()","lcs::change#unchanged?()","lcs#unpatch()","lcs#unpatch!()","lcs::unpatch!()","lcs#unpatch_me()","lcs::hunk#unshift()","lcs::change::valid_action?()","","","","","","","",""],"info":[["Array","","Array.html","",""],["Diff","","Diff.html","",""],["Diff::LCS::Internals","","Diff/LCS/Internals.html","",""],["Diff::LCS::Ldiff","","Diff/LCS/Ldiff.html","",""],["Fixnum","","Fixnum.html","",""],["LCS","","LCS.html","","<p>How Diff Works (by Mark-Jason Dominus)\n<p>I once read an article written by the authors of <code>diff</code>; they said …\n"],["LCS::BalancedCallbacks","","LCS/DefaultCallbacks.html","","<p>This callback object implements the default set of callback events, which only returns the event itself. …\n"],["LCS::Block","","LCS/Block.html","","<p>A block is an operation removing, adding, or changing a group of items. Basically, this is just a list …\n"],["LCS::Change","","LCS/Change.html","","<p>Represents a simplistic (non-contextual) change. Represents the removal or addition of an element from …\n"],["LCS::ContextChange","","LCS/ContextChange.html","","<p>Represents a contextual change. Contains the position and values of the elements in the old and the new …\n"],["LCS::ContextDiffCallbacks","","LCS/ContextDiffCallbacks.html","","<p>This will produce a compound array of contextual diff change objects. Each element in the #diffs array …\n"],["LCS::DefaultCallbacks","","LCS/DefaultCallbacks.html","","<p>This callback object implements the default set of callback events, which only returns the event itself. …\n"],["LCS::DiffCallbacks","","LCS/DiffCallbacks.html","","<p>This will produce a compound array of simple diff change objects. Each element in the #diffs array is …\n"],["LCS::HTMLDiff","","LCS/HTMLDiff.html","","<p>Produce a simple HTML diff view.\n"],["LCS::Hunk","","LCS/Hunk.html","","<p>A Hunk is a group of Blocks which overlap because of the context surrounding each block. (So if we&#39;re …\n"],["LCS::SDiffCallbacks","","LCS/SDiffCallbacks.html","","<p>This will produce a simple array of diff change objects. Each element in the #diffs array is a single …\n"],["LCS::SequenceCallbacks","","LCS/DefaultCallbacks.html","","<p>This callback object implements the default set of callback events, which only returns the event itself. …\n"],["String","","String.html","",""],["<=>","LCS::Change","LCS/Change.html#method-i-3C-3D-3E","(other)",""],["<=>","LCS::ContextChange","LCS/ContextChange.html#method-i-3C-3D-3E","(other)",""],["==","LCS::Change","LCS/Change.html#method-i-3D-3D","(other)",""],["==","LCS::ContextChange","LCS/ContextChange.html#method-i-3D-3D","(other)",""],["LCS","LCS","LCS.html#method-c-LCS","(seq1, seq2, &block)",""],["adding?","LCS::Change","LCS/Change.html#method-i-adding-3F","()",""],["analyze_patchset","Diff::LCS::Internals","Diff/LCS/Internals.html#method-c-analyze_patchset","(patchset, depth = 0)","<p>This method will analyze the provided patchset to provide a single-pass normalization (conversion of …\n"],["callbacks_for","LCS","LCS.html#method-c-callbacks_for","(callbacks)",""],["change","LCS::ContextDiffCallbacks","LCS/ContextDiffCallbacks.html#method-i-change","(event)",""],["change","LCS::DefaultCallbacks","LCS/DefaultCallbacks.html#method-c-change","(event)","<p>Called when both the old and new values have changed.\n"],["change","LCS::DefaultCallbacks","LCS/DefaultCallbacks.html#method-c-change","(event)","<p>Called when both the old and new values have changed.\n"],["change","LCS::DefaultCallbacks","LCS/DefaultCallbacks.html#method-c-change","(event)","<p>Called when both the old and new values have changed.\n"],["change","LCS::SDiffCallbacks","LCS/SDiffCallbacks.html#method-i-change","(event)",""],["changed?","LCS::Change","LCS/Change.html#method-i-changed-3F","()",""],["deleting?","LCS::Change","LCS/Change.html#method-i-deleting-3F","()",""],["diff","LCS","LCS.html#method-c-diff","(seq1, seq2, callbacks = nil, &block)","<p>#diff computes the smallest set of additions and deletions necessary to turn the first sequence into …\n"],["diff","LCS","LCS.html#method-i-diff","(other, callbacks = nil, &block)","<p>Returns the difference set between <code>self</code> and <code>other</code>. See Diff::LCS#diff.\n"],["diff","LCS::Hunk","LCS/Hunk.html#method-i-diff","(format, last = false)","<p>Returns a diff string based on a format.\n"],["diff_size","LCS::Block","LCS/Block.html#method-i-diff_size","()",""],["discard_a","LCS::ContextDiffCallbacks","LCS/ContextDiffCallbacks.html#method-i-discard_a","(event)",""],["discard_a","LCS::DefaultCallbacks","LCS/DefaultCallbacks.html#method-c-discard_a","(event)","<p>Called when the old value is discarded in favour of the new value.\n"],["discard_a","LCS::DefaultCallbacks","LCS/DefaultCallbacks.html#method-c-discard_a","(event)","<p>Called when the old value is discarded in favour of the new value.\n"],["discard_a","LCS::DefaultCallbacks","LCS/DefaultCallbacks.html#method-c-discard_a","(event)","<p>Called when the old value is discarded in favour of the new value.\n"],["discard_a","LCS::DiffCallbacks","LCS/DiffCallbacks.html#method-i-discard_a","(event)",""],["discard_a","LCS::SDiffCallbacks","LCS/SDiffCallbacks.html#method-i-discard_a","(event)",""],["discard_b","LCS::ContextDiffCallbacks","LCS/ContextDiffCallbacks.html#method-i-discard_b","(event)",""],["discard_b","LCS::DefaultCallbacks","LCS/DefaultCallbacks.html#method-c-discard_b","(event)","<p>Called when the new value is discarded in favour of the old value.\n"],["discard_b","LCS::DefaultCallbacks","LCS/DefaultCallbacks.html#method-c-discard_b","(event)","<p>Called when the new value is discarded in favour of the old value.\n"],["discard_b","LCS::DefaultCallbacks","LCS/DefaultCallbacks.html#method-c-discard_b","(event)","<p>Called when the new value is discarded in favour of the old value.\n"],["discard_b","LCS::DiffCallbacks","LCS/DiffCallbacks.html#method-i-discard_b","(event)",""],["discard_b","LCS::SDiffCallbacks","LCS/SDiffCallbacks.html#method-i-discard_b","(event)",""],["finish","LCS::DiffCallbacks","LCS/DiffCallbacks.html#method-i-finish","()","<p>Finalizes the diff process. If an unprocessed hunk still exists, then it is appended to the diff list. …\n"],["finished_a?","LCS::Change","LCS/Change.html#method-i-finished_a-3F","()",""],["finished_b?","LCS::Change","LCS/Change.html#method-i-finished_b-3F","()",""],["from_a","LCS::Change","LCS/Change.html#method-c-from_a","(arr)",""],["from_a","LCS::ContextChange","LCS/ContextChange.html#method-c-from_a","(arr)",""],["inspect","LCS::Change","LCS/Change.html#method-i-inspect","(*_args)",""],["intuit_diff_direction","Diff::LCS::Internals","Diff/LCS/Internals.html#method-c-intuit_diff_direction","(src, patchset, limit = nil)","<p>Examine the patchset and the source to see in which direction the patch should be applied.\n<p>WARNING: By …\n"],["lcs","Diff::LCS::Internals","Diff/LCS/Internals.html#method-c-lcs","(a, b)","<p>Compute the longest common subsequence between the sequenced Enumerables <code>a</code> and <code>b</code>. The result is an array …\n"],["lcs","LCS","LCS.html#method-c-lcs","(seq1, seq2, &block)",""],["lcs","LCS","LCS.html#method-i-lcs","(other, &block)","<p>Returns an Array containing the longest common subsequence(s) between <code>self</code> and <code>other</code>. See Diff::LCS#lcs …\n"],["match","LCS::DefaultCallbacks","LCS/DefaultCallbacks.html#method-c-match","(event)","<p>Called when two items match.\n"],["match","LCS::DefaultCallbacks","LCS/DefaultCallbacks.html#method-c-match","(event)","<p>Called when two items match.\n"],["match","LCS::DefaultCallbacks","LCS/DefaultCallbacks.html#method-c-match","(event)","<p>Called when two items match.\n"],["match","LCS::DiffCallbacks","LCS/DiffCallbacks.html#method-i-match","(_event)",""],["match","LCS::SDiffCallbacks","LCS/SDiffCallbacks.html#method-i-match","(event)",""],["merge","LCS::Hunk","LCS/Hunk.html#method-i-merge","(hunk)","<p>Merges this hunk and the provided hunk together if they overlap. Returns a truthy value so that if there …\n"],["missing_last_newline?","LCS::Hunk","LCS/Hunk.html#method-i-missing_last_newline-3F","(data)",""],["new","LCS::Block","LCS/Block.html#method-c-new","(chunk)",""],["new","LCS::Change","LCS/Change.html#method-c-new","(*args)",""],["new","LCS::ContextChange","LCS/ContextChange.html#method-c-new","(*args)",""],["new","LCS::DiffCallbacks","LCS/DiffCallbacks.html#method-c-new","()",""],["new","LCS::HTMLDiff","LCS/HTMLDiff.html#method-c-new","(left, right, options = nil)",""],["new","LCS::Hunk","LCS/Hunk.html#method-c-new","(data_old, data_new, piece, flag_context, file_length_difference)","<p>Create a hunk using references to both the old and new data, as well as the piece of data.\n"],["new","LCS::SDiffCallbacks","LCS/SDiffCallbacks.html#method-c-new","()",""],["op","LCS::Block","LCS/Block.html#method-i-op","()",""],["overlaps?","LCS::Hunk","LCS/Hunk.html#method-i-overlaps-3F","(hunk)","<p>Determines whether there is an overlap between this hunk and the provided hunk. This will be true if …\n"],["patch","LCS","LCS.html#method-i-patch","(patchset)","<p>Attempts to patch <code>self</code> with the provided <code>patchset</code>. A new sequence based on <code>self</code> and the <code>patchset</code> will …\n"],["patch","LCS","LCS.html#method-c-patch","(src, patchset, direction = nil)","<p>Applies a <code>patchset</code> to the sequence <code>src</code> according to the <code>direction</code> (<code>:patch</code> or <code>:unpatch</code>), producing a new …\n"],["patch!","LCS","LCS.html#method-c-patch-21","(src, patchset)","<p>Given a set of patchset, convert the current version to the next version. Does no auto-discovery.\n"],["patch!","LCS","LCS.html#method-i-patch-21","(patchset)","<p>Attempts to patch <code>self</code> with the provided <code>patchset</code>. A new sequence based on <code>self</code> and the <code>patchset</code> will …\n"],["patch_me","LCS","LCS.html#method-i-patch_me","(patchset)","<p>Attempts to patch <code>self</code> with the provided <code>patchset</code>, using #patch!. If the sequence this is used on supports …\n"],["positive?","Fixnum","Fixnum.html#method-i-positive-3F","()",""],["run","LCS::HTMLDiff","LCS/HTMLDiff.html#method-i-run","()",""],["sdiff","LCS","LCS.html#method-i-sdiff","(other, callbacks = nil, &block)","<p>Returns the balanced (“side-by-side”) difference set between <code>self</code> and <code>other</code>. See Diff::LCS#sdiff …\n"],["sdiff","LCS","LCS.html#method-c-sdiff","(seq1, seq2, callbacks = nil, &block)","<p>#sdiff computes all necessary components to show two sequences and their minimized differences side by …\n"],["simplify","LCS::ContextChange","LCS/ContextChange.html#method-c-simplify","(event)","<p>Simplifies a context change for use in some diff callbacks. &#39;&lt;&#39; actions are converted to &#39;-&#39; …\n"],["to_a","LCS::Change","LCS/Change.html#method-i-to_a","()",""],["to_a","LCS::ContextChange","LCS/ContextChange.html#method-i-to_a","()",""],["to_ary","LCS::Change","LCS/Change.html#method-i-to_ary","()",""],["to_ary","LCS::ContextChange","LCS/ContextChange.html#method-i-to_ary","()",""],["traverse_balanced","LCS","LCS.html#method-c-traverse_balanced","(seq1, seq2, callbacks = Diff::LCS::BalancedCallbacks)","<p>#traverse_balanced is an alternative to #traverse_sequences. It uses a different algorithm to iterate …\n"],["traverse_balanced","LCS","LCS.html#method-i-traverse_balanced","(other, callbacks = nil, &block)","<p>Traverses the discovered longest common subsequences between <code>self</code> and <code>other</code> using the alternate, balanced …\n"],["traverse_sequences","LCS","LCS.html#method-c-traverse_sequences","(seq1, seq2, callbacks = Diff::LCS::SequenceCallbacks)","<p>#traverse_sequences is the most general facility provided by this module; #diff and #lcs are implemented …\n"],["traverse_sequences","LCS","LCS.html#method-i-traverse_sequences","(other, callbacks = nil, &block)","<p>Traverses the discovered longest common subsequences between <code>self</code> and <code>other</code>. See Diff::LCS#traverse_sequences …\n"],["unchanged?","LCS::Change","LCS/Change.html#method-i-unchanged-3F","()",""],["unpatch","LCS","LCS.html#method-i-unpatch","(patchset)",""],["unpatch!","LCS","LCS.html#method-i-unpatch-21","(patchset)","<p>Attempts to unpatch <code>self</code> with the provided <code>patchset</code>. A new sequence based on <code>self</code> and the <code>patchset</code> will …\n"],["unpatch!","LCS","LCS.html#method-c-unpatch-21","(src, patchset)","<p>Given a set of patchset, convert the current version to the prior version. Does no auto-discovery.\n"],["unpatch_me","LCS","LCS.html#method-i-unpatch_me","(patchset)","<p>Attempts to unpatch <code>self</code> with the provided <code>patchset</code>, using #unpatch!. If the sequence this is used on …\n"],["unshift","LCS::Hunk","LCS/Hunk.html#method-i-unshift","(hunk)",""],["valid_action?","LCS::Change","LCS/Change.html#method-c-valid_action-3F","(action)",""],["Code-of-Conduct","","Code-of-Conduct_md.html","","<p>Contributor Covenant Code of Conduct\n<p>Our Pledge\n<p>In the interest of fostering an open and welcoming environment, …\n"],["Contributing","","Contributing_md.html","","<p>Contributing\n<p>I value any contribution to Diff::LCS you can provide: a bug report, a\nfeature request, or ...\n"],["History","","History_md.html","","<p>History\n<p>1.5.0 / 2021-12-23\n<p>Updated the CI configuration and monkey-patch Hoe.\n"],["License","","License_md.html","","<p>== License\n<p>This software is available under three licenses: the GNU GPL version 2 (or at\nyour option, ...\n"],["Manifest","","Manifest_txt.html","","<p>.rspec Code-of-Conduct.md Contributing.md History.md License.md Manifest.txt README.rdoc Rakefile bin/htmldiff …\n"],["README","","README_rdoc.html","","<p>Diff::LCS\n<p>home &mdash; github.com/halostatue/diff-lcs\n<p>code &mdash; github.com/halostatue/diff-lcs\n"],["COPYING","","docs/COPYING_txt.html","","\n<pre> GNU GENERAL PUBLIC LICENSE\n Version 2, June 1991\n\nCopyright (C) ...</pre>\n"],["artistic","","docs/artistic_txt.html","","<p>The “Artistic License”\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Preamble</span>\n</pre>\n<p>The intent of this document is to state the conditions under …\n"]]}} \ No newline at end of file
diff --git a/doc/js/search_index.js.gz b/doc/js/search_index.js.gz
new file mode 100644
index 0000000..227a624
--- /dev/null
+++ b/doc/js/search_index.js.gz
Binary files differ
diff --git a/doc/js/searcher.js b/doc/js/searcher.js
new file mode 100644
index 0000000..e200a16
--- /dev/null
+++ b/doc/js/searcher.js
@@ -0,0 +1,229 @@
+Searcher = function(data) {
+ this.data = data;
+ this.handlers = [];
+}
+
+Searcher.prototype = new function() {
+ // search is performed in chunks of 1000 for non-blocking user input
+ var CHUNK_SIZE = 1000;
+ // do not try to find more than 100 results
+ var MAX_RESULTS = 100;
+ var huid = 1;
+ var suid = 1;
+ var runs = 0;
+
+ this.find = function(query) {
+ var queries = splitQuery(query);
+ var regexps = buildRegexps(queries);
+ var highlighters = buildHilighters(queries);
+ var state = { from: 0, pass: 0, limit: MAX_RESULTS, n: suid++};
+ var _this = this;
+
+ this.currentSuid = state.n;
+
+ if (!query) return;
+
+ var run = function() {
+ // stop current search thread if new search started
+ if (state.n != _this.currentSuid) return;
+
+ var results =
+ performSearch(_this.data, regexps, queries, highlighters, state);
+ var hasMore = (state.limit > 0 && state.pass < 4);
+
+ triggerResults.call(_this, results, !hasMore);
+ if (hasMore) {
+ setTimeout(run, 2);
+ }
+ runs++;
+ };
+ runs = 0;
+
+ // start search thread
+ run();
+ }
+
+ /* ----- Events ------ */
+ this.ready = function(fn) {
+ fn.huid = huid;
+ this.handlers.push(fn);
+ }
+
+ /* ----- Utilities ------ */
+ function splitQuery(query) {
+ return query.split(/(\s+|::?|\(\)?)/).filter(function(string) {
+ return string.match(/\S/);
+ });
+ }
+
+ function buildRegexps(queries) {
+ return queries.map(function(query) {
+ return new RegExp(query.replace(/(.)/g, '([$1])([^$1]*?)'), 'i');
+ });
+ }
+
+ function buildHilighters(queries) {
+ return queries.map(function(query) {
+ return query.split('').map(function(l, i) {
+ return '\u0001$' + (i*2+1) + '\u0002$' + (i*2+2);
+ }).join('');
+ });
+ }
+
+ // function longMatchRegexp(index, longIndex, regexps) {
+ // for (var i = regexps.length - 1; i >= 0; i--){
+ // if (!index.match(regexps[i]) && !longIndex.match(regexps[i])) return false;
+ // };
+ // return true;
+ // }
+
+
+ /* ----- Mathchers ------ */
+
+ /*
+ * This record matches if the index starts with queries[0] and the record
+ * matches all of the regexps
+ */
+ function matchPassBeginning(index, longIndex, queries, regexps) {
+ if (index.indexOf(queries[0]) != 0) return false;
+ for (var i=1, l = regexps.length; i < l; i++) {
+ if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
+ return false;
+ };
+ return true;
+ }
+
+ /*
+ * This record matches if the longIndex starts with queries[0] and the
+ * longIndex matches all of the regexps
+ */
+ function matchPassLongIndex(index, longIndex, queries, regexps) {
+ if (longIndex.indexOf(queries[0]) != 0) return false;
+ for (var i=1, l = regexps.length; i < l; i++) {
+ if (!longIndex.match(regexps[i]))
+ return false;
+ };
+ return true;
+ }
+
+ /*
+ * This record matches if the index contains queries[0] and the record
+ * matches all of the regexps
+ */
+ function matchPassContains(index, longIndex, queries, regexps) {
+ if (index.indexOf(queries[0]) == -1) return false;
+ for (var i=1, l = regexps.length; i < l; i++) {
+ if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
+ return false;
+ };
+ return true;
+ }
+
+ /*
+ * This record matches if regexps[0] matches the index and the record
+ * matches all of the regexps
+ */
+ function matchPassRegexp(index, longIndex, queries, regexps) {
+ if (!index.match(regexps[0])) return false;
+ for (var i=1, l = regexps.length; i < l; i++) {
+ if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
+ return false;
+ };
+ return true;
+ }
+
+
+ /* ----- Highlighters ------ */
+ function highlightRegexp(info, queries, regexps, highlighters) {
+ var result = createResult(info);
+ for (var i=0, l = regexps.length; i < l; i++) {
+ result.title = result.title.replace(regexps[i], highlighters[i]);
+ result.namespace = result.namespace.replace(regexps[i], highlighters[i]);
+ };
+ return result;
+ }
+
+ function hltSubstring(string, pos, length) {
+ return string.substring(0, pos) + '\u0001' + string.substring(pos, pos + length) + '\u0002' + string.substring(pos + length);
+ }
+
+ function highlightQuery(info, queries, regexps, highlighters) {
+ var result = createResult(info);
+ var pos = 0;
+ var lcTitle = result.title.toLowerCase();
+
+ pos = lcTitle.indexOf(queries[0]);
+ if (pos != -1) {
+ result.title = hltSubstring(result.title, pos, queries[0].length);
+ }
+
+ result.namespace = result.namespace.replace(regexps[0], highlighters[0]);
+ for (var i=1, l = regexps.length; i < l; i++) {
+ result.title = result.title.replace(regexps[i], highlighters[i]);
+ result.namespace = result.namespace.replace(regexps[i], highlighters[i]);
+ };
+ return result;
+ }
+
+ function createResult(info) {
+ var result = {};
+ result.title = info[0];
+ result.namespace = info[1];
+ result.path = info[2];
+ result.params = info[3];
+ result.snippet = info[4];
+ result.badge = info[6];
+ return result;
+ }
+
+ /* ----- Searching ------ */
+ function performSearch(data, regexps, queries, highlighters, state) {
+ var searchIndex = data.searchIndex;
+ var longSearchIndex = data.longSearchIndex;
+ var info = data.info;
+ var result = [];
+ var i = state.from;
+ var l = searchIndex.length;
+ var togo = CHUNK_SIZE;
+ var matchFunc, hltFunc;
+
+ while (state.pass < 4 && state.limit > 0 && togo > 0) {
+ if (state.pass == 0) {
+ matchFunc = matchPassBeginning;
+ hltFunc = highlightQuery;
+ } else if (state.pass == 1) {
+ matchFunc = matchPassLongIndex;
+ hltFunc = highlightQuery;
+ } else if (state.pass == 2) {
+ matchFunc = matchPassContains;
+ hltFunc = highlightQuery;
+ } else if (state.pass == 3) {
+ matchFunc = matchPassRegexp;
+ hltFunc = highlightRegexp;
+ }
+
+ for (; togo > 0 && i < l && state.limit > 0; i++, togo--) {
+ if (info[i].n == state.n) continue;
+ if (matchFunc(searchIndex[i], longSearchIndex[i], queries, regexps)) {
+ info[i].n = state.n;
+ result.push(hltFunc(info[i], queries, regexps, highlighters));
+ state.limit--;
+ }
+ };
+ if (searchIndex.length <= i) {
+ state.pass++;
+ i = state.from = 0;
+ } else {
+ state.from = i;
+ }
+ }
+ return result;
+ }
+
+ function triggerResults(results, isLast) {
+ this.handlers.forEach(function(fn) {
+ fn.call(this, results, isLast)
+ });
+ }
+}
+
diff --git a/doc/js/searcher.js.gz b/doc/js/searcher.js.gz
new file mode 100644
index 0000000..04e4b07
--- /dev/null
+++ b/doc/js/searcher.js.gz
Binary files differ
diff --git a/doc/table_of_contents.html b/doc/table_of_contents.html
new file mode 100644
index 0000000..5d54005
--- /dev/null
+++ b/doc/table_of_contents.html
@@ -0,0 +1,717 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<meta charset="UTF-8">
+
+<title>Table of Contents - diff-lcs-1.5.0 Documentation</title>
+
+<script type="text/javascript">
+ var rdoc_rel_prefix = "./";
+ var index_rel_prefix = "./";
+</script>
+
+<script src="./js/navigation.js" defer></script>
+<script src="./js/search.js" defer></script>
+<script src="./js/search_index.js" defer></script>
+<script src="./js/searcher.js" defer></script>
+<script src="./js/darkfish.js" defer></script>
+
+<link href="./css/fonts.css" rel="stylesheet">
+<link href="./css/rdoc.css" rel="stylesheet">
+
+
+<body id="top" class="table-of-contents">
+<main role="main">
+<h1 class="class">Table of Contents - diff-lcs-1.5.0 Documentation</h1>
+
+<h2 id="pages">Pages</h2>
+<ul>
+ <li class="file">
+ <a href="Code-of-Conduct_md.html">Code-of-Conduct</a>
+
+ <ul>
+ <li><a href="Code-of-Conduct_md.html#label-Contributor+Covenant+Code+of+Conduct">Contributor Covenant Code of Conduct</a>
+ <li><a href="Code-of-Conduct_md.html#label-Our+Pledge">Our Pledge</a>
+ <li><a href="Code-of-Conduct_md.html#label-Our+Standards">Our Standards</a>
+ <li><a href="Code-of-Conduct_md.html#label-Our+Responsibilities">Our Responsibilities</a>
+ <li><a href="Code-of-Conduct_md.html#label-Scope">Scope</a>
+ <li><a href="Code-of-Conduct_md.html#label-Enforcement">Enforcement</a>
+ <li><a href="Code-of-Conduct_md.html#label-Attribution">Attribution</a>
+ </ul>
+ </li>
+ <li class="file">
+ <a href="Contributing_md.html">Contributing</a>
+
+ <ul>
+ <li><a href="Contributing_md.html#label-Contributing">Contributing</a>
+ <li><a href="Contributing_md.html#label-Test+Dependencies">Test Dependencies</a>
+ <li><a href="Contributing_md.html#label-Workflow">Workflow</a>
+ <li><a href="Contributing_md.html#label-Contributors">Contributors</a>
+ </ul>
+ </li>
+ <li class="file">
+ <a href="History_md.html">History</a>
+
+ <ul>
+ <li><a href="History_md.html#label-History">History</a>
+ <li><a href="History_md.html#label-1.5.0+-2F+2021-12-23">1.5.0 / 2021-12-23</a>
+ <li><a href="History_md.html#label-1.4.4+-2F+2020-07-01">1.4.4 / 2020-07-01</a>
+ <li><a href="History_md.html#label-1.4.3+-2F+2020-06-29">1.4.3 / 2020-06-29</a>
+ <li><a href="History_md.html#label-1.4.2+-2F+2020-06-23">1.4.2 / 2020-06-23</a>
+ <li><a href="History_md.html#label-1.4.1+-2F+2020-06-23">1.4.1 / 2020-06-23</a>
+ <li><a href="History_md.html#label-1.4+-2F+2020-06-23">1.4 / 2020-06-23</a>
+ <li><a href="History_md.html#label-1.3+-2F+2017-01-18">1.3 / 2017-01-18</a>
+ <li><a href="History_md.html#label-1.2.5+-2F+2013-11-08">1.2.5 / 2013-11-08</a>
+ <li><a href="History_md.html#label-1.2.4+-2F+2013-04-20">1.2.4 / 2013-04-20</a>
+ <li><a href="History_md.html#label-1.2.3+-2F+2013-04-11">1.2.3 / 2013-04-11</a>
+ <li><a href="History_md.html#label-1.2.2+-2F+2013-03-30">1.2.2 / 2013-03-30</a>
+ <li><a href="History_md.html#label-1.2.1+-2F+2013-02-09">1.2.1 / 2013-02-09</a>
+ <li><a href="History_md.html#label-1.2.0+-2F+2013-01-21">1.2.0 / 2013-01-21</a>
+ <li><a href="History_md.html#label-unpatch-21+where+they+implied+that+they+would+replace+the+original+value.">unpatch! where they implied that they would replace the original value.</a>
+ <li><a href="History_md.html#label-1.1.3+-2F+2011-08-27">1.1.3 / 2011-08-27</a>
+ <li><a href="History_md.html#label-1.1.2+-2F+2004-10-20">1.1.2 / 2004-10-20</a>
+ <li><a href="History_md.html#label-1.1.1+-2F+2004-09-25">1.1.1 / 2004-09-25</a>
+ <li><a href="History_md.html#label-1.1.0">1.1.0</a>
+ <li><a href="History_md.html#label-1.0.4">1.0.4</a>
+ <li><a href="History_md.html#label-1.0.3">1.0.3</a>
+ <li><a href="History_md.html#label-1.0.2">1.0.2</a>
+ <li><a href="History_md.html#label-1.0.1">1.0.1</a>
+ <li><a href="History_md.html#label-1.0">1.0</a>
+ </ul>
+ </li>
+ <li class="file">
+ <a href="License_md.html">License</a>
+ </li>
+ <li class="file">
+ <a href="Manifest_txt.html">Manifest</a>
+ </li>
+ <li class="file">
+ <a href="README_rdoc.html">README</a>
+
+ <ul>
+ <li><a href="README_rdoc.html#label-Diff-3A-3ALCS">Diff::LCS</a>
+ <li><a href="README_rdoc.html#label-Description">Description</a>
+ <li><a href="README_rdoc.html#label-Synopsis">Synopsis</a>
+ <li><a href="README_rdoc.html#label-History">History</a>
+ </ul>
+ </li>
+ <li class="file">
+ <a href="docs/COPYING_txt.html">COPYING</a>
+ </li>
+ <li class="file">
+ <a href="docs/artistic_txt.html">artistic</a>
+ </li>
+</ul>
+
+<h2 id="classes">Classes and Modules</h2>
+<ul>
+ <li class="class">
+ <a href="Array.html">Array</a>
+ </li>
+ <li class="module">
+ <a href="Diff.html">Diff</a>
+ </li>
+ <li class="module">
+ <a href="Diff/LCS/Internals.html">Diff::LCS::Internals</a>
+ </li>
+ <li class="module">
+ <a href="Diff/LCS/Ldiff.html">Diff::LCS::Ldiff</a>
+ </li>
+ <li class="class">
+ <a href="Fixnum.html">Fixnum</a>
+ </li>
+ <li class="module">
+ <a href="LCS.html">LCS</a>
+
+ <ul>
+ <li><a href="LCS.html#label-How+Diff+Works+-28by+Mark-Jason+Dominus-29">How Diff Works (by Mark-Jason Dominus)</a>
+ </ul>
+ </li>
+ <li class="module">
+ <a href="LCS.html">LCS</a>
+
+ <ul>
+ <li><a href="LCS.html#label-How+Diff+Works+-28by+Mark-Jason+Dominus-29">How Diff Works (by Mark-Jason Dominus)</a>
+ </ul>
+ </li>
+ <li class="class">
+ <a href="LCS/DefaultCallbacks.html">LCS::BalancedCallbacks</a>
+ </li>
+ <li class="class">
+ <a href="LCS/Block.html">LCS::Block</a>
+ </li>
+ <li class="class">
+ <a href="LCS/Change.html">LCS::Change</a>
+ </li>
+ <li class="class">
+ <a href="LCS/ContextChange.html">LCS::ContextChange</a>
+ </li>
+ <li class="class">
+ <a href="LCS/ContextDiffCallbacks.html">LCS::ContextDiffCallbacks</a>
+
+ <ul>
+ <li><a href="LCS/ContextDiffCallbacks.html#label-Use">Use</a>
+ <li><a href="LCS/ContextDiffCallbacks.html#label-Simplified+Array+Format">Simplified Array Format</a>
+ </ul>
+ </li>
+ <li class="class">
+ <a href="LCS/DefaultCallbacks.html">LCS::DefaultCallbacks</a>
+ </li>
+ <li class="class">
+ <a href="LCS/DiffCallbacks.html">LCS::DiffCallbacks</a>
+
+ <ul>
+ <li><a href="LCS/DiffCallbacks.html#label-Use">Use</a>
+ <li><a href="LCS/DiffCallbacks.html#label-Simplified+Array+Format">Simplified Array Format</a>
+ </ul>
+ </li>
+ <li class="class">
+ <a href="LCS/HTMLDiff.html">LCS::HTMLDiff</a>
+ </li>
+ <li class="class">
+ <a href="LCS/Hunk.html">LCS::Hunk</a>
+ </li>
+ <li class="class">
+ <a href="LCS/SDiffCallbacks.html">LCS::SDiffCallbacks</a>
+
+ <ul>
+ <li><a href="LCS/SDiffCallbacks.html#label-Use">Use</a>
+ <li><a href="LCS/SDiffCallbacks.html#label-Simplified+Array+Format">Simplified Array Format</a>
+ </ul>
+ </li>
+ <li class="class">
+ <a href="LCS/DefaultCallbacks.html">LCS::SequenceCallbacks</a>
+ </li>
+ <li class="class">
+ <a href="String.html">String</a>
+ </li>
+</ul>
+
+<h2 id="methods">Methods</h2>
+<ul>
+
+ <li class="method">
+ <a href="LCS.html#method-c-LCS">::LCS</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-LCS">::LCS</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="Diff/LCS/Internals.html#method-c-analyze_patchset">::analyze_patchset</a>
+ &mdash;
+ <span class="container">Diff::LCS::Internals</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-callbacks_for">::callbacks_for</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-callbacks_for">::callbacks_for</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS/DefaultCallbacks.html#method-c-change">::change</a>
+ &mdash;
+ <span class="container">LCS::DefaultCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/DefaultCallbacks.html#method-c-change">::change</a>
+ &mdash;
+ <span class="container">LCS::DefaultCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/DefaultCallbacks.html#method-c-change">::change</a>
+ &mdash;
+ <span class="container">LCS::DefaultCallbacks</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-diff">::diff</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-diff">::diff</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS/DefaultCallbacks.html#method-c-discard_a">::discard_a</a>
+ &mdash;
+ <span class="container">LCS::DefaultCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/DefaultCallbacks.html#method-c-discard_a">::discard_a</a>
+ &mdash;
+ <span class="container">LCS::DefaultCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/DefaultCallbacks.html#method-c-discard_a">::discard_a</a>
+ &mdash;
+ <span class="container">LCS::DefaultCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/DefaultCallbacks.html#method-c-discard_b">::discard_b</a>
+ &mdash;
+ <span class="container">LCS::DefaultCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/DefaultCallbacks.html#method-c-discard_b">::discard_b</a>
+ &mdash;
+ <span class="container">LCS::DefaultCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/DefaultCallbacks.html#method-c-discard_b">::discard_b</a>
+ &mdash;
+ <span class="container">LCS::DefaultCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/ContextChange.html#method-c-from_a">::from_a</a>
+ &mdash;
+ <span class="container">LCS::ContextChange</span>
+
+ <li class="method">
+ <a href="LCS/Change.html#method-c-from_a">::from_a</a>
+ &mdash;
+ <span class="container">LCS::Change</span>
+
+ <li class="method">
+ <a href="Diff/LCS/Internals.html#method-c-intuit_diff_direction">::intuit_diff_direction</a>
+ &mdash;
+ <span class="container">Diff::LCS::Internals</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-lcs">::lcs</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="Diff/LCS/Internals.html#method-c-lcs">::lcs</a>
+ &mdash;
+ <span class="container">Diff::LCS::Internals</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-lcs">::lcs</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS/DefaultCallbacks.html#method-c-match">::match</a>
+ &mdash;
+ <span class="container">LCS::DefaultCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/DefaultCallbacks.html#method-c-match">::match</a>
+ &mdash;
+ <span class="container">LCS::DefaultCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/DefaultCallbacks.html#method-c-match">::match</a>
+ &mdash;
+ <span class="container">LCS::DefaultCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/SDiffCallbacks.html#method-c-new">::new</a>
+ &mdash;
+ <span class="container">LCS::SDiffCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/Block.html#method-c-new">::new</a>
+ &mdash;
+ <span class="container">LCS::Block</span>
+
+ <li class="method">
+ <a href="LCS/DiffCallbacks.html#method-c-new">::new</a>
+ &mdash;
+ <span class="container">LCS::DiffCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/Change.html#method-c-new">::new</a>
+ &mdash;
+ <span class="container">LCS::Change</span>
+
+ <li class="method">
+ <a href="LCS/ContextChange.html#method-c-new">::new</a>
+ &mdash;
+ <span class="container">LCS::ContextChange</span>
+
+ <li class="method">
+ <a href="LCS/HTMLDiff.html#method-c-new">::new</a>
+ &mdash;
+ <span class="container">LCS::HTMLDiff</span>
+
+ <li class="method">
+ <a href="LCS/Hunk.html#method-c-new">::new</a>
+ &mdash;
+ <span class="container">LCS::Hunk</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-patch">::patch</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-patch">::patch</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-patch-21">::patch!</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-patch-21">::patch!</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-sdiff">::sdiff</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-sdiff">::sdiff</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS/ContextChange.html#method-c-simplify">::simplify</a>
+ &mdash;
+ <span class="container">LCS::ContextChange</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-traverse_balanced">::traverse_balanced</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-traverse_balanced">::traverse_balanced</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-traverse_sequences">::traverse_sequences</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-traverse_sequences">::traverse_sequences</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-unpatch-21">::unpatch!</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-c-unpatch-21">::unpatch!</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS/Change.html#method-c-valid_action-3F">::valid_action?</a>
+ &mdash;
+ <span class="container">LCS::Change</span>
+
+ <li class="method">
+ <a href="LCS/ContextChange.html#method-i-3C-3D-3E">#&lt;=&gt;</a>
+ &mdash;
+ <span class="container">LCS::ContextChange</span>
+
+ <li class="method">
+ <a href="LCS/Change.html#method-i-3C-3D-3E">#&lt;=&gt;</a>
+ &mdash;
+ <span class="container">LCS::Change</span>
+
+ <li class="method">
+ <a href="LCS/ContextChange.html#method-i-3D-3D">#==</a>
+ &mdash;
+ <span class="container">LCS::ContextChange</span>
+
+ <li class="method">
+ <a href="LCS/Change.html#method-i-3D-3D">#==</a>
+ &mdash;
+ <span class="container">LCS::Change</span>
+
+ <li class="method">
+ <a href="LCS/Change.html#method-i-adding-3F">#adding?</a>
+ &mdash;
+ <span class="container">LCS::Change</span>
+
+ <li class="method">
+ <a href="LCS/SDiffCallbacks.html#method-i-change">#change</a>
+ &mdash;
+ <span class="container">LCS::SDiffCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/ContextDiffCallbacks.html#method-i-change">#change</a>
+ &mdash;
+ <span class="container">LCS::ContextDiffCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/Change.html#method-i-changed-3F">#changed?</a>
+ &mdash;
+ <span class="container">LCS::Change</span>
+
+ <li class="method">
+ <a href="LCS/Change.html#method-i-deleting-3F">#deleting?</a>
+ &mdash;
+ <span class="container">LCS::Change</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-diff">#diff</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS/Hunk.html#method-i-diff">#diff</a>
+ &mdash;
+ <span class="container">LCS::Hunk</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-diff">#diff</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS/Block.html#method-i-diff_size">#diff_size</a>
+ &mdash;
+ <span class="container">LCS::Block</span>
+
+ <li class="method">
+ <a href="LCS/SDiffCallbacks.html#method-i-discard_a">#discard_a</a>
+ &mdash;
+ <span class="container">LCS::SDiffCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/DiffCallbacks.html#method-i-discard_a">#discard_a</a>
+ &mdash;
+ <span class="container">LCS::DiffCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/ContextDiffCallbacks.html#method-i-discard_a">#discard_a</a>
+ &mdash;
+ <span class="container">LCS::ContextDiffCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/DiffCallbacks.html#method-i-discard_b">#discard_b</a>
+ &mdash;
+ <span class="container">LCS::DiffCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/SDiffCallbacks.html#method-i-discard_b">#discard_b</a>
+ &mdash;
+ <span class="container">LCS::SDiffCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/ContextDiffCallbacks.html#method-i-discard_b">#discard_b</a>
+ &mdash;
+ <span class="container">LCS::ContextDiffCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/DiffCallbacks.html#method-i-finish">#finish</a>
+ &mdash;
+ <span class="container">LCS::DiffCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/Change.html#method-i-finished_a-3F">#finished_a?</a>
+ &mdash;
+ <span class="container">LCS::Change</span>
+
+ <li class="method">
+ <a href="LCS/Change.html#method-i-finished_b-3F">#finished_b?</a>
+ &mdash;
+ <span class="container">LCS::Change</span>
+
+ <li class="method">
+ <a href="LCS/Change.html#method-i-inspect">#inspect</a>
+ &mdash;
+ <span class="container">LCS::Change</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-lcs">#lcs</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-lcs">#lcs</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS/DiffCallbacks.html#method-i-match">#match</a>
+ &mdash;
+ <span class="container">LCS::DiffCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/SDiffCallbacks.html#method-i-match">#match</a>
+ &mdash;
+ <span class="container">LCS::SDiffCallbacks</span>
+
+ <li class="method">
+ <a href="LCS/Hunk.html#method-i-merge">#merge</a>
+ &mdash;
+ <span class="container">LCS::Hunk</span>
+
+ <li class="method">
+ <a href="LCS/Hunk.html#method-i-missing_last_newline-3F">#missing_last_newline?</a>
+ &mdash;
+ <span class="container">LCS::Hunk</span>
+
+ <li class="method">
+ <a href="LCS/Block.html#method-i-op">#op</a>
+ &mdash;
+ <span class="container">LCS::Block</span>
+
+ <li class="method">
+ <a href="LCS/Hunk.html#method-i-overlaps-3F">#overlaps?</a>
+ &mdash;
+ <span class="container">LCS::Hunk</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-patch">#patch</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-patch">#patch</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-patch-21">#patch!</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-patch-21">#patch!</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-patch_me">#patch_me</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-patch_me">#patch_me</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="Fixnum.html#method-i-positive-3F">#positive?</a>
+ &mdash;
+ <span class="container">Fixnum</span>
+
+ <li class="method">
+ <a href="LCS/HTMLDiff.html#method-i-run">#run</a>
+ &mdash;
+ <span class="container">LCS::HTMLDiff</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-sdiff">#sdiff</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-sdiff">#sdiff</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS/Change.html#method-i-to_a">#to_a</a>
+ &mdash;
+ <span class="container">LCS::Change</span>
+
+ <li class="method">
+ <a href="LCS/ContextChange.html#method-i-to_a">#to_a</a>
+ &mdash;
+ <span class="container">LCS::ContextChange</span>
+
+ <li class="method">
+ <a href="LCS/Change.html#method-i-to_ary">#to_ary</a>
+ &mdash;
+ <span class="container">LCS::Change</span>
+
+ <li class="method">
+ <a href="LCS/ContextChange.html#method-i-to_ary">#to_ary</a>
+ &mdash;
+ <span class="container">LCS::ContextChange</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-traverse_balanced">#traverse_balanced</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-traverse_balanced">#traverse_balanced</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-traverse_sequences">#traverse_sequences</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-traverse_sequences">#traverse_sequences</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS/Change.html#method-i-unchanged-3F">#unchanged?</a>
+ &mdash;
+ <span class="container">LCS::Change</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-unpatch">#unpatch</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-unpatch">#unpatch</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-unpatch-21">#unpatch!</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-unpatch-21">#unpatch!</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-unpatch_me">#unpatch_me</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS.html#method-i-unpatch_me">#unpatch_me</a>
+ &mdash;
+ <span class="container">LCS</span>
+
+ <li class="method">
+ <a href="LCS/Hunk.html#method-i-unshift">#unshift</a>
+ &mdash;
+ <span class="container">LCS::Hunk</span>
+</ul>
+</main>
+
+
+<footer id="validator-badges" role="contentinfo">
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
+</footer>
+
diff --git a/index.html b/index.html
deleted file mode 100644
index 2244c3e..0000000
--- a/index.html
+++ /dev/null
@@ -1,84 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset='utf-8'>
-
- <title>halostatue/diff-lcs @ GitHub</title>
-
- <style type="text/css">
- body {
- margin-top: 1.0em;
- background-color: #242438;
- font-family: Helvetica, Arial, FreeSans, san-serif;
- color: #777;
- }
- #container {
- margin: 0 auto;
- width: 700px;
- }
- h1 { font-size: 3.8em; color: #999; margin-bottom: 3px; }
- h1 .small { font-size: 0.4em; }
- h1 a { text-decoration: none }
- h2 { font-size: 1.5em; color: #999; }
- h3 { text-align: center; color: #999; }
- a { color: #999; }
- .description { font-size: 1.2em; margin-bottom: 30px; margin-top: 30px; font-style: italic;}
- .download { float: right; }
- pre { background: #000; color: #fff; padding: 15px;}
- hr { border: 0; width: 80%; border-bottom: 1px solid #aaa}
- .footer { text-align:center; padding-top:30px; font-style: italic; }
- </style>
-</head>
-
-<body>
- <a href="http://github.com/halostatue/diff-lcs"><img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
-
- <div id="container">
-
- <div class="download">
- <a href="http://github.com/halostatue/diff-lcs/zipball/master">
- <img border="0" width="90" src="http://github.com/images/modules/download/zip.png"></a>
- <a href="http://github.com/halostatue/diff-lcs/tarball/master">
- <img border="0" width="90" src="http://github.com/images/modules/download/tar.png"></a>
- </div>
-
- <h1><a href="http://github.com/halostatue/diff-lcs">Diff::LCS</a><br />
- <span class="small">by <a href="http://github.com/halostatue">Austin Ziegler (halostatue)</a></span></h1>
-
- <div class="description">
- Generate difference sets between Ruby sequences.
- </div>
-
- <p>Diff::LCS is a port of Perl's Algorithm::Diff that uses the McIlroy-Hunt
-longest common subsequence (LCS) algorithm to compute intelligent differences between two sequenced enumerable containers. This implementation is based on Mario I. Wolczko's <a href="ftp://st.cs.uiuc.edu/pub/Smalltalk/MANCHESTER/manchester/4.0/diff.st">Smalltalk version 1.2</a> (1993) and Ned Konz's Perl version <a href="http://search.cpan.org/~nedkonz/Algorithm-Diff-1.15/">Algorithm::Diff 1.15</a>.</p><h2>Dependencies</h2>
-<p>None.</p>
-<h2>Install</h2>
-<p>gem install diff-lcs</p>
-<h2>License</h2>
-<p>This software is available under three licenses: the GNU GPL version 2 (or at your option, a later version), the Perl Artistic license, or the MIT license. Note that my preference for licensing is the MIT license, but Algorithm::Diff was dually originally licensed with the Perl Artistic and the GNU GPL ("the same terms as Perl itself") and that the Ruby implementation hews pretty closely to the Perl version, so I must maintain the additional licensing terms.</p>
-<h2>Authors</h2>
-<p>Austin Ziegler (austin@rubyforge.org)</p>
-<h2>Contact</h2>
-<p>Austin Ziegler (austin@rubyforge.org)</p>
-
-
- <h2>Download</h2>
- <p>
- You can download this project in either
- <a href="http://github.com/halostatue/diff-lcs/zipball/master">zip</a> or
- <a href="http://github.com/halostatue/diff-lcs/tarball/master">tar</a> formats.
- </p>
- <p>You can also clone the project with <a href="http://git-scm.com">Git</a>
- by running:
- <pre>$ git clone git://github.com/halostatue/diff-lcs</pre>
- </p>
-
- <div class="footer">
- get the source code on GitHub : <a href="http://github.com/halostatue/diff-lcs">halostatue/diff-lcs</a>
- </div>
-
- </div>
-
-
-</body>
-</html>