Sha256: afe21f2b21c179a963c7310eebd2a79bc794c764f79f1ed452af59bb8ac38ade
Contents?: true
Size: 375 Bytes
Versions: 10
Compression:
Stored size: 375 Bytes
Contents
# frozen_string_literal: true module Wasabi module CoreExt module String def self.snakecase(str) str = str.dup str.gsub!(/::/, '/') str.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2') str.gsub!(/([a-z\d])([A-Z])/, '\1_\2') str.tr!(".", "_") str.tr!("-", "_") str.downcase! str end end end end
Version data entries
10 entries across 10 versions & 1 rubygems