usable 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/usable/config.rb +11 -1
- data/lib/usable/version.rb +1 -1
- data/lib/usable.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33cffc63217bfad4d6b90e50f2e1d3651e93a64f
|
4
|
+
data.tar.gz: 313140dd2d024f0d2f7d3cd52c2cb3449d13d979
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61d7f8a61d3bbfe2caa0e7577e411596e293333cc2a2419c989c57845c53cf22973cd6476ef28aa58826586df814ce0107150d333c3b5ce59908bfd8e6ac3e92
|
7
|
+
data.tar.gz: 61143864455490a58c8526e0b5f2216cdfb3dc7c829b8e1b108832c5f5b4fd714868799353f9e339d2ad76fbd9219955d4c996077557e1c1bdddd0cadc043e63
|
data/lib/usable/config.rb
CHANGED
@@ -10,6 +10,7 @@ module Usable
|
|
10
10
|
|
11
11
|
def initialize
|
12
12
|
@spec = OpenStruct.new
|
13
|
+
@lazy_loads = Set.new
|
13
14
|
end
|
14
15
|
|
15
16
|
def each(&block)
|
@@ -37,13 +38,22 @@ module Usable
|
|
37
38
|
spec key, val
|
38
39
|
end
|
39
40
|
|
41
|
+
def to_h
|
42
|
+
@lazy_loads.each { |key| spec(key) }
|
43
|
+
_spec.to_h
|
44
|
+
end
|
45
|
+
|
46
|
+
alias to_hash to_h
|
47
|
+
|
40
48
|
def call_lazy_method(key)
|
41
|
-
@
|
49
|
+
@lazy_loads.delete key
|
50
|
+
@spec.public_send key.to_s.tr('=', '')
|
42
51
|
end
|
43
52
|
|
44
53
|
def method_missing(method_name, *args, &block)
|
45
54
|
if block
|
46
55
|
_spec.define_singleton_method(method_name) { yield }
|
56
|
+
@lazy_loads << method_name
|
47
57
|
else
|
48
58
|
spec method_name, *args
|
49
59
|
end
|
data/lib/usable/version.rb
CHANGED
data/lib/usable.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.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Buckley
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|