File: blob.rb

package info (click to toggle)
ruby-grit 2.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 336 kB
  • sloc: ruby: 3,643; makefile: 4
file content (26 lines) | stat: -rw-r--r-- 451 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
module Grit
  class Blob

    alias_method :old_name, :name
    alias_method :old_data, :data

    def name
      GritExt.encode! old_name
    end

    def data
      GritExt.encode! old_data
    end

    class << self
      alias_method :old_blame, :blame

      def blame(repo, commit, file)
        old_blame(repo, commit, file).map do |b,lines|
          [b, GritExt.encode!(lines.join('\n')).split('\n')]
        end
      end
    end

  end
end