tdc 0.4.1 → 0.4.2

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
  SHA256:
3
- metadata.gz: f00288e8e5b9fd0db193bd5cb1f861dc54decc8966acc22a7b3c0ca37107970c
4
- data.tar.gz: 8e57f9daa09264951dc05b6f0addab100a885dd9ca4de1a49466bf34e97b74a4
3
+ metadata.gz: 83b4405ab9ec996fbab35d7228931e03d5bf18966df916b631d36d6aecca4393
4
+ data.tar.gz: 942728ff3d354bb5dc516c777606766b798ae218b4fd85ec4823cfad7e9d1875
5
5
  SHA512:
6
- metadata.gz: 998df3b2cec606f557721fef093730ec59c038b492bc66087dea92793c0d5767dae2d2fa6b06edce00aa105e586597f92e71f5dd7624a7fd03ad6819c07a0435
7
- data.tar.gz: f183c0656d49e69ad0c7834da267d2491ca2a58339a1cd820dd639459f7bfba7cf07a15df9cbe98d9749b1add54a5b03daa4a6815a70650286f52ed954595604
6
+ metadata.gz: 1a783d54d2a3af00fcd0d8366b1a55190503fda3350308179f5eb778f2fab6f3601b7c6eded92bd27a123a39303160ffa19381902228e8e11ab5f4213deda20c
7
+ data.tar.gz: 5cc30405e4369c739e5a77370bf663d0813a2a72e2bdbaa7791bd8c1f966c5337c477689c4f968b82d20ee41bc3d22f94baa0731fb0d38948f6001137d4f56c6
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.4.2] - 2020-08-22
10
+
11
+ - Extended attributes use `_xa` suffix
12
+
9
13
  ## [0.4.1] - 2020-08-22
10
14
 
11
15
  - Add the `first` method to `CatalogEntries`
@@ -7,7 +7,7 @@ module Tdc
7
7
  #
8
8
  class DefaultInterpreter < Tdc::ExtendedAttributes::InterpreterBase
9
9
  def interpret(instance_definition)
10
- extended_attribute_definitions = keep_extended_attributes_from(instance_definition)
10
+ extended_attribute_definitions = keep_extended_attributes(instance_definition)
11
11
 
12
12
  extended_attribute_definitions.each do |extended_attribute_key, extended_attribute_value|
13
13
  # Remove the extended attribute.
@@ -20,23 +20,27 @@ module Tdc
20
20
  end
21
21
 
22
22
  concerning :HookMethods do
23
- def convert_to_standard_attribute(extended_attribute_key)
24
- extended_attribute_key.gsub(/_(at|date|on)x$/, "_\\1")
25
- end
26
-
27
23
  def extended_attribute_context
28
24
  Time.zone
29
25
  end
30
-
31
- def extended_attribute?(extended_attribute_key)
32
- /_(at|date|on)x$/ =~ extended_attribute_key
33
- end
34
26
  end
35
27
 
36
28
  private
37
29
 
38
- def keep_extended_attributes_from(instance_definition)
39
- instance_definition.select { |extended_attribute_key, _| extended_attribute?(extended_attribute_key) }
30
+ EXTENDED_ATTRIBUTE_SUFFIX = "_xa"
31
+
32
+ def convert_to_standard_attribute(extended_attribute_key)
33
+ extended_attribute_key.delete_suffix(EXTENDED_ATTRIBUTE_SUFFIX)
34
+ end
35
+
36
+ def extended_attribute?(extended_attribute_key)
37
+ extended_attribute_key.end_with?(EXTENDED_ATTRIBUTE_SUFFIX)
38
+ end
39
+
40
+ def keep_extended_attributes(instance_definition)
41
+ instance_definition.select do |extended_attribute_key, _|
42
+ extended_attribute?(extended_attribute_key)
43
+ end
40
44
  end
41
45
  end
42
46
  end
@@ -1,3 +1,3 @@
1
1
  module Tdc
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alistair McKinnell