darthjee-core_ext 1.5.0 → 1.5.1
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/LICENSE +2 -3
- data/lib/darthjee/core_ext.rb +1 -0
- data/lib/darthjee/core_ext/array.rb +2 -2
- data/lib/darthjee/core_ext/hash.rb +4 -4
- data/lib/darthjee/core_ext/object.rb +7 -0
- data/lib/darthjee/core_ext/version.rb +1 -1
- data/spec/lib/object_spec.rb +35 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9166c9a826895d9f039aa73a5460746dd7e48b5f
|
4
|
+
data.tar.gz: 1146695820d6fc7dfabe38a2145d3b8ba34670b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45fdd45a6e6378421e3db191839ee898ff31a4145bd54445f1a481b1d5db78d640cc6e8adc38ac161a9788d73fdb5c4e269c5ea98ff1686ad9d754d91eb34cf5
|
7
|
+
data.tar.gz: f35df70664a0e2b3f1e307fc44fe3932ecf58b8694f49c0e1be4263a32e19456e0b255d6765795a411942253d11b8ec560d89233c80bad8332b723304eac7397
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
MIT License
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2017 Favini
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
SOFTWARE.
|
22
|
-
|
data/lib/darthjee/core_ext.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
require 'darthjee/core_ext/hash/value_changer'
|
2
|
-
require 'darthjee/core_ext/hash/deep_hash_constructor'
|
3
|
-
require 'darthjee/core_ext/hash/key_changer'
|
4
|
-
|
5
1
|
class Hash
|
2
|
+
autoload :ValueChanger, 'darthjee/core_ext/hash/value_changer'
|
3
|
+
autoload :DeepHashConstructor, 'darthjee/core_ext/hash/deep_hash_constructor'
|
4
|
+
autoload :KeyChanger, 'darthjee/core_ext/hash/key_changer'
|
5
|
+
|
6
6
|
def chain_fetch(*keys)
|
7
7
|
value = self
|
8
8
|
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Object do
|
4
|
+
describe '#is_any?' do
|
5
|
+
subject { 1 }
|
6
|
+
|
7
|
+
it do
|
8
|
+
expect(subject).to respond_to(:is_any?)
|
9
|
+
end
|
10
|
+
|
11
|
+
context 'when no argument is passed' do
|
12
|
+
it do
|
13
|
+
expect(subject.is_any?).to be_falsey
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'when passing the correct class as argument' do
|
18
|
+
it do
|
19
|
+
expect(subject.is_any?(subject.class)).to be_truthy
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'along any other class' do
|
23
|
+
it do
|
24
|
+
expect(subject.is_any?(Symbol, subject.class)).to be_truthy
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'when passing the wrong class' do
|
30
|
+
it do
|
31
|
+
expect(subject.is_any?(Symbol)).to be_falsey
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: darthjee-core_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darthjee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -154,6 +154,7 @@ files:
|
|
154
154
|
- lib/darthjee/core_ext/hash/key_changer.rb
|
155
155
|
- lib/darthjee/core_ext/hash/value_changer.rb
|
156
156
|
- lib/darthjee/core_ext/numeric.rb
|
157
|
+
- lib/darthjee/core_ext/object.rb
|
157
158
|
- lib/darthjee/core_ext/symbol.rb
|
158
159
|
- lib/darthjee/core_ext/time.rb
|
159
160
|
- lib/darthjee/core_ext/version.rb
|
@@ -164,6 +165,7 @@ files:
|
|
164
165
|
- spec/lib/hash/key_changer_spec.rb
|
165
166
|
- spec/lib/hash_spec.rb
|
166
167
|
- spec/lib/numeric_spec.rb
|
168
|
+
- spec/lib/object_spec.rb
|
167
169
|
- spec/lib/symbol_spec.rb
|
168
170
|
- spec/lib/time_spec.rb
|
169
171
|
- spec/spec_helper.rb
|
@@ -202,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
202
204
|
version: '0'
|
203
205
|
requirements: []
|
204
206
|
rubyforge_project:
|
205
|
-
rubygems_version: 2.6.
|
207
|
+
rubygems_version: 2.6.11
|
206
208
|
signing_key:
|
207
209
|
specification_version: 4
|
208
210
|
summary: Core Extensions
|
@@ -214,6 +216,7 @@ test_files:
|
|
214
216
|
- spec/lib/hash/key_changer_spec.rb
|
215
217
|
- spec/lib/hash_spec.rb
|
216
218
|
- spec/lib/numeric_spec.rb
|
219
|
+
- spec/lib/object_spec.rb
|
217
220
|
- spec/lib/symbol_spec.rb
|
218
221
|
- spec/lib/time_spec.rb
|
219
222
|
- spec/spec_helper.rb
|