Sha256: 242ffc5163b566b9a0bf4b93e4f3fac8c7ddd7f64738cf99e083b7087089acb5

Contents?: true

Size: 515 Bytes

Versions: 14

Compression:

Stored size: 515 Bytes

Contents

module Grit
  class Diff

    def old_path
      GritExt.encode! @a_path
    end

    def new_path
      GritExt.encode! @b_path
    end

    def diff
      if @diff.nil?
        @diff = ""
      else
        lines = @diff.lines.to_a
        path = GritExt.encode! lines.shift(2).join
        body = GritExt.encode! lines.join
        begin
          @diff = path + body
        rescue Encoding::CompatibilityError
          @diff = GritExt.clean(path) + GritExt.clean(body)
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
gitlab-grit-2.8.3 lib/grit_ext/diff.rb
gitlab-grit-2.8.2 lib/grit_ext/diff.rb
gitlab-grit-2.8.1 lib/grit_ext/diff.rb
gitlab-grit-2.8.0 lib/grit_ext/diff.rb
gitlab-grit-2.7.3 lib/grit_ext/diff.rb
gitlab-grit-2.6.12 lib/grit_ext/diff.rb
gitlab-grit-2.7.2 lib/grit_ext/diff.rb
gitlab-grit-2.6.11 lib/grit_ext/diff.rb
gitlab-grit-2.7.1 lib/grit_ext/diff.rb
gitlab-grit-2.6.10 lib/grit_ext/diff.rb
gitlab-grit-2.7.0 lib/grit_ext/diff.rb
gitlab-grit-2.6.9 lib/grit_ext/diff.rb
gitlab-grit-2.6.8 lib/grit_ext/diff.rb
gitlab-grit-2.6.7 lib/grit_ext/diff.rb