• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

halostatue / diff-lcs / 20625065018

31 Dec 2025 06:41PM UTC coverage: 91.336% (+3.0%) from 88.366%
20625065018

push

github

halostatue
chore: Prepare for release of diff-lcs 2.0 beta 1

Simplified build tooling, updated GitHub Actions workflows, prepared
changelog for dev release, and updated support for Ruby 3.2 through 4.x.

- Streamlined Rakefile and Gemfile and removed unnecessary complexity
- Added Ruby 4.0 support and dropped unsupported Ruby versions
- Simplified CI configuration
- Updated release and support documents.

Signed-off-by: Austin Ziegler <austin@zieglers.ca>

400 of 597 branches covered (67.0%)

1 of 1 new or added line in 1 file covered. (100.0%)

52 existing lines in 6 files now uncovered.

622 of 681 relevant lines covered (91.34%)

291.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.21
/lib/diff/lcs/block.rb
1
# frozen_string_literal: true
2

3
Diff::LCS::Block = Data.define(:changes, :insert, :remove) # :nodoc:
2✔
4

5
# A block is an operation removing, adding, or changing a group of items, a list of
6
# changes, where each change adds or deletes a single item.
7
#
8
# Used by bin/ldiff.
9
class Diff::LCS::Block
2✔
10
  def self.from_chunk(chunk)
2✔
11
    changes, insert, remove = [], [], []
18✔
12

13
    chunk.each do
18✔
14
      changes << _1
38✔
15
      remove << _1 if _1.deleting?
38✔
16
      insert << _1 if _1.adding?
38✔
17
    end
18

19
    new(changes: changes.freeze, remove: remove.freeze, insert: insert.freeze)
18✔
20
  end
21

22
  class << self
2✔
23
    private :new, :[]
2✔
24
  end
25

26
  private :with
2✔
27

28
  def diff_size = insert.size - remove.size
2✔
29

30
  def op
2✔
31
    case [remove, insert]
8!
32
    # Unchanged
×
UNCOV
33
    in [[], []] then "^"
×
34
    # Delete
×
UNCOV
35
    in [_, []] then "-"
×
36
    # Insert
×
UNCOV
37
    in [[], _] then "+"
×
38
    # Conflict
4✔
39
    in [_, _] then "!"
8✔
40
    end
41
  end
42
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc