tdc 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/tdc/generators/definition_sourcable.rb +16 -6
- data/lib/tdc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f5936018f214ecc5b2c99c96aaeaa02b01b1376ba09266202b82662dc3f0cce
|
4
|
+
data.tar.gz: f2572c85877de786307abe6ad4b3e7720cc9d3acd02398523f4d779e0dbbdf57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85846a6e8b1d30f3ed7eaeb893f4cc9cc3982723789c47bae6673fa91b65e54f7f0c4de8d05cd0f2989a2165ebb952b4311cabd22e0f38aabcea337bb39e158e
|
7
|
+
data.tar.gz: b05b075225180aa3711691d3ac6000cc9f9a2508fb11b82a6e01dd864092e42624e0b8bb157b4a03c139629a87711b4a083ad83f3e42eb1da78edd26a26b57aa
|
data/CHANGELOG.md
CHANGED
@@ -6,8 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.4.3] - 2020-08-25
|
10
|
+
|
11
|
+
#### New Features
|
12
|
+
|
13
|
+
- Support optional definitions
|
14
|
+
|
9
15
|
## [0.4.2] - 2020-08-22
|
10
16
|
|
17
|
+
#### Breaking Changes
|
18
|
+
|
11
19
|
- Extended attributes use `_xa` suffix
|
12
20
|
|
13
21
|
## [0.4.1] - 2020-08-22
|
@@ -33,20 +33,30 @@ module Tdc
|
|
33
33
|
private
|
34
34
|
|
35
35
|
def method_missing(method, *args)
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
if definition?(method)
|
37
|
+
definition_source.fetch(method.to_s.gsub(/_definition$/, ""))
|
38
|
+
elsif optional_definition?(method)
|
39
|
+
definition_source[method.to_s.gsub(/_definition_optional$/, "")]
|
40
|
+
else
|
41
|
+
super
|
42
|
+
end
|
39
43
|
end
|
40
44
|
|
41
45
|
def respond_to_missing?(method, include_all = false) # rubocop:disable Style/OptionalBooleanParameter
|
42
|
-
|
43
|
-
|
44
|
-
definition_source&.key?(key) ? true : super
|
46
|
+
definition?(method) || definition_optional?(method) ? true : super
|
45
47
|
end
|
46
48
|
|
47
49
|
def transform_method_to_definition_source_key(method)
|
48
50
|
method.to_s.gsub(/_definition$/, "")
|
49
51
|
end
|
52
|
+
|
53
|
+
def definition?(method)
|
54
|
+
method.to_s.end_with?("_definition")
|
55
|
+
end
|
56
|
+
|
57
|
+
def optional_definition?(method)
|
58
|
+
method.to_s.end_with?("_definition_optional")
|
59
|
+
end
|
50
60
|
end
|
51
61
|
end
|
52
62
|
end
|
data/lib/tdc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tdc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alistair McKinnell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|