Sha256: 7149daf625adabf8895b1c91bac850160036edc1d3e32069963cf356dd910ac3

Contents?: true

Size: 344 Bytes

Versions: 6

Compression:

Stored size: 344 Bytes

Contents

# From https://github.com/rubyworks/facets/blob/master/lib/core/facets/string/modulize.rb
class String
  def modulize
    #gsub('__','/').  # why was this ever here?
    gsub(/__(.?)/){ "::#{$1.upcase}" }.
    gsub(/\/(.?)/){ "::#{$1.upcase}" }.
    gsub(/(?:_+|-+)([a-z])/){ $1.upcase }.
    gsub(/(\A|\s)([a-z])/){ $1 + $2.upcase }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
zendesk_api-0.1.5 lib/zendesk_api/core_ext/modulize.rb
zendesk_api-0.1.4 lib/zendesk_api/core_ext/modulize.rb
zendesk_api-0.1.3 lib/zendesk_api/core_ext/modulize.rb
zendesk_api-0.1.2 lib/zendesk_api/core_ext/modulize.rb
zendesk_api-0.1.1 lib/zendesk_api/core_ext/modulize.rb
zendesk_api-0.0.9 lib/zendesk_api/core_ext/modulize.rb