Sha256: 742730a17ce2f13f31c8e1096b72b9b833691fff8596ed62afbc5f3cbef7ca7e
Contents?: true
Size: 564 Bytes
Versions: 52
Compression:
Stored size: 564 Bytes
Contents
module JsDuck # Common routines for manipulating class names. class ClassName # Given a full class name extracts the "class"-part of the name. # # ClassName.short("My.package.Foo") --> "Foo" # # Because we try to emulate ext-doc, it's not as simple as just # taking the last part. See class_spec.rb for details. def self.short(name) parts = name.split(/\./) short = parts.pop while parts.length > 1 && parts.last =~ /^[A-Z]/ short = parts.pop + "." + short end short end end end
Version data entries
52 entries across 52 versions & 3 rubygems