attributor-flatpack 1.2.0 → 1.2.1
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a37ffa718fb1d4c654994475aae6d29c1c58f303
|
4
|
+
data.tar.gz: 1c3383756317c34d64fb58569f84290aa55d955e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df68bfef26a9fcd05bd5abc29246a4a5358cbd215ff7a9757545daed4683b5b08bf45eb44f3c95149cc76d04ad7422c94681506201f83dc449808d2e82f4cc3c
|
7
|
+
data.tar.gz: 1451ec4ad454938ff1acefbe0e6cc3cdb5aad964a48c762fadf9a7f90fefc72fea5d01a24d8062a4d2ef6ab67a013f3d843579a3d2fba96b635e96bcfd51b9bd
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Attributor
|
2
2
|
module Flatpack
|
3
3
|
class Config < Attributor::Hash
|
4
|
-
|
4
|
+
@separator = '_'.freeze
|
5
5
|
@key_type = Symbol
|
6
6
|
|
7
7
|
class << self
|
@@ -14,8 +14,9 @@ module Attributor
|
|
14
14
|
|
15
15
|
def self.inherited(klass)
|
16
16
|
super
|
17
|
+
sep = self.separator
|
17
18
|
klass.instance_eval do
|
18
|
-
@separator =
|
19
|
+
@separator = sep
|
19
20
|
end
|
20
21
|
klass.options[:dsl_compiler] = ConfigDSLCompiler
|
21
22
|
end
|
@@ -42,7 +43,6 @@ module Attributor
|
|
42
43
|
def define_reader(name)
|
43
44
|
attribute = self.class.keys[name]
|
44
45
|
context = default_context(name)
|
45
|
-
|
46
46
|
define_singleton_method(name) do
|
47
47
|
get(name, attribute: attribute, context: context)
|
48
48
|
end
|
@@ -7,7 +7,13 @@ module Attributor
|
|
7
7
|
raise ArgumentError, "Invalid key: #{name.inspect}, " \
|
8
8
|
"must be instance of #{native_key}"
|
9
9
|
end
|
10
|
-
|
10
|
+
if attr_type.nil? && block
|
11
|
+
sep = target.separator
|
12
|
+
# Ensure class for subkeys uses the same separator as the parent
|
13
|
+
attr_type = ::Class.new(Attributor::Flatpack::Config) do
|
14
|
+
separator sep
|
15
|
+
end
|
16
|
+
end
|
11
17
|
target.keys[name] = define(name, attr_type, **opts, &block)
|
12
18
|
end
|
13
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attributor-flatpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dane Jensen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: attributor
|