From fe9c12d29edf1d476699030741ec7c3f0e5680bc Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Fri, 6 May 2016 17:43:51 +0900 Subject: [PATCH] Removed unused pathname extension --- lib/rake/ext/pathname.rb | 25 ------------------------- test/test_rake_pathname_extensions.rb | 15 --------------- 2 files changed, 40 deletions(-) delete mode 100644 lib/rake/ext/pathname.rb delete mode 100644 test/test_rake_pathname_extensions.rb diff --git a/lib/rake/ext/pathname.rb b/lib/rake/ext/pathname.rb deleted file mode 100644 index 49e2cd47a..000000000 --- a/lib/rake/ext/pathname.rb +++ /dev/null @@ -1,25 +0,0 @@ -require 'rake/ext/core' -require 'pathname' - -class Pathname - - rake_extension("ext") do - # Return a new Pathname with String#ext applied to it. - # - # This Pathname extension comes from Rake - def ext(newext='') - Pathname.new(Rake.from_pathname(self).ext(newext)) - end - end - - rake_extension("pathmap") do - # Apply the pathmap spec to the Pathname, returning a - # new Pathname with the modified paths. (See String#pathmap for - # details.) - # - # This Pathname extension comes from Rake - def pathmap(spec=nil, &block) - Pathname.new(Rake.from_pathname(self).pathmap(spec, &block)) - end - end -end diff --git a/test/test_rake_pathname_extensions.rb b/test/test_rake_pathname_extensions.rb deleted file mode 100644 index 7da702d0c..000000000 --- a/test/test_rake_pathname_extensions.rb +++ /dev/null @@ -1,15 +0,0 @@ -require File.expand_path('../helper', __FILE__) -require 'rake/ext/pathname' - -class TestRakePathnameExtensions < Rake::TestCase - def test_ext_works_on_pathnames - pathname = Pathname.new("abc.foo") - assert_equal Pathname.new("abc.bar"), pathname.ext("bar") - end - - def test_path_map_works_on_pathnames - pathname = Pathname.new("this/is/a/dir/abc.rb") - assert_equal Pathname.new("abc.rb"), pathname.pathmap("%f") - assert_equal Pathname.new("this/is/a/dir"), pathname.pathmap("%d") - end -end