lite-ruby 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e2abeaa99cad5c63425288cc0e7045660bfc7b779022972f777300edbf0c188
4
- data.tar.gz: a148d327d212ec22fd41f5632a7caa3b7efb07337f7bf1cfd96da3ba7df45d44
3
+ metadata.gz: 7ba24d454323ce7e6ac1c540713424ab0a3789a7205af7d019714f5ffa489bc8
4
+ data.tar.gz: 993ceac9b653ec496415cd99cb9065a88e6879acb084d67f87f9af97a8a4bdc9
5
5
  SHA512:
6
- metadata.gz: 67d278a3ee14769f28104fc4a378cb67f5e096159c98d1cce053bd64a510af2e9a240fa8a9c4d7f933354b46f48ad62a26a61ea31dc87135e1b34308ce89fad3
7
- data.tar.gz: 63f055d7239806effc40f353a5bc499800e4694437f385942eb30796784d375962b146d05de9f9839db8a2724cc1e42f1f3119392a3c1383beedd7083cbeb1d2
6
+ metadata.gz: 1f477165f75a0bea822a12664e0d68710ade1b7cb92ef22152af908a48e84b1f3cb63e3200ebe9674febf78a2854dbcbb157b69af73fc3ce3f050f449b70c7cd
7
+ data.tar.gz: 9de71665668046da66b9c6378310cd18d336f3e517c4ba7c12def2166307ca8ebed37c12a8345d9d36efec377d8ff32e24eecb188c56e0bc700d8a8adf03f866
data/CHANGELOG.md CHANGED
@@ -6,9 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.0.8] - 2019-08-15
10
+ ### Changed
11
+ - Resolve contantize name clash
12
+
9
13
  ## [1.0.7] - 2019-08-15
10
14
  ### Changed
11
- - Changed initializer file name from lite-ruby to lite_ruby
15
+ - Underscore initializer file name
12
16
 
13
17
  ## [1.0.6] - 2019-08-14
14
18
  ### Changed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-ruby (1.0.7)
4
+ lite-ruby (1.0.8)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -84,9 +84,30 @@ class String
84
84
  camelize!
85
85
  end
86
86
 
87
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
88
+ # rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity
87
89
  def constantize
88
- Object.const_get(self)
90
+ names = camel_cased_word.split('::')
91
+ Object.const_get(camel_cased_word) 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
89
108
  end
109
+ # rubocop:enable Metrics/MethodLength, Metrics/PerceivedComplexity
110
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity
90
111
 
91
112
  def dasherize
92
113
  dup.dasherize!
@@ -3,7 +3,7 @@
3
3
  module Lite
4
4
  module Ruby
5
5
 
6
- VERSION ||= '1.0.7'
6
+ VERSION ||= '1.0.8'
7
7
 
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lite-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez