newgistics 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/newgistics/string_helper.rb +2 -2
- data/lib/newgistics/version.rb +1 -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: b8ab73882de4020ebd57fbc2250e106fa2d1bd6b
|
4
|
+
data.tar.gz: 126362028aa37f405cfb09fb20b2db3726e68f24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f76f6c594c07fed343a5f3f55a5b9494cce548bfa75149509d61a494bb2b21014bdbbbd3d92e4af4eda07189a28155f5e452bf5d33439f5cdd389d66c1bee81
|
7
|
+
data.tar.gz: 43fcb4670ba29a96569bd475c78c1b59bd8c518c871aca04ab0722ea53e366bae0267104ec2761e59567cff0fb01cfa0a25d678a4bad73dbc58aabaf2b79790f
|
@@ -5,14 +5,14 @@ module Newgistics
|
|
5
5
|
CAPITALIZED_STRING_REGEX = /\A[A-Z]/
|
6
6
|
|
7
7
|
def self.camelize(string, upcase_first: true)
|
8
|
-
string.dup.
|
8
|
+
string.to_s.dup.tap do |s|
|
9
9
|
s.gsub!(UNDERSCORED_STRING_REGEX) { $1.capitalize! || $1 }
|
10
10
|
s.gsub!(CAPITALIZED_STRING_REGEX) { $&.downcase! } unless upcase_first
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.underscore(string)
|
15
|
-
string.dup.
|
15
|
+
string.to_s.dup.tap do |s|
|
16
16
|
s.gsub!(CAMEL_CASED_STRING_REGEX) { "#{$1}_#{$2}" }
|
17
17
|
s.downcase!
|
18
18
|
end
|
data/lib/newgistics/version.rb
CHANGED