Skip to content

Commit

Permalink
diff-lcs 1.3 release candidate 1
Browse files Browse the repository at this point in the history
- Updated testing and gem infrastructure.
- Cleaning up documentation.
- Modernizing specs.
- Silence Ruby 2.4 Fixnum deprecation warnings. Fixes #36, #38.
- Ensure test dependencies are loaded. Fixes #33, #34 so that specs can be run
  independently.
- Fix issue #1 with incorrect intuition of patch direction. Tentative fix, but
  the failure cases pass now.
  • Loading branch information
halostatue committed Jan 11, 2017
1 parent 32727d6 commit f82593e
Show file tree
Hide file tree
Showing 26 changed files with 631 additions and 516 deletions.
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
Gemfile.lock
spec/ldap.yml
.rvmrc
pkg/
*.pyc
*.rbc
*.swp
*~
.DS_Store
.rake_tasks~
.rvmrc
.source_index
Gemfile.lock
coverage.info
coverage.vim
coverage/
doc/
html/
pkg/
publish/
research/
spec/ldap.yml
website/index.html
pkg/
publish/
.byebug_history
45 changes: 44 additions & 1 deletion .hoerc
Original file line number Diff line number Diff line change
@@ -1,2 +1,45 @@
---
exclude: !ruby/regexp /(tmp|swp)$|CVS|TAGS|\.(svn|git|hg|DS_Store|idea)|Gemfile\.lock|research\/|\.gemspec$/
exclude: !ruby/regexp '/
\.(?:
tmp |
swp
)$
|
\.(?:
autotest |
byebug_history |
gemtest |
gitignore |
hoerc |
minitest.rb |
simplecov-prelude.rb)$
|
\.(?:
coveralls |
pullreview |
travis |
appveyor
)\.yml$
|
(?i:TAGS)$
|
\.(?:
DS_Store|
bundle|
git|
hg|
idea|
svn|
vagrant
)\/
|
[gG]emfile(?:\.lock)?
|
support\/
|
research\/
|
\.gemspec$
|
Vagrantfile
/x'
1 change: 0 additions & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
--colour
--format documentation
33 changes: 15 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
---
language: ruby
rvm:
- 2.1.0
- 2.4.0
- 2.3.3
- 2.2.6
- 2.1.9
- 2.0.0
- 1.9.3
- 1.9.2
- ruby-head
- jruby-19mode
- jruby-head
- rbx
- 1.8.7
- jruby-18mode
- ree
- ruby-head
- jruby-19mode
matrix:
allow_failures:
- rvm: rbx
- rvm: ruby-head
- rvm: 1.8.7
- rvm: ree
gemfile:
- Gemfile
before_script:
- |
case "${TRAVIS_RUBY_VERSION}" in
rbx*)
gem install psych
gem install -v '~> 2.0' rubysl
;;
esac
- rake travis:before -t
script: rake travis
- bundle exec rake travis:before -t
script: bundle exec rake travis
after_script:
- rake travis:after -t
- bundle exec rake travis:after -t
notifications:
email:
recipients:
- austin@rubyforge.org
on_success: change
on_failure: always
sudo: false
2 changes: 2 additions & 0 deletions Contributing.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ Thanks to everyone else who has contributed to Diff::LCS:
* Michael Granger
* Vít Ondruch
* Jon Rowe
* Koichi Ito
* Josef Strzibny
23 changes: 11 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# -*- ruby -*-

# DO NOT EDIT THIS FILE. Instead, edit Rakefile, and run `rake bundler:gemfile`.
# NOTE: This file is present to keep Travis CI happy. Edits to it will not
# be accepted.

source "https://rubygems.org/"

if RUBY_VERSION < '1.9'
gem 'rdoc', '< 4.0'
elsif RUBY_VERSION >= '2.0'
if RUBY_ENGINE == 'ruby'
gem 'simplecov', '~> 0.7'
gem 'coveralls', '~> 0.7'
end
end

gem "rubyforge", ">=2.0.4", :group => [:development, :test]
gem "rdoc", "~>4.0", :group => [:development, :test]
gem "hoe-bundler", "~>1.2", :group => [:development, :test]
gem "hoe-doofus", "~>1.0", :group => [:development, :test]
gem "hoe-gemspec2", "~>1.1", :group => [:development, :test]
gem "hoe-git", "~>1.5", :group => [:development, :test]
gem "hoe-rubygems", "~>1.0", :group => [:development, :test]
gem "hoe-travis", "~>1.2", :group => [:development, :test]
gem "rake", "~>10.0", :group => [:development, :test]
gem "rspec", "~>2.0", :group => [:development, :test]
gem "hoe", "~>3.7", :group => [:development, :test]
gemspec

# vim: syntax=ruby
4 changes: 2 additions & 2 deletions History.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@
* Fixed a problem reported by Mauricio Fernandez in htmldiff.

