class Linguist::Blob

‘data`, `path` and `size`.
like a Grit::Blob. It provides the basic interface: `name`,
A Blob is a wrapper around the content of a file to make it quack

def data

Returns a String.

Public: File contents.
def data
  @content
end

def extension

Returns a String.

Public: Get file extension.
def extension
  extensions.last || ""
end

def extensions

Returns an Array

=> [".html.erb", ".erb"]
>> Linguist::Blob.new("app/views/things/index.html.erb").extensions

Public: Return an array of the file extensions
def extensions
  _, *segments = name.downcase.split(".", -1)
  segments.map.with_index do |segment, index|
    "." + segments[index..-1].join(".")
  end
end

def initialize(path, content, symlink: false)

Returns a Blob.

symlink - Whether the file is a symlink.
content - Content of the file.
path - A path String (does not necessarily exists on the file system).

Public: Initialize a new Blob.
def initialize(path, content, symlink: false)
  @path = path
  @content = content
  @symlink = symlink
end

def name

Returns a String

Public: File name
def name
  File.basename(@path)
end

def size

Returns an Integer.

Public: Get byte size
def size
  @content.bytesize
end

def symlink?

Returns true or false.

Public: Is this a symlink?
def symlink?
  @symlink
end