| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
- Required to fully support rspec.
- Resolves #63.
|
|\
| |
| | |
Change when max_diff_size is applied
|
| |
| |
| |
| |
| |
| |
| | |
- This appears to satisfy the issues found in #60 as well as providing the
additional fixes required to properly test ldiff.
Resolves #60
|
|/ |
|
|
|
|
|
|
|
| |
Resolves #57.
- The `diff_size` should be an absolute value.
- Added a test to ensure that the issue does not introduce a regression.
|
|
|
|
|
| |
- Support hoe >= 3.18
- Various bug fixes and updates
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Resolve ldiff output issues: Resolves #5 and #6 by adding system-output
comparison calls to `bin/ldiff` compared against some pre-generated output.
There is some timestamp manipulation involved with the output comparison,
as the timestamps are unstable because of the way that git clone works.
- Resolved a problem with bin/ldiff --context output.
- Resolved a Numeric/Integer OptParse issue: later versions of Ruby had
problems working with an `OptParse` option specification of `Numeric`; this
has been changed to `Integer`.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- This required some level of code remediation in the main library, but all
tests now pass:
- Patchsets are now internally flattened one level explicitly, rather than
using Array#flatten. This ensures that only the outer patchset array is
flattened.
Fixes #48.
|
|
|
|
|
| |
- Other linting configuration also applied.
- Soft-deprecating versions older than 2.3.
|
|
|
|
|
|
|
|
|
|
| |
This reverts commits 01e0cae and 3b4d2be because they introduce fatally
breaking changes in the tests that were hidden by broken CI.
* 01e0cae: Add #to_ary to Diff::LCS::Change and Diff::LCS::ContextChange
[Akinori MUSHA]
* 3b4d2be: Mention in rdoc that Diff::LCS::ContextChange can be converted to an
array [Akinori MUSHA]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It would be quite handy if you could write as follows:
```ruby
Diff::LCS.sdiff(a, b).each do |action, (old_position, old_element), (new_position, new_element)|
case action
when '!'
# replace
when '-'
# delete
when '+'
# insert
end
end
```
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| |
|
|\
| |
| | |
update Change and ContextChange's '==' methods to compare against the other object's class
|
| |
| |
| |
| | |
compare against the other object's class
|
|/
|
|
| |
Fixes #21.
|
|
|
| |
expand tabs is broken otherwise and the code is inconsistent anyway
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
flatten should only go one level deep to avoid problems when diffing arrays of arrays, e.g.:
Diff::LCS.sdiff([[1,2]], [])
RuntimeError: Invalid change array format provided.
from /Users/joshbronson/homebase/jbro-homebase/bundle/ruby/1.9.1/gems/diff-lcs-1.2.4/lib/diff/lcs/change.rb:50:in `from_a'
from /Users/joshbronson/homebase/jbro-homebase/bundle/ruby/1.9.1/gems/diff-lcs-1.2.4/lib/diff/lcs/change.rb:137:in `from_a'
from /Users/joshbronson/homebase/jbro-homebase/bundle/ruby/1.9.1/gems/diff-lcs-1.2.4/lib/diff/lcs/change.rb:158:in `simplify'
from /Users/joshbronson/homebase/jbro-homebase/bundle/ruby/1.9.1/gems/diff-lcs-1.2.4/lib/diff/lcs/callbacks.rb:312:in `discard_a'
from /Users/joshbronson/homebase/jbro-homebase/bundle/ruby/1.9.1/gems/diff-lcs-1.2.4/lib/diff/lcs.rb:633:in `traverse_balanced'
from /Users/joshbronson/homebase/jbro-homebase/bundle/ruby/1.9.1/gems/diff-lcs-1.2.4/lib/diff/lcs/internals.rb:10:in `diff_traversal'
from /Users/joshbronson/homebase/jbro-homebase/bundle/ruby/1.9.1/gems/diff-lcs-1.2.4/lib/diff/lcs.rb:266:in `sdiff'
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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 (JonRowe) found this
in rspec/rspec-expectations#219 and provided a first pass
implementation in diff-lcs#15. I'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).
https://github.com/rspec/rspec-expectations/issues/219
https://github.com/halostatue/diff-lcs/pull/15
* Adding Travis CI testing for Ruby 2.0.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
- I changed what I thought was a private API, but it turns out that
people used Hunk#unshift. Because the Hunk#merge functionality is
safer and more correct, I have provided Hunk#unshift as an alias to
Hunk#merge.
- Note that Hunk#unshift should be considered deprecated and the alias
will be removed in a future major version of Diff::LCS.
|
| |
|
| |
|
|
|
|
| |
- Only on 1.8.7. Found by travis-ci.org.
|
|
|
|
| |
The output is now indistinguishable from diff (at least for -u).
|
| |
|
| |
|
|
|
|
|
| |
This bug has been filed for five and a half years and I have finally
fixed it. By ghu it feels good.
|
| |
|
| |
|
|
|
|
|
| |
- Bringing indents in a little.
- Simplifying a little logic so that boolean shortcuts are taken faster.
|
| |
|
|
|
|
| |
- "assigned but unused variable"
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. All Diff::LCS::__* methods are now moved to Diff::LCS::Internals and
named without the underscores.
2. Fixed the documentation for Diff::LCS::patch. (Some formatting may
have been broken.)
3. Eliminated normalize_patchset in favour of the (substantially
similar) analyze_patchset. This allows for a single-pass over a
patchset to determine whether the patchset contains changes and
transform it to the object-based format.
4. Made Diff::LCS::ContextChange descend from Diff::LCS::Change. This
will probably change so that both descend from something like a
Diff::LCS::AbstractChange because of some issues that may arise with
case statement order.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Fixed some formatting and style issues.
- Trailing spaces
- Calling class methods using '.' instead of '::'.
- Resolved Issue #2 by handling string[string.size, 1] properly (it
returns "" not nil).
- Added special case handling for Diff::LCS.patch so that it handles
patches that are empty or contain no changes.
- Adding temporary code to help determined the reason for the
misidentification of patch direction.
- Added a number of different specs to check for comparing the same
value.
- Added broken spec filtering.
|
| |
|
|
|
|
| |
https://github.com/halostatue/diff-lcs/issues/3
|