Sha256: b1a7caddf26af600de8b1776b80865395ea18290adc3cd42c2cd83aca881c727
Contents?: true
Size: 688 Bytes
Versions: 30
Compression:
Stored size: 688 Bytes
Contents
module Watir class Util class << self # # "Watir::Span" => "Span" # def demodulize(str) str.gsub(/^.*::/, '') end # # "FooBar" => "foo_bar" # def underscore(str) str.gsub(/\B[A-Z][^A-Z]/, '_\&').downcase.gsub(' ', '_') end # # "Checkboxes" => "Checkbox" # "Bodies" => "Body" # "Buttons" => "Button" # def singularize(str) case str.downcase when "checkboxes" str.chop.chop when "bodies" str.chop.chop.chop + "y" else str.chop end end end end end
Version data entries
30 entries across 30 versions & 2 rubygems