lite-ruby 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/lite/ruby/string.rb +1 -22
- data/lib/lite/ruby/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8475c37b89cebc23a2b6c8d45c05a9faaa05cd707559d3e1c9dbc671b5b9eb6
|
4
|
+
data.tar.gz: 543306b15474788c1ddefbc45ee6038d4bfea80fd04cb897fa5d4db41d812bce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5742b8fdd4dea13ee9b760c2e1bb79a45557bfad5797732bf9f68c23e66c2a6145ec89a1a53804cc352974f4f51b1df1c62ea2a78d35a3ab4b17a9304b5ea6e0
|
7
|
+
data.tar.gz: 6892d76587eab981d031b1f3bb59421878b9e2fa44a2e74537462bad5748f17a77298e42d4b504c3282f2b4bc92d289585beb4bb7ea9049ffcccd3559155cb9b
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [1.0.13] - 2019-08-16
|
10
|
+
### Changed
|
11
|
+
- Revert constantize function
|
12
|
+
|
9
13
|
## [1.0.12] - 2019-08-15
|
10
14
|
### Changed
|
11
15
|
- Changed how string underscore works
|
data/Gemfile.lock
CHANGED
data/lib/lite/ruby/string.rb
CHANGED
@@ -84,30 +84,9 @@ class String
|
|
84
84
|
camelize!
|
85
85
|
end
|
86
86
|
|
87
|
-
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
|
88
|
-
# rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity
|
89
87
|
def constantize
|
90
|
-
|
91
|
-
Object.const_get(self) if names.empty?
|
92
|
-
names.shift if names.size > 1 && names.first.empty?
|
93
|
-
|
94
|
-
names.inject(Object) do |constant, name|
|
95
|
-
return constant.const_get(name) if constant == Object
|
96
|
-
|
97
|
-
candidate = constant.const_get(name)
|
98
|
-
next candidate if constant.const_defined?(name, false)
|
99
|
-
next candidate unless Object.const_defined?(name)
|
100
|
-
|
101
|
-
constant = constant.ancestors.each_with_object(constant) do |ancestor, const|
|
102
|
-
break const if ancestor == Object
|
103
|
-
break ancestor if ancestor.const_defined?(name, false)
|
104
|
-
end
|
105
|
-
|
106
|
-
constant.const_get(name, false)
|
107
|
-
end
|
88
|
+
Object.const_get(camelize)
|
108
89
|
end
|
109
|
-
# rubocop:enable Metrics/MethodLength, Metrics/PerceivedComplexity
|
110
|
-
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity
|
111
90
|
|
112
91
|
def dasherize
|
113
92
|
underscore.tr('_', '-')
|
data/lib/lite/ruby/version.rb
CHANGED