Welcome to mirror list, hosted at ThFree Co, Russian Federation.

diff.rb « lib « ipynbdiff « gems « vendor - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3554ac55d9936caba849bc2c2fa729e3d4946ba4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

# Custom differ for Jupyter Notebooks
module IpynbDiff
  require 'delegate'

  # The result of a diff object
  class Diff < SimpleDelegator
    require 'diffy'

    attr_reader :from, :to

    def initialize(from, to, diffy_opts)
      super(Diffy::Diff.new(from.as_text, to.as_text, **diffy_opts))

      @from = from
      @to = to
    end
  end
end