usable 3.9.0 → 3.9.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 +5 -5
- data/lib/usable/config.rb +6 -2
- data/lib/usable/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8d093d52f78626baa592fae6b4f153c36ea06b126ec9735512decb05eacaf25c
|
4
|
+
data.tar.gz: 47c6d034d5f36101007a734059055eee6568945b44349b303cb5edc0d69f9dc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4705bef50dc5e0612c4ee12571f0781f724905900483b37d948af52644044cd7e89de1c7d6cb1a284839c1fadd6f84c04306401196ed44e456f537e4d41a53a
|
7
|
+
data.tar.gz: 817c5596b6d8bb5d84b84b27d1d6e01bd881502494b0b3574efccd4cb885c56c6d7cbfe58f72339cb4ca0fee39a35f47dc7f4a8432063d5fcf3ac764e8a77350
|
data/lib/usable/config.rb
CHANGED
@@ -30,8 +30,12 @@ module Usable
|
|
30
30
|
@spec.to_h.each(&block)
|
31
31
|
end
|
32
32
|
|
33
|
+
# @note The @spec[key] could already be set in cases where the config was merged with another
|
34
|
+
# For example, a usable module defines a default with a block, and when mounting the module
|
35
|
+
# the same usable option is overridden as an options hash (usable mod, key: 'val')
|
33
36
|
def to_h
|
34
|
-
@lazy_loads.each { |key| @spec[key]
|
37
|
+
@lazy_loads.each { |key| @spec[key] ||= @spec.public_send(key) }
|
38
|
+
@lazy_loads.clear
|
35
39
|
@spec.to_h
|
36
40
|
end
|
37
41
|
|
@@ -58,7 +62,7 @@ module Usable
|
|
58
62
|
def method_missing(key, *args, &block)
|
59
63
|
if block
|
60
64
|
@lazy_loads << key
|
61
|
-
@spec.define_singleton_method(key)
|
65
|
+
@spec.define_singleton_method(key, &block)
|
62
66
|
else
|
63
67
|
# Needs to be a symbol so we can consistently access @lazy_loads
|
64
68
|
key = key.to_s.tr('=', '').to_sym
|
data/lib/usable/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: usable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.9.
|
4
|
+
version: 3.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Buckley
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
98
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.
|
99
|
+
rubygems_version: 2.7.3
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: Mounts and configures modules
|