Add Pathname

This commit is contained in:
Joshua Peek
2011-05-10 09:27:18 -05:00
parent 74d121507e
commit 86c67f4b6f
3 changed files with 23 additions and 0 deletions

View File

@@ -2,3 +2,4 @@ module Linguist
end
require 'linguist/language'
require 'linguist/pathname'

11
lib/linguist/pathname.rb Normal file
View 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
View 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