Sha256: 64926e89767e89fc620299d26d8604e64e50980648e627ca7615b30fe7b934cf

Contents?: true

Size: 614 Bytes

Versions: 1

Compression:

Stored size: 614 Bytes

Contents

require 'nano/string/basename'

class String

  alias_method :demodulize, :basename  # a la Rails

end


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

  require 'test/unit'

  class TCString < Test::Unit::TestCase

    def setup
      @a =  "Down::Bottom"
      @b =  "Further::Down::Bottom"
    end

    def test_001
      assert_raises( ArgumentError ) { @a.demodulize(1) }
    end

    def test_002
      assert_equal( "Bottom", @a.demodulize )
    end

    def test_003
      assert_equal( "Bottom", @b.demodulize )
    end
  end

=end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-0.9.0 lib/nano/string/demodulize.rb