mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Add Pathname
This commit is contained in:
@@ -2,3 +2,4 @@ module Linguist
|
|||||||
end
|
end
|
||||||
|
|
||||||
require 'linguist/language'
|
require 'linguist/language'
|
||||||
|
require 'linguist/pathname'
|
||||||
|
|||||||
11
lib/linguist/pathname.rb
Normal file
11
lib/linguist/pathname.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
module Linguist
|
||||||
|
class Pathname
|
||||||
|
def initialize(path)
|
||||||
|
@path = path
|
||||||
|
end
|
||||||
|
|
||||||
|
def to_s
|
||||||
|
@path.dup
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
11
test/test_pathname.rb
Normal file
11
test/test_pathname.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
require 'linguist/pathname'
|
||||||
|
|
||||||
|
require 'test/unit'
|
||||||
|
|
||||||
|
class TestPathname < Test::Unit::TestCase
|
||||||
|
include Linguist
|
||||||
|
|
||||||
|
def test_to_s
|
||||||
|
assert_equal "file.rb", Pathname.new("file.rb").to_s
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user