rfcxml 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/roundtrip.yml +79 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +9 -3
- data/.rubocop_todo.yml +86 -20
- data/Gemfile +3 -1
- data/README.adoc +255 -35
- data/Rakefile +55 -0
- data/lib/rfcxml/v3/abstract.rb +2 -1
- data/lib/rfcxml/v3/address.rb +2 -1
- data/lib/rfcxml/v3/annotation.rb +2 -1
- data/lib/rfcxml/v3/area.rb +1 -1
- data/lib/rfcxml/v3/artset.rb +2 -1
- data/lib/rfcxml/v3/artwork.rb +13 -10
- data/lib/rfcxml/v3/aside.rb +2 -1
- data/lib/rfcxml/v3/author.rb +16 -9
- data/lib/rfcxml/v3/back.rb +2 -1
- data/lib/rfcxml/v3/bcp14.rb +1 -1
- data/lib/rfcxml/v3/blockquote.rb +2 -1
- data/lib/rfcxml/v3/boilerplate.rb +2 -1
- data/lib/rfcxml/v3/br.rb +1 -1
- data/lib/rfcxml/v3/c.rb +2 -1
- data/lib/rfcxml/v3/city.rb +1 -1
- data/lib/rfcxml/v3/cityarea.rb +1 -1
- data/lib/rfcxml/v3/code.rb +1 -1
- data/lib/rfcxml/v3/contact.rb +2 -1
- data/lib/rfcxml/v3/country.rb +1 -1
- data/lib/rfcxml/v3/cref.rb +2 -1
- data/lib/rfcxml/v3/date.rb +4 -4
- data/lib/rfcxml/v3/dd.rb +2 -1
- data/lib/rfcxml/v3/displayreference.rb +1 -1
- data/lib/rfcxml/v3/dl.rb +2 -1
- data/lib/rfcxml/v3/dt.rb +2 -1
- data/lib/rfcxml/v3/email.rb +1 -1
- data/lib/rfcxml/v3/eref.rb +1 -1
- data/lib/rfcxml/v3/extaddr.rb +1 -1
- data/lib/rfcxml/v3/facsimile.rb +1 -1
- data/lib/rfcxml/v3/figure.rb +17 -11
- data/lib/rfcxml/v3/format.rb +1 -1
- data/lib/rfcxml/v3/front.rb +2 -1
- data/lib/rfcxml/v3/iref.rb +4 -3
- data/lib/rfcxml/v3/keyword.rb +1 -1
- data/lib/rfcxml/v3/li.rb +2 -1
- data/lib/rfcxml/v3/link.rb +1 -1
- data/lib/rfcxml/v3/list.rb +2 -1
- data/lib/rfcxml/v3/middle.rb +2 -1
- data/lib/rfcxml/v3/name.rb +2 -1
- data/lib/rfcxml/v3/note.rb +2 -1
- data/lib/rfcxml/v3/ol.rb +5 -2
- data/lib/rfcxml/v3/organization.rb +10 -5
- data/lib/rfcxml/v3/phone.rb +1 -1
- data/lib/rfcxml/v3/pobox.rb +1 -1
- data/lib/rfcxml/v3/postal.rb +2 -1
- data/lib/rfcxml/v3/postal_line.rb +1 -1
- data/lib/rfcxml/v3/postamble.rb +2 -1
- data/lib/rfcxml/v3/preamble.rb +2 -1
- data/lib/rfcxml/v3/refcontent.rb +2 -1
- data/lib/rfcxml/v3/reference.rb +7 -4
- data/lib/rfcxml/v3/referencegroup.rb +2 -1
- data/lib/rfcxml/v3/references.rb +2 -1
- data/lib/rfcxml/v3/region.rb +1 -1
- data/lib/rfcxml/v3/relref.rb +1 -1
- data/lib/rfcxml/v3/rfc.rb +60 -12
- data/lib/rfcxml/v3/section.rb +11 -4
- data/lib/rfcxml/v3/series_info.rb +5 -4
- data/lib/rfcxml/v3/sortingcode.rb +1 -1
- data/lib/rfcxml/v3/sourcecode.rb +13 -9
- data/lib/rfcxml/v3/spanx.rb +1 -1
- data/lib/rfcxml/v3/street.rb +1 -1
- data/lib/rfcxml/v3/strong.rb +2 -1
- data/lib/rfcxml/v3/sub.rb +2 -1
- data/lib/rfcxml/v3/sup.rb +2 -1
- data/lib/rfcxml/v3/table.rb +1 -1
- data/lib/rfcxml/v3/tbody.rb +1 -1
- data/lib/rfcxml/v3/td.rb +23 -4
- data/lib/rfcxml/v3/text.rb +2 -1
- data/lib/rfcxml/v3/texttable.rb +12 -6
- data/lib/rfcxml/v3/tfoot.rb +1 -1
- data/lib/rfcxml/v3/th.rb +1 -1
- data/lib/rfcxml/v3/thead.rb +1 -1
- data/lib/rfcxml/v3/title.rb +3 -2
- data/lib/rfcxml/v3/toc.rb +1 -1
- data/lib/rfcxml/v3/tr.rb +3 -1
- data/lib/rfcxml/v3/tt.rb +1 -1
- data/lib/rfcxml/v3/ttcol.rb +4 -2
- data/lib/rfcxml/v3/u.rb +1 -1
- data/lib/rfcxml/v3/ul.rb +10 -4
- data/lib/rfcxml/v3/uri.rb +1 -1
- data/lib/rfcxml/v3/vspace.rb +1 -1
- data/lib/rfcxml/v3/workgroup.rb +1 -1
- data/lib/rfcxml/v3/xref.rb +2 -1
- data/lib/rfcxml/version.rb +1 -1
- data/lib/rfcxml.rb +1 -0
- data/scripts/README.md +110 -0
- data/scripts/roundtrip_test.rb +361 -0
- metadata +5 -2
data/lib/rfcxml/v3/address.rb
CHANGED
data/lib/rfcxml/v3/annotation.rb
CHANGED
data/lib/rfcxml/v3/area.rb
CHANGED
data/lib/rfcxml/v3/artset.rb
CHANGED
data/lib/rfcxml/v3/artwork.rb
CHANGED
|
@@ -8,19 +8,21 @@ module Rfcxml
|
|
|
8
8
|
attribute :content, :string
|
|
9
9
|
attribute :anchor, :string
|
|
10
10
|
attribute :pn, :string
|
|
11
|
-
attribute :name, :string
|
|
12
|
-
attribute :type, :string
|
|
11
|
+
attribute :name, :string
|
|
12
|
+
attribute :type, :string
|
|
13
13
|
attribute :src, :string
|
|
14
|
-
attribute :align, :string,
|
|
15
|
-
attribute :alt, :string
|
|
16
|
-
attribute :width, :string
|
|
17
|
-
attribute :height, :string
|
|
14
|
+
attribute :align, :string, values: %w[left center right]
|
|
15
|
+
attribute :alt, :string
|
|
16
|
+
attribute :width, :string
|
|
17
|
+
attribute :height, :string
|
|
18
18
|
attribute :original_src, :string
|
|
19
19
|
|
|
20
20
|
xml do
|
|
21
|
-
|
|
21
|
+
element "artwork"
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
# Use map_all to capture both text content AND child elements like <svg>
|
|
24
|
+
# map_content only captures text nodes, not child elements
|
|
25
|
+
map_all to: :content
|
|
24
26
|
map_attribute "anchor", to: :anchor
|
|
25
27
|
map_attribute "pn", to: :pn
|
|
26
28
|
map_attribute "name", to: :name, value_map: { to: { empty: :empty } }
|
|
@@ -28,8 +30,9 @@ module Rfcxml
|
|
|
28
30
|
map_attribute "src", to: :src
|
|
29
31
|
map_attribute "align", to: :align
|
|
30
32
|
map_attribute "alt", to: :alt, value_map: { to: { empty: :empty } }
|
|
31
|
-
map_attribute "width", to: :width
|
|
32
|
-
map_attribute "height", to: :height
|
|
33
|
+
map_attribute "width", to: :width, value_map: { to: { empty: :empty } }
|
|
34
|
+
map_attribute "height", to: :height,
|
|
35
|
+
value_map: { to: { empty: :empty } }
|
|
33
36
|
map_attribute "originalSrc", to: :original_src
|
|
34
37
|
end
|
|
35
38
|
end
|
data/lib/rfcxml/v3/aside.rb
CHANGED
data/lib/rfcxml/v3/author.rb
CHANGED
|
@@ -11,22 +11,29 @@ module Rfcxml
|
|
|
11
11
|
attribute :surname, :string
|
|
12
12
|
attribute :ascii_surname, :string
|
|
13
13
|
attribute :fullname, :string
|
|
14
|
-
attribute :role, :string
|
|
14
|
+
attribute :role, :string, values: %w[editor]
|
|
15
15
|
attribute :ascii_fullname, :string
|
|
16
16
|
attribute :organization, Organization
|
|
17
17
|
attribute :address, Address
|
|
18
18
|
|
|
19
19
|
xml do
|
|
20
|
-
|
|
20
|
+
element "author"
|
|
21
|
+
ordered
|
|
21
22
|
|
|
22
23
|
map_attribute "anchor", to: :anchor
|
|
23
|
-
map_attribute "initials", to: :initials
|
|
24
|
-
|
|
25
|
-
map_attribute "
|
|
26
|
-
|
|
27
|
-
map_attribute "
|
|
28
|
-
|
|
29
|
-
map_attribute "
|
|
24
|
+
map_attribute "initials", to: :initials,
|
|
25
|
+
value_map: { to: { empty: :empty } }
|
|
26
|
+
map_attribute "asciiInitials", to: :ascii_initials,
|
|
27
|
+
value_map: { to: { empty: :empty } }
|
|
28
|
+
map_attribute "surname", to: :surname,
|
|
29
|
+
value_map: { to: { empty: :empty } }
|
|
30
|
+
map_attribute "asciiSurname", to: :ascii_surname,
|
|
31
|
+
value_map: { to: { empty: :empty } }
|
|
32
|
+
map_attribute "fullname", to: :fullname,
|
|
33
|
+
value_map: { to: { empty: :empty } }
|
|
34
|
+
map_attribute "role", to: :role, value_map: { to: { empty: :empty } }
|
|
35
|
+
map_attribute "asciiFullname", to: :ascii_fullname,
|
|
36
|
+
value_map: { to: { empty: :empty } }
|
|
30
37
|
map_element "organization", to: :organization
|
|
31
38
|
map_element "address", to: :address
|
|
32
39
|
end
|
data/lib/rfcxml/v3/back.rb
CHANGED
data/lib/rfcxml/v3/bcp14.rb
CHANGED
data/lib/rfcxml/v3/blockquote.rb
CHANGED
data/lib/rfcxml/v3/br.rb
CHANGED
data/lib/rfcxml/v3/c.rb
CHANGED
data/lib/rfcxml/v3/city.rb
CHANGED
data/lib/rfcxml/v3/cityarea.rb
CHANGED
data/lib/rfcxml/v3/code.rb
CHANGED
data/lib/rfcxml/v3/contact.rb
CHANGED
data/lib/rfcxml/v3/country.rb
CHANGED
data/lib/rfcxml/v3/cref.rb
CHANGED
data/lib/rfcxml/v3/date.rb
CHANGED
|
@@ -11,12 +11,12 @@ module Rfcxml
|
|
|
11
11
|
attribute :year, :string
|
|
12
12
|
|
|
13
13
|
xml do
|
|
14
|
-
|
|
14
|
+
element "date"
|
|
15
15
|
|
|
16
16
|
map_content to: :content
|
|
17
|
-
map_attribute "day", to: :day
|
|
18
|
-
map_attribute "month", to: :month
|
|
19
|
-
map_attribute "year", to: :year
|
|
17
|
+
map_attribute "day", to: :day, value_map: { to: { empty: :empty } }
|
|
18
|
+
map_attribute "month", to: :month, value_map: { to: { empty: :empty } }
|
|
19
|
+
map_attribute "year", to: :year, value_map: { to: { empty: :empty } }
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
end
|
data/lib/rfcxml/v3/dd.rb
CHANGED
data/lib/rfcxml/v3/dl.rb
CHANGED
data/lib/rfcxml/v3/dt.rb
CHANGED
data/lib/rfcxml/v3/email.rb
CHANGED
data/lib/rfcxml/v3/eref.rb
CHANGED
data/lib/rfcxml/v3/extaddr.rb
CHANGED
data/lib/rfcxml/v3/facsimile.rb
CHANGED
data/lib/rfcxml/v3/figure.rb
CHANGED
|
@@ -7,14 +7,18 @@ module Rfcxml
|
|
|
7
7
|
class Figure < Lutaml::Model::Serializable
|
|
8
8
|
attribute :anchor, :string
|
|
9
9
|
attribute :pn, :string
|
|
10
|
-
attribute :title, :string
|
|
11
|
-
attribute :suppress_title, :string,
|
|
10
|
+
attribute :title, :string
|
|
11
|
+
attribute :suppress_title, :string,
|
|
12
|
+
values: %w[true false],
|
|
13
|
+
default: -> { "false" }
|
|
12
14
|
attribute :src, :string
|
|
13
15
|
attribute :original_src, :string
|
|
14
|
-
attribute :align, :string,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
attribute :
|
|
16
|
+
attribute :align, :string,
|
|
17
|
+
values: %w[left center right],
|
|
18
|
+
default: -> { "left" }
|
|
19
|
+
attribute :alt, :string
|
|
20
|
+
attribute :width, :string
|
|
21
|
+
attribute :height, :string
|
|
18
22
|
attribute :name, Name
|
|
19
23
|
attribute :iref, Iref, collection: true
|
|
20
24
|
attribute :preamble, Preamble
|
|
@@ -24,18 +28,20 @@ module Rfcxml
|
|
|
24
28
|
attribute :postamble, Postamble
|
|
25
29
|
|
|
26
30
|
xml do
|
|
27
|
-
|
|
31
|
+
element "figure"
|
|
32
|
+
ordered
|
|
28
33
|
|
|
29
34
|
map_attribute "anchor", to: :anchor
|
|
30
35
|
map_attribute "pn", to: :pn
|
|
31
|
-
map_attribute "title", to: :title
|
|
36
|
+
map_attribute "title", to: :title, value_map: { to: { empty: :empty } }
|
|
32
37
|
map_attribute "suppress-title", to: :suppress_title
|
|
33
38
|
map_attribute "src", to: :src
|
|
34
39
|
map_attribute "originalSrc", to: :original_src
|
|
35
40
|
map_attribute "align", to: :align
|
|
36
|
-
map_attribute "alt", to: :alt
|
|
37
|
-
map_attribute "width", to: :width
|
|
38
|
-
map_attribute "height", to: :height
|
|
41
|
+
map_attribute "alt", to: :alt, value_map: { to: { empty: :empty } }
|
|
42
|
+
map_attribute "width", to: :width, value_map: { to: { empty: :empty } }
|
|
43
|
+
map_attribute "height", to: :height,
|
|
44
|
+
value_map: { to: { empty: :empty } }
|
|
39
45
|
|
|
40
46
|
%w[name iref preamble artset artwork sourcecode
|
|
41
47
|
postamble].each do |element|
|
data/lib/rfcxml/v3/format.rb
CHANGED
data/lib/rfcxml/v3/front.rb
CHANGED
data/lib/rfcxml/v3/iref.rb
CHANGED
|
@@ -6,15 +6,16 @@ module Rfcxml
|
|
|
6
6
|
module V3
|
|
7
7
|
class Iref < Lutaml::Model::Serializable
|
|
8
8
|
attribute :item, :string
|
|
9
|
-
attribute :subitem, :string
|
|
9
|
+
attribute :subitem, :string
|
|
10
10
|
attribute :primary, :string, default: -> { "false" }
|
|
11
11
|
attribute :pn, :string
|
|
12
12
|
|
|
13
13
|
xml do
|
|
14
|
-
|
|
14
|
+
element "iref"
|
|
15
15
|
|
|
16
16
|
map_attribute "item", to: :item
|
|
17
|
-
map_attribute "subitem", to: :subitem
|
|
17
|
+
map_attribute "subitem", to: :subitem,
|
|
18
|
+
value_map: { to: { empty: :empty } }
|
|
18
19
|
map_attribute "primary", to: :primary
|
|
19
20
|
map_attribute "pn", to: :pn
|
|
20
21
|
end
|
data/lib/rfcxml/v3/keyword.rb
CHANGED
data/lib/rfcxml/v3/li.rb
CHANGED
data/lib/rfcxml/v3/link.rb
CHANGED
data/lib/rfcxml/v3/list.rb
CHANGED
data/lib/rfcxml/v3/middle.rb
CHANGED
data/lib/rfcxml/v3/name.rb
CHANGED
data/lib/rfcxml/v3/note.rb
CHANGED
data/lib/rfcxml/v3/ol.rb
CHANGED
|
@@ -9,13 +9,16 @@ module Rfcxml
|
|
|
9
9
|
attribute :type, :string, default: -> { "1" }
|
|
10
10
|
attribute :start, :string, default: -> { "1" }
|
|
11
11
|
attribute :group, :string
|
|
12
|
-
attribute :spacing, :string,
|
|
12
|
+
attribute :spacing, :string,
|
|
13
|
+
values: %w[normal compact],
|
|
14
|
+
default: -> { "normal" }
|
|
13
15
|
attribute :indent, :string, default: -> { "adaptive" }
|
|
14
16
|
attribute :pn, :string
|
|
15
17
|
attribute :li, Li, collection: true
|
|
16
18
|
|
|
17
19
|
xml do
|
|
18
|
-
|
|
20
|
+
element "ol"
|
|
21
|
+
ordered
|
|
19
22
|
|
|
20
23
|
map_attribute "anchor", to: :anchor
|
|
21
24
|
map_attribute "type", to: :type
|
|
@@ -9,15 +9,20 @@ module Rfcxml
|
|
|
9
9
|
attribute :abbrev, :string
|
|
10
10
|
attribute :ascii, :string
|
|
11
11
|
attribute :ascii_abbrev, :string
|
|
12
|
-
attribute :show_on_front_page, :string,
|
|
12
|
+
attribute :show_on_front_page, :string,
|
|
13
|
+
values: %w[true false],
|
|
14
|
+
default: -> { "true" }
|
|
13
15
|
|
|
14
16
|
xml do
|
|
15
|
-
|
|
17
|
+
element "organization"
|
|
18
|
+
mixed_content
|
|
16
19
|
|
|
17
20
|
map_content to: :content
|
|
18
|
-
map_attribute "abbrev", to: :abbrev
|
|
19
|
-
|
|
20
|
-
map_attribute "
|
|
21
|
+
map_attribute "abbrev", to: :abbrev,
|
|
22
|
+
value_map: { to: { empty: :empty } }
|
|
23
|
+
map_attribute "ascii", to: :ascii, value_map: { to: { empty: :empty } }
|
|
24
|
+
map_attribute "asciiAbbrev", to: :ascii_abbrev,
|
|
25
|
+
value_map: { to: { empty: :empty } }
|
|
21
26
|
map_attribute "showOnFrontPage", to: :show_on_front_page
|
|
22
27
|
end
|
|
23
28
|
end
|
data/lib/rfcxml/v3/phone.rb
CHANGED
data/lib/rfcxml/v3/pobox.rb
CHANGED
data/lib/rfcxml/v3/postal.rb
CHANGED
data/lib/rfcxml/v3/postamble.rb
CHANGED