diff --git a/lib/linguist/memory_blob.rb b/lib/linguist/blob.rb similarity index 98% rename from lib/linguist/memory_blob.rb rename to lib/linguist/blob.rb index c17cf3e2..8131d9b8 100644 --- a/lib/linguist/memory_blob.rb +++ b/lib/linguist/blob.rb @@ -4,7 +4,7 @@ module Linguist # A MemoryBlob is a wrapper around the content of a file to make it quack # like a Grit::Blob. It provides the basic interface: `name`, # `data`, `path` and `size`. - class MemoryBlob + class Blob include BlobHelper # Public: Initialize a new MemoryBlob. diff --git a/lib/linguist/file_blob.rb b/lib/linguist/file_blob.rb index 98ef3825..5f8bc373 100644 --- a/lib/linguist/file_blob.rb +++ b/lib/linguist/file_blob.rb @@ -1,11 +1,11 @@ require 'linguist/blob_helper' -require 'linguist/memory_blob' +require 'linguist/blob' module Linguist # A FileBlob is a wrapper around a File object to make it quack # like a Grit::Blob. It provides the basic interface: `name`, # `data`, `path` and `size`. - class FileBlob < MemoryBlob + class FileBlob < Blob include BlobHelper # Public: Initialize a new FileBlob from a path diff --git a/test/helper.rb b/test/helper.rb index 71594416..bac2a62c 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -3,7 +3,7 @@ require "minitest/autorun" require "mocha/setup" require "linguist" require 'color-proximity' -require "linguist/memory_blob" +require "linguist/blob" def fixtures_path File.expand_path("../fixtures", __FILE__) @@ -17,7 +17,7 @@ end def fixture_blob_memory(name) filepath = (name =~ /^\//)? name : File.join(fixtures_path, name) content = File.read(filepath) - Linguist::MemoryBlob.new(name, content) + Linguist::Blob.new(name, content) end def samples_path @@ -32,5 +32,5 @@ end def sample_blob_memory(name) filepath = (name =~ /^\//)? name : File.join(samples_path, name) content = File.read(filepath) - Linguist::MemoryBlob.new(name, content) + Linguist::Blob.new(name, content) end