Sha256: 8df80bec4dd45a078465a4a8ee4a2061ee3abfe7434d52acb9a1d8270eb08be0
Contents?: true
Size: 630 Bytes
Versions: 20
Compression:
Stored size: 630 Bytes
Contents
class Class # Converts a class name to a unix path # # My::ClassName.unix_path => "/my/class_name" # # Inspired by facet/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
Version data entries
20 entries across 20 versions & 1 rubygems