plissken 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/VERSION +1 -1
- data/lib/plissken/ext/hash/to_snake_keys.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc8dc84bae62ac54ed8ca19d28bca8b46dad43c4
|
4
|
+
data.tar.gz: efb039d1600782ecb37a7d7eda31c0dd75e686de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6579a63993f583ede7257a0db1b00f6604801b8b670187e50780a51cd815d941377a01a8c6ad5f8bdc6dfde64c119a3408c532cae56cf4d06deb10f6fdd9b7f0
|
7
|
+
data.tar.gz: 6967a9db31766dbef6de72376d95b60317fb25c71a99d90cb87cb32c77678e54f454944411052c7fcf0274195a8d51e07d598771a31c89a3acd1c718c22fc69e
|
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.1.0
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Hash.to_snake_keys
|
2
4
|
class Hash
|
3
5
|
# Recursively converts CamelCase and camelBack JSON-style hash keys to
|
@@ -35,7 +37,7 @@ class Hash
|
|
35
37
|
@__memoize_underscore ||= {}
|
36
38
|
return @__memoize_underscore[string] if @__memoize_underscore[string]
|
37
39
|
@__memoize_underscore[string] =
|
38
|
-
string.
|
40
|
+
string.tr('::', '/')
|
39
41
|
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
40
42
|
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
41
43
|
.tr('-', '_')
|