== 1.1.1 / 2004-09-25
* Fixed bug #891:
http://rubyforge.org/tracker/?func=detail&atid=407&aid=891&group_id=84
* Fixed bug #891 (Set returned from patch command does not contain last equal
part).
* 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).
Expand Down
8 changes: 3 additions & 5 deletions Manifest.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
.autotest
.gemtest
.hoerc
.rspec
.travis.yml
Contributing.rdoc
Gemfile
History.rdoc
License.rdoc
Manifest.txt
Expand All @@ -28,9 +23,12 @@ lib/diff/lcs/ldiff.rb
lib/diff/lcs/string.rb
spec/change_spec.rb
spec/diff_spec.rb
spec/fixtures/ds1.csv
spec/fixtures/ds2.csv
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
Expand Down
27 changes: 14 additions & 13 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,19 @@ home :: https://github.com/halostatue/diff-lcs
code :: https://github.com/halostatue/diff-lcs
bugs :: https://github.com/halostatue/diff-lcs/issues
rdoc :: http://rubydoc.info/github/halostatue/diff-lcs
continuous integration :: {<img src="https://travis-ci.org/halostatue/diff-lcs.png" />}[https://travis-ci.org/halostatue/diff-lcs]
test coverage :: {<img src="https://coveralls.io/repos/halostatue/diff-lcs/badge.png" alt="Coverage Status" />}[https://coveralls.io/r/halostatue/diff-lcs]
continuous integration :: {<img src="https://travis-ci.org/halostatue/diff-lcs.svg" />}[https://travis-ci.org/halostatue/diff-lcs]
test coverage :: {<img src="https://coveralls.io/repos/halostatue/diff-lcs/badge.svg" alt="Coverage Status" />}[https://coveralls.io/r/halostatue/diff-lcs]

== Description

Diff::LCS computes the difference between two Enumerable sequences using the
McIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities
to create a simple HTML diff output format and a standard diff-like tool.

This is release 1.2.4, fixing a bug introduced after diff-lcs 1.1.3 that did
not properly prune common sequences at the beginning of a comparison set.
Thanks to Paul Kunysch for fixing this issue.

Coincident with the release of diff-lcs 1.2.3, we reported an issue with
Rubinius in 1.9 mode
({rubinius/rubinius#2268}[https://github.com/rubinius/rubinius/issues/2268]).
We are happy to report that this issue has been resolved.
This is release 1.3, providing a tentative fix to a long-standing issue related
to incorrect detection of a patch direction. Also modernizes the gem
infrastructure, testing infrastructure, and provides a warning-free experience
to Ruby 2.4 users.

== Synopsis

Expand Down Expand Up @@ -71,12 +67,17 @@ or Array will perform best.
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]
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 1.15}[http://search.cpan.org/~nedkonz/Algorithm-Diff-1.15/].
Diff::LCS#sdiff and Diff::LCS#traverse_balanced were originally written for the
Perl version by Mike Schilli.

This library is called Diff::LCS because of an early version of Algorithm::Diff
which was restrictively licensed.
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.

:include: Contributing.rdoc

Expand Down
45 changes: 20 additions & 25 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,49 +14,44 @@ Hoe.plugin :travis
spec = Hoe.spec 'diff-lcs' do
developer('Austin Ziegler', 'halostatue@gmail.com')

self.need_tar = true
require_ruby_version '>= 1.8'

self.history_file = 'History.rdoc'
self.readme_file = 'README.rdoc'
self.extra_rdoc_files = FileList["*.rdoc"].to_a

%w(MIT Perl\ Artistic\ v2 GNU\ GPL\ v2).each { |l| self.license l }

self.extra_dev_deps << ['hoe-bundler', '~> 1.2']
self.extra_dev_deps << ['hoe-doofus', '~> 1.0']
self.extra_dev_deps << ['hoe-gemspec2', '~> 1.1']
self.extra_dev_deps << ['hoe-git', '~> 1.5']
self.extra_dev_deps << ['hoe-rubygems', '~> 1.0']
self.extra_dev_deps << ['hoe-travis', '~> 1.2']
self.extra_dev_deps << ['rake', '~> 10.0']
self.extra_dev_deps << ['rspec', '~> 2.0']

if RUBY_VERSION >= '1.9' and (ENV['CI'] or ENV['TRAVIS'])
self.extra_dev_deps << ['simplecov', '~> 0.8']
self.extra_dev_deps << ['coveralls', '~> 0.7']
end
self.licenses = [ 'MIT', 'Perl Artistic v2', 'GNU GPL v2' ]

extra_dev_deps << ['hoe-doofus', '~> 1.0']
extra_dev_deps << ['hoe-gemspec2', '~> 1.1']
extra_dev_deps << ['hoe-git', '~> 1.6']
extra_dev_deps << ['hoe-rubygems', '~> 1.0']
extra_dev_deps << ['hoe-travis', '~> 1.2']
extra_dev_deps << ['rspec', '>= 2.0', '< 4']
extra_dev_deps << ['rake', '>= 10.0', '< 12']
extra_dev_deps << ['rdoc', '>= 0']
end

unless Rake::Task.task_defined? :test
task :test => :spec
Rake::Task['travis'].prerequisites.replace(%w(spec))
end

if RUBY_VERSION >= '1.9'
if RUBY_VERSION >= '2.0' && RUBY_ENGINE == 'ruby'
namespace :spec do
desc "Submit test coverage to Coveralls"
task :coveralls do
ENV['COVERALLS'] = 'yes'
if ENV['CI'] or ENV['TRAVIS']
ENV['COVERALLS'] = 'yes'
Rake::Task['spec'].execute
else
Rake::Task['spec:coverage'].execute
end
end

desc "Runs test coverage. Only works Ruby 1.9+ and assumes 'simplecov' is installed."
desc "Runs test coverage. Only works Ruby 2.0+ and assumes 'simplecov' is installed."
task :coverage do
ENV['COVERAGE'] = 'yes'
Rake::Task['spec'].execute
end
end

Rake::Task['travis'].prerequisites.replace(%w(spec:coveralls))
# Rake::Task['travis'].prerequisites.replace(%w(spec:coveralls))
end

# vim: syntax=ruby
Loading

0 comments on commit f82593e

Please sign in to comment.