
class Class

  # Converts a class name to a unix path
  #   
  #   My::ClassName.unix_path => "/my/class_name"
  #
  # Inspired by facets/core/string/underscore.
  #
  def unix_path
    '/' + name.gsub(/([A-Z]+)([A-Z])/,'\1_\2').gsub(/([a-z])([A-Z])/,'\1_\2').gsub('::','/').downcase
  end
end

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
=begin test

  require 'test/unit'

  class TCClass < Test::Unit::TestCase

    def test_method_name
      assert_equal( Test::Unit::TestCase.unix_path, '/test/unit/test_case' )
    end

  end

=end
                                 
