shale 0.6.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +27 -0
- data/LICENSE.txt +1 -1
- data/README.md +222 -30
- data/lib/shale/adapter/json.rb +3 -3
- data/lib/shale/adapter/nokogiri.rb +6 -5
- data/lib/shale/adapter/ox.rb +5 -4
- data/lib/shale/adapter/rexml/document.rb +1 -1
- data/lib/shale/adapter/rexml.rb +5 -4
- data/lib/shale/error.rb +8 -3
- data/lib/shale/mapper.rb +5 -1
- data/lib/shale/mapping/descriptor/dict.rb +21 -1
- data/lib/shale/mapping/descriptor/xml.rb +20 -2
- data/lib/shale/mapping/dict.rb +14 -40
- data/lib/shale/mapping/dict_base.rb +73 -0
- data/lib/shale/mapping/dict_group.rb +41 -0
- data/lib/shale/mapping/group/dict.rb +55 -0
- data/lib/shale/mapping/group/dict_grouping.rb +41 -0
- data/lib/shale/mapping/group/xml.rb +43 -0
- data/lib/shale/mapping/group/xml_grouping.rb +27 -0
- data/lib/shale/mapping/xml.rb +53 -154
- data/lib/shale/mapping/xml_base.rb +227 -0
- data/lib/shale/mapping/xml_group.rb +70 -0
- data/lib/shale/schema/json_generator.rb +1 -3
- data/lib/shale/schema/xml_generator/import.rb +2 -2
- data/lib/shale/schema/xml_generator.rb +4 -6
- data/lib/shale/type/complex.rb +469 -84
- data/lib/shale/type/date.rb +2 -2
- data/lib/shale/type/time.rb +2 -2
- data/lib/shale/type/value.rb +10 -10
- data/lib/shale/version.rb +1 -1
- data/shale.gemspec +1 -1
- metadata +11 -3
data/lib/shale/type/date.rb
CHANGED
@@ -32,7 +32,7 @@ module Shale
|
|
32
32
|
# @return [String]
|
33
33
|
#
|
34
34
|
# @api private
|
35
|
-
def self.as_json(value)
|
35
|
+
def self.as_json(value, **)
|
36
36
|
value&.iso8601
|
37
37
|
end
|
38
38
|
|
@@ -43,7 +43,7 @@ module Shale
|
|
43
43
|
# @return [String]
|
44
44
|
#
|
45
45
|
# @api private
|
46
|
-
def self.as_yaml(value)
|
46
|
+
def self.as_yaml(value, **)
|
47
47
|
value&.iso8601
|
48
48
|
end
|
49
49
|
|
data/lib/shale/type/time.rb
CHANGED
@@ -32,7 +32,7 @@ module Shale
|
|
32
32
|
# @return [String]
|
33
33
|
#
|
34
34
|
# @api private
|
35
|
-
def self.as_json(value)
|
35
|
+
def self.as_json(value, **)
|
36
36
|
value&.iso8601
|
37
37
|
end
|
38
38
|
|
@@ -43,7 +43,7 @@ module Shale
|
|
43
43
|
# @return [String]
|
44
44
|
#
|
45
45
|
# @api private
|
46
|
-
def self.as_yaml(value)
|
46
|
+
def self.as_yaml(value, **)
|
47
47
|
value&.iso8601
|
48
48
|
end
|
49
49
|
|
data/lib/shale/type/value.rb
CHANGED
@@ -30,7 +30,7 @@ module Shale
|
|
30
30
|
# @return [any]
|
31
31
|
#
|
32
32
|
# @api private
|
33
|
-
def of_hash(value)
|
33
|
+
def of_hash(value, **)
|
34
34
|
value
|
35
35
|
end
|
36
36
|
|
@@ -41,7 +41,7 @@ module Shale
|
|
41
41
|
# @return [any]
|
42
42
|
#
|
43
43
|
# @api private
|
44
|
-
def as_hash(value)
|
44
|
+
def as_hash(value, **)
|
45
45
|
value
|
46
46
|
end
|
47
47
|
|
@@ -52,7 +52,7 @@ module Shale
|
|
52
52
|
# @return [any]
|
53
53
|
#
|
54
54
|
# @api private
|
55
|
-
def of_json(value)
|
55
|
+
def of_json(value, **)
|
56
56
|
value
|
57
57
|
end
|
58
58
|
|
@@ -63,7 +63,7 @@ module Shale
|
|
63
63
|
# @return [any]
|
64
64
|
#
|
65
65
|
# @api private
|
66
|
-
def as_json(value)
|
66
|
+
def as_json(value, **)
|
67
67
|
value
|
68
68
|
end
|
69
69
|
|
@@ -74,7 +74,7 @@ module Shale
|
|
74
74
|
# @return [any]
|
75
75
|
#
|
76
76
|
# @api private
|
77
|
-
def of_yaml(value)
|
77
|
+
def of_yaml(value, **)
|
78
78
|
value
|
79
79
|
end
|
80
80
|
|
@@ -85,7 +85,7 @@ module Shale
|
|
85
85
|
# @return [any]
|
86
86
|
#
|
87
87
|
# @api private
|
88
|
-
def as_yaml(value)
|
88
|
+
def as_yaml(value, **)
|
89
89
|
value
|
90
90
|
end
|
91
91
|
|
@@ -96,7 +96,7 @@ module Shale
|
|
96
96
|
# @return [any]
|
97
97
|
#
|
98
98
|
# @api private
|
99
|
-
def of_toml(value)
|
99
|
+
def of_toml(value, **)
|
100
100
|
value
|
101
101
|
end
|
102
102
|
|
@@ -107,7 +107,7 @@ module Shale
|
|
107
107
|
# @return [any]
|
108
108
|
#
|
109
109
|
# @api private
|
110
|
-
def as_toml(value)
|
110
|
+
def as_toml(value, **)
|
111
111
|
value
|
112
112
|
end
|
113
113
|
|
@@ -118,7 +118,7 @@ module Shale
|
|
118
118
|
# @return [String]
|
119
119
|
#
|
120
120
|
# @api private
|
121
|
-
def of_xml(node)
|
121
|
+
def of_xml(node, **)
|
122
122
|
node.text
|
123
123
|
end
|
124
124
|
|
@@ -141,7 +141,7 @@ module Shale
|
|
141
141
|
# @param [true, false] cdata
|
142
142
|
#
|
143
143
|
# @api private
|
144
|
-
def as_xml(value, name, doc, cdata = false)
|
144
|
+
def as_xml(value, name, doc, cdata = false, **)
|
145
145
|
element = doc.create_element(name)
|
146
146
|
|
147
147
|
if cdata
|
data/lib/shale/version.rb
CHANGED
data/shale.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shale
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kamil Giszczak
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby object mapper and serializer for XML, JSON, TOML and YAML.
|
14
14
|
email:
|
@@ -41,8 +41,16 @@ files:
|
|
41
41
|
- lib/shale/mapping/descriptor/xml.rb
|
42
42
|
- lib/shale/mapping/descriptor/xml_namespace.rb
|
43
43
|
- lib/shale/mapping/dict.rb
|
44
|
+
- lib/shale/mapping/dict_base.rb
|
45
|
+
- lib/shale/mapping/dict_group.rb
|
46
|
+
- lib/shale/mapping/group/dict.rb
|
47
|
+
- lib/shale/mapping/group/dict_grouping.rb
|
48
|
+
- lib/shale/mapping/group/xml.rb
|
49
|
+
- lib/shale/mapping/group/xml_grouping.rb
|
44
50
|
- lib/shale/mapping/validator.rb
|
45
51
|
- lib/shale/mapping/xml.rb
|
52
|
+
- lib/shale/mapping/xml_base.rb
|
53
|
+
- lib/shale/mapping/xml_group.rb
|
46
54
|
- lib/shale/schema.rb
|
47
55
|
- lib/shale/schema/compiler/boolean.rb
|
48
56
|
- lib/shale/schema/compiler/complex.rb
|
@@ -108,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
108
116
|
requirements:
|
109
117
|
- - ">="
|
110
118
|
- !ruby/object:Gem::Version
|
111
|
-
version: 2.
|
119
|
+
version: 2.6.0
|
112
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
121
|
requirements:
|
114
122
|
- - ">="
|