mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Remove Blob#file?
This commit is contained in:
@@ -43,10 +43,6 @@ module Linguist
|
|||||||
content_type.include?('octet') || !(text? || image?)
|
content_type.include?('octet') || !(text? || image?)
|
||||||
end
|
end
|
||||||
|
|
||||||
def file?
|
|
||||||
image? || binary?
|
|
||||||
end
|
|
||||||
|
|
||||||
def text?
|
def text?
|
||||||
content_type[/(text|json)/]
|
content_type[/(text|json)/]
|
||||||
end
|
end
|
||||||
@@ -62,7 +58,7 @@ module Linguist
|
|||||||
end
|
end
|
||||||
|
|
||||||
def viewable?
|
def viewable?
|
||||||
!file? && !large?
|
!image? && !binary? && !large?
|
||||||
end
|
end
|
||||||
|
|
||||||
def generated?
|
def generated?
|
||||||
|
|||||||
@@ -87,11 +87,6 @@ class TestBlob < Test::Unit::TestCase
|
|||||||
assert !blob("octocat.png").binary?
|
assert !blob("octocat.png").binary?
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_file
|
|
||||||
assert blob("octocat.png").file?
|
|
||||||
assert blob("linguist.gem").file?
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_text
|
def test_text
|
||||||
assert blob("file.txt").text?
|
assert blob("file.txt").text?
|
||||||
assert blob("file.json").text?
|
assert blob("file.json").text?
|
||||||
@@ -106,6 +101,12 @@ class TestBlob < Test::Unit::TestCase
|
|||||||
assert !blob("octocat.psd").image?
|
assert !blob("octocat.psd").image?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_viewable
|
||||||
|
assert blob("foo.rb").viewable?
|
||||||
|
assert !blob("octocat.png").viewable?
|
||||||
|
assert !blob("linguist.gem").viewable?
|
||||||
|
end
|
||||||
|
|
||||||
def test_generated
|
def test_generated
|
||||||
assert !blob("README").generated?
|
assert !blob("README").generated?
|
||||||
assert blob("MainMenu.xib").generated?
|
assert blob("MainMenu.xib").generated?
|
||||||
|
|||||||
Reference in New Issue
Block a user