Skip to content

Commit

Permalink
Changing to hoe for support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Austin Ziegler committed Jul 31, 2011
1 parent 9feacf8 commit 743cff6
Show file tree
Hide file tree
Showing 11 changed files with 795 additions and 460 deletions.
13 changes: 13 additions & 0 deletions .gitignore
@@ -0,0 +1,13 @@
spec/ldap.yml
.rvmrc
pkg/
*.swp
*.pyc
html/
doc/
publish/
coverage/
coverage.info
.rake_tasks~
.DS_Store
website/index.html
20 changes: 10 additions & 10 deletions ChangeLog → History.rdoc
@@ -1,11 +1,11 @@
Revision history for Ruby library Diff::LCS. Unless explicitly noted otherwise,
all changes are produced by Austin Ziegler <diff-lcs@halostatue.ca>.
== 1.1.3 / 2011-07-30
* Bugs fixed:

== Diff::LCS 1.1.2
== 1.1.2 / 2004-10-20
* Fixed a problem reported by Mauricio Fernandez in htmldiff. Future versions
of Diff::LCS will be removing this program.

== Diff::LCS 1.1.1
== 1.1.1 / 2004-09-25
* Fixed bug #891:
http://rubyforge.org/tracker/?func=detail&atid=407&aid=891&group_id=84
* Fixed a problem with callback initialisation code (it assumed that all
Expand All @@ -14,33 +14,33 @@ all changes are produced by Austin Ziegler <diff-lcs@halostatue.ca>.
* Modified the non-initialisable callbacks to have a private #new method.
* Moved ldiff core code to Diff::LCS::Ldiff (diff/lcs/ldiff.rb).

== Diff::LCS 1.1.0
== 1.1.0 / -
* Eliminated the need for Diff::LCS::Event and removed it.
* Added a contextual diff callback, Diff::LCS::ContextDiffCallback.
* Implemented patching/unpatching for standard Diff callback output formats
with both #diff and #sdiff.
* Extensive documentation changes.

== Diff::LCS 1.0.4
== 1.0.4 / -
* Fixed a problem with bin/ldiff output, especially for unified format.
Newlines that should have been present weren't.
* Changed the .tar.gz installer to generate Windows batch files if ones do not
exist already. Removed the existing batch files as they didn't work.

== Diff::LCS 1.0.3
== 1.0.3 / -
* Fixed a problem with #traverse_sequences where the first difference from the
left sequence might not be appropriately captured.

== Diff::LCS 1.0.2
== 1.0.2 / -
* Fixed an issue with ldiff not working because actions were changed from
symbols to strings.

== Diff::LCS 1.0.1
== 1.0.1 / -
* Minor modifications to the gemspec, the README.
* Renamed the diff program to ldiff (as well as the companion batch file) so as
to not collide with the standard diff program.
* Fixed issues with RubyGEMs. Requires RubyGems > 0.6.1 or >= 0.6.1 with the
latest CVS version.

== Diff::LCS 1.0
== 1.0 / -
* Initial release based mostly on Perl's Algorithm::Diff.
6 changes: 0 additions & 6 deletions Install

This file was deleted.

38 changes: 38 additions & 0 deletions License.rdoc
@@ -0,0 +1,38 @@
== License

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 and that
the Ruby implementation hews pretty closely to the Perl version, so I must
maintain the additional licensing terms.

* Copyright 2004–2011 Austin Ziegler.
* Adapted from Algorithm::Diff (Perl) by Ned Konz and a Smalltalk versionby
Mario I. Wolczko <mario@wolczko.com>

=== MIT License

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:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

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.

=== Perl Artistic License (version 2)
See the file docs/artistic.txt in the main distribution.

=== GNU GPL version 2
See the file docs/COPYING.txt in the main distribution.
18 changes: 18 additions & 0 deletions Manifest.txt
@@ -0,0 +1,18 @@
History.rdoc
License.rdoc
README.rdoc
Rakefile
bin/htmldiff
bin/ldiff
diff-lcs.gemspec
docs/COPYING.txt
docs/artistic.html
lib/diff/lcs.rb
lib/diff/lcs/array.rb
lib/diff/lcs/block.rb
lib/diff/lcs/callbacks.rb
lib/diff/lcs/change.rb
lib/diff/lcs/hunk.rb
lib/diff/lcs/ldiff.rb
lib/diff/lcs/string.rb
tests/00test.rb
76 changes: 0 additions & 76 deletions README

This file was deleted.

72 changes: 72 additions & 0 deletions README.rdoc
@@ -0,0 +1,72 @@
= diff-lcs

== Description
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. The implementation is based on
Mario I. Wolczko's {Smalltalk version 1.2}[ftp://st.cs.uiuc.edu/pub/Smalltalk/MANCHESTER/manchester/4.0/diff.st]
(1993) and Ned Konz's Perl version
{Algorithm::Diff}[http://search.cpan.org/~nedkonz/Algorithm-Diff-1.15/].

This is release 1.1.3, fixing several small bugs found over the years. Version
1.1.0 added new features, including the ability to #patch and #unpatch changes
as well as a new contextual diff callback, Diff::LCS::ContextDiffCallbacks,
that should improve the context sensitivity of patching.

This library is called Diff::LCS because of an early version of Algorithm::Diff
which was restrictively licensed. This version has seen a minor license change:
instead of being under Ruby's license as an option, the third optional license
is the MIT license.

== Where

* {GitHub}[https://github.com/halostatue/diff-lcs]

This is the new home of Diff::LCS (diff-lcs). The Ruwiki page still refers to
it, but development is not happening there any longer.

== Synopsis

Using this module is quite simple. By default, Diff::LCS does not extend
objects with the Diff::LCS interface, but will be called as if it were a
function:

require 'diff/lcs'

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)

lcs = Diff::LCS.LCS(seq1, seq2)
diffs = Diff::LCS.diff(seq1, seq2)
sdiff = Diff::LCS.sdiff(seq1, seq2)
seq = Diff::LCS.traverse_sequences(seq1, seq2, callback_obj)
bal = Diff::LCS.traverse_balanced(seq1, seq2, callback_obj)
seq2 == Diff::LCS.patch!(seq1, diffs)
seq1 == Diff::LCS.unpatch!(seq2, diffs)
seq2 == Diff::LCS.patch!(seq1, sdiff)
seq1 == Diff::LCS.unpatch!(seq2, sdiff)

Objects can be extended with Diff::LCS:

seq1.extend(Diff::LCS)
lcs = seq1.lcs(seq2)
diffs = seq1.diff(seq2)
sdiff = seq1.sdiff(seq2)
seq = seq1.traverse_sequences(seq2, callback_obj)
bal = seq1.traverse_balanced(seq2, callback_obj)
seq2 == seq1.patch!(diffs)
seq1 == seq2.unpatch!(diffs)
seq2 == seq1.patch!(sdiff)
seq1 == seq2.unpatch!(sdiff)

By requiring 'diff/lcs/array' or 'diff/lcs/string', Array or String will be
extended for use this way.

Note that Diff::LCS 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 unordereded
hash, it will only be meaningful if the enumeration of the hashes is
consistent. In general, this will mean that containers that behave like String
or Array will perform best.

:include: License.rdoc

0 comments on commit 743cff6

Please sign in to comment.