comicinfo 1.0.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 +7 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +41 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/LICENSE.md +21 -0
- data/README.md +295 -0
- data/Rakefile +10 -0
- data/doc/development.md +255 -0
- data/lib/comicinfo/enums.rb +169 -0
- data/lib/comicinfo/errors.rb +64 -0
- data/lib/comicinfo/issue.rb +332 -0
- data/lib/comicinfo/page.rb +182 -0
- data/lib/comicinfo/version.rb +3 -0
- data/lib/comicinfo.rb +15 -0
- data/schemas/1.0/ComicInfo.xsd +77 -0
- data/schemas/2.0/ComicInfo.xsd +123 -0
- data/schemas/2.1-draft/ComicInfo.xsd +127 -0
- data/script/schema +95 -0
- data/sig/comicinfo.rbs +4 -0
- metadata +79 -0
@@ -0,0 +1,123 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
3
|
+
<xs:element name="ComicInfo" nillable="true" type="ComicInfo"/>
|
4
|
+
<xs:complexType name="ComicInfo">
|
5
|
+
<xs:sequence>
|
6
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Title" type="xs:string"/>
|
7
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Series" type="xs:string"/>
|
8
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Number" type="xs:string"/>
|
9
|
+
<xs:element minOccurs="0" maxOccurs="1" default="-1" name="Count" type="xs:int"/>
|
10
|
+
<xs:element minOccurs="0" maxOccurs="1" default="-1" name="Volume" type="xs:int"/>
|
11
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="AlternateSeries" type="xs:string"/>
|
12
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="AlternateNumber" type="xs:string"/>
|
13
|
+
<xs:element minOccurs="0" maxOccurs="1" default="-1" name="AlternateCount" type="xs:int"/>
|
14
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Summary" type="xs:string"/>
|
15
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Notes" type="xs:string"/>
|
16
|
+
<xs:element minOccurs="0" maxOccurs="1" default="-1" name="Year" type="xs:int"/>
|
17
|
+
<xs:element minOccurs="0" maxOccurs="1" default="-1" name="Month" type="xs:int"/>
|
18
|
+
<xs:element minOccurs="0" maxOccurs="1" default="-1" name="Day" type="xs:int"/>
|
19
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Writer" type="xs:string"/>
|
20
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Penciller" type="xs:string"/>
|
21
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Inker" type="xs:string"/>
|
22
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Colorist" type="xs:string"/>
|
23
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Letterer" type="xs:string"/>
|
24
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="CoverArtist" type="xs:string"/>
|
25
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Editor" type="xs:string"/>
|
26
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Publisher" type="xs:string"/>
|
27
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Imprint" type="xs:string"/>
|
28
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Genre" type="xs:string"/>
|
29
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Web" type="xs:string"/>
|
30
|
+
<xs:element minOccurs="0" maxOccurs="1" default="0" name="PageCount" type="xs:int"/>
|
31
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="LanguageISO" type="xs:string"/>
|
32
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Format" type="xs:string"/>
|
33
|
+
<xs:element minOccurs="0" maxOccurs="1" default="Unknown" name="BlackAndWhite" type="YesNo"/>
|
34
|
+
<xs:element minOccurs="0" maxOccurs="1" default="Unknown" name="Manga" type="Manga"/>
|
35
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Characters" type="xs:string"/>
|
36
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Teams" type="xs:string"/>
|
37
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Locations" type="xs:string"/>
|
38
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="ScanInformation" type="xs:string"/>
|
39
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="StoryArc" type="xs:string"/>
|
40
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="SeriesGroup" type="xs:string"/>
|
41
|
+
<xs:element minOccurs="0" maxOccurs="1" default="Unknown" name="AgeRating" type="AgeRating"/>
|
42
|
+
<xs:element minOccurs="0" maxOccurs="1" name="Pages" type="ArrayOfComicPageInfo"/>
|
43
|
+
<xs:element minOccurs="0" maxOccurs="1" name="CommunityRating" type="Rating"/>
|
44
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="MainCharacterOrTeam" type="xs:string"/>
|
45
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Review" type="xs:string"/>
|
46
|
+
</xs:sequence>
|
47
|
+
</xs:complexType>
|
48
|
+
<xs:simpleType name="YesNo">
|
49
|
+
<xs:restriction base="xs:string">
|
50
|
+
<xs:enumeration value="Unknown"/>
|
51
|
+
<xs:enumeration value="No"/>
|
52
|
+
<xs:enumeration value="Yes"/>
|
53
|
+
</xs:restriction>
|
54
|
+
</xs:simpleType>
|
55
|
+
<xs:simpleType name="Manga">
|
56
|
+
<xs:restriction base="xs:string">
|
57
|
+
<xs:enumeration value="Unknown"/>
|
58
|
+
<xs:enumeration value="No"/>
|
59
|
+
<xs:enumeration value="Yes"/>
|
60
|
+
<xs:enumeration value="YesAndRightToLeft"/>
|
61
|
+
</xs:restriction>
|
62
|
+
</xs:simpleType>
|
63
|
+
<xs:simpleType name="Rating">
|
64
|
+
<xs:restriction base="xs:decimal">
|
65
|
+
<xs:minInclusive value="0"/>
|
66
|
+
<xs:maxInclusive value="5"/>
|
67
|
+
<xs:fractionDigits value="2"/>
|
68
|
+
</xs:restriction>
|
69
|
+
</xs:simpleType>
|
70
|
+
<xs:simpleType name="AgeRating">
|
71
|
+
<xs:restriction base="xs:string">
|
72
|
+
<xs:enumeration value="Unknown"/>
|
73
|
+
<xs:enumeration value="Adults Only 18+"/>
|
74
|
+
<xs:enumeration value="Early Childhood"/>
|
75
|
+
<xs:enumeration value="Everyone"/>
|
76
|
+
<xs:enumeration value="Everyone 10+"/>
|
77
|
+
<xs:enumeration value="G"/>
|
78
|
+
<xs:enumeration value="Kids to Adults"/>
|
79
|
+
<xs:enumeration value="M"/>
|
80
|
+
<xs:enumeration value="MA15+"/>
|
81
|
+
<xs:enumeration value="Mature 17+"/>
|
82
|
+
<xs:enumeration value="PG"/>
|
83
|
+
<xs:enumeration value="R18+"/>
|
84
|
+
<xs:enumeration value="Rating Pending"/>
|
85
|
+
<xs:enumeration value="Teen"/>
|
86
|
+
<xs:enumeration value="X18+"/>
|
87
|
+
</xs:restriction>
|
88
|
+
</xs:simpleType>
|
89
|
+
<xs:complexType name="ArrayOfComicPageInfo">
|
90
|
+
<xs:sequence>
|
91
|
+
<xs:element minOccurs="0" maxOccurs="unbounded" name="Page" nillable="true" type="ComicPageInfo"/>
|
92
|
+
</xs:sequence>
|
93
|
+
</xs:complexType>
|
94
|
+
<xs:complexType name="ComicPageInfo">
|
95
|
+
<xs:attribute name="Image" type="xs:int" use="required"/>
|
96
|
+
<xs:attribute default="Story" name="Type" type="ComicPageType"/>
|
97
|
+
<xs:attribute default="false" name="DoublePage" type="xs:boolean"/>
|
98
|
+
<xs:attribute default="0" name="ImageSize" type="xs:long"/>
|
99
|
+
<xs:attribute default="" name="Key" type="xs:string"/>
|
100
|
+
<xs:attribute default="" name="Bookmark" type="xs:string"/>
|
101
|
+
<xs:attribute default="-1" name="ImageWidth" type="xs:int"/>
|
102
|
+
<xs:attribute default="-1" name="ImageHeight" type="xs:int"/>
|
103
|
+
</xs:complexType>
|
104
|
+
<xs:simpleType name="ComicPageType">
|
105
|
+
<xs:list>
|
106
|
+
<xs:simpleType>
|
107
|
+
<xs:restriction base="xs:string">
|
108
|
+
<xs:enumeration value="FrontCover"/>
|
109
|
+
<xs:enumeration value="InnerCover"/>
|
110
|
+
<xs:enumeration value="Roundup"/>
|
111
|
+
<xs:enumeration value="Story"/>
|
112
|
+
<xs:enumeration value="Advertisement"/>
|
113
|
+
<xs:enumeration value="Editorial"/>
|
114
|
+
<xs:enumeration value="Letters"/>
|
115
|
+
<xs:enumeration value="Preview"/>
|
116
|
+
<xs:enumeration value="BackCover"/>
|
117
|
+
<xs:enumeration value="Other"/>
|
118
|
+
<xs:enumeration value="Deleted"/>
|
119
|
+
</xs:restriction>
|
120
|
+
</xs:simpleType>
|
121
|
+
</xs:list>
|
122
|
+
</xs:simpleType>
|
123
|
+
</xs:schema>
|
@@ -0,0 +1,127 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
3
|
+
<xs:element name="ComicInfo" nillable="true" type="ComicInfo"/>
|
4
|
+
<xs:complexType name="ComicInfo">
|
5
|
+
<xs:sequence>
|
6
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Title" type="xs:string"/>
|
7
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Series" type="xs:string"/>
|
8
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Number" type="xs:string"/>
|
9
|
+
<xs:element minOccurs="0" maxOccurs="1" default="-1" name="Count" type="xs:int"/>
|
10
|
+
<xs:element minOccurs="0" maxOccurs="1" default="-1" name="Volume" type="xs:int"/>
|
11
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="AlternateSeries" type="xs:string"/>
|
12
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="AlternateNumber" type="xs:string"/>
|
13
|
+
<xs:element minOccurs="0" maxOccurs="1" default="-1" name="AlternateCount" type="xs:int"/>
|
14
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Summary" type="xs:string"/>
|
15
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Notes" type="xs:string"/>
|
16
|
+
<xs:element minOccurs="0" maxOccurs="1" default="-1" name="Year" type="xs:int"/>
|
17
|
+
<xs:element minOccurs="0" maxOccurs="1" default="-1" name="Month" type="xs:int"/>
|
18
|
+
<xs:element minOccurs="0" maxOccurs="1" default="-1" name="Day" type="xs:int"/>
|
19
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Writer" type="xs:string"/>
|
20
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Penciller" type="xs:string"/>
|
21
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Inker" type="xs:string"/>
|
22
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Colorist" type="xs:string"/>
|
23
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Letterer" type="xs:string"/>
|
24
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="CoverArtist" type="xs:string"/>
|
25
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Editor" type="xs:string"/>
|
26
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Translator" type="xs:string"/>
|
27
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Publisher" type="xs:string"/>
|
28
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Imprint" type="xs:string"/>
|
29
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Genre" type="xs:string"/>
|
30
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Tags" type="xs:string"/>
|
31
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Web" type="xs:string"/>
|
32
|
+
<xs:element minOccurs="0" maxOccurs="1" default="0" name="PageCount" type="xs:int"/>
|
33
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="LanguageISO" type="xs:string"/>
|
34
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Format" type="xs:string"/>
|
35
|
+
<xs:element minOccurs="0" maxOccurs="1" default="Unknown" name="BlackAndWhite" type="YesNo"/>
|
36
|
+
<xs:element minOccurs="0" maxOccurs="1" default="Unknown" name="Manga" type="Manga"/>
|
37
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Characters" type="xs:string"/>
|
38
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Teams" type="xs:string"/>
|
39
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Locations" type="xs:string"/>
|
40
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="ScanInformation" type="xs:string"/>
|
41
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="StoryArc" type="xs:string"/>
|
42
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="StoryArcNumber" type="xs:string"/>
|
43
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="SeriesGroup" type="xs:string"/>
|
44
|
+
<xs:element minOccurs="0" maxOccurs="1" default="Unknown" name="AgeRating" type="AgeRating"/>
|
45
|
+
<xs:element minOccurs="0" maxOccurs="1" name="Pages" type="ArrayOfComicPageInfo"/>
|
46
|
+
<xs:element minOccurs="0" maxOccurs="1" name="CommunityRating" type="Rating"/>
|
47
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="MainCharacterOrTeam" type="xs:string"/>
|
48
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="Review" type="xs:string"/>
|
49
|
+
<xs:element minOccurs="0" maxOccurs="1" default="" name="GTIN" type="xs:string"/>
|
50
|
+
</xs:sequence>
|
51
|
+
</xs:complexType>
|
52
|
+
<xs:simpleType name="YesNo">
|
53
|
+
<xs:restriction base="xs:string">
|
54
|
+
<xs:enumeration value="Unknown"/>
|
55
|
+
<xs:enumeration value="No"/>
|
56
|
+
<xs:enumeration value="Yes"/>
|
57
|
+
</xs:restriction>
|
58
|
+
</xs:simpleType>
|
59
|
+
<xs:simpleType name="Manga">
|
60
|
+
<xs:restriction base="xs:string">
|
61
|
+
<xs:enumeration value="Unknown"/>
|
62
|
+
<xs:enumeration value="No"/>
|
63
|
+
<xs:enumeration value="Yes"/>
|
64
|
+
<xs:enumeration value="YesAndRightToLeft"/>
|
65
|
+
</xs:restriction>
|
66
|
+
</xs:simpleType>
|
67
|
+
<xs:simpleType name="Rating">
|
68
|
+
<xs:restriction base="xs:decimal">
|
69
|
+
<xs:minInclusive value="0"/>
|
70
|
+
<xs:maxInclusive value="5"/>
|
71
|
+
<xs:fractionDigits value="1"/>
|
72
|
+
</xs:restriction>
|
73
|
+
</xs:simpleType>
|
74
|
+
<xs:simpleType name="AgeRating">
|
75
|
+
<xs:restriction base="xs:string">
|
76
|
+
<xs:enumeration value="Unknown"/>
|
77
|
+
<xs:enumeration value="Adults Only 18+"/>
|
78
|
+
<xs:enumeration value="Early Childhood"/>
|
79
|
+
<xs:enumeration value="Everyone"/>
|
80
|
+
<xs:enumeration value="Everyone 10+"/>
|
81
|
+
<xs:enumeration value="G"/>
|
82
|
+
<xs:enumeration value="Kids to Adults"/>
|
83
|
+
<xs:enumeration value="M"/>
|
84
|
+
<xs:enumeration value="MA15+"/>
|
85
|
+
<xs:enumeration value="Mature 17+"/>
|
86
|
+
<xs:enumeration value="PG"/>
|
87
|
+
<xs:enumeration value="R18+"/>
|
88
|
+
<xs:enumeration value="Rating Pending"/>
|
89
|
+
<xs:enumeration value="Teen"/>
|
90
|
+
<xs:enumeration value="X18+"/>
|
91
|
+
</xs:restriction>
|
92
|
+
</xs:simpleType>
|
93
|
+
<xs:complexType name="ArrayOfComicPageInfo">
|
94
|
+
<xs:sequence>
|
95
|
+
<xs:element minOccurs="0" maxOccurs="unbounded" name="Page" nillable="true" type="ComicPageInfo"/>
|
96
|
+
</xs:sequence>
|
97
|
+
</xs:complexType>
|
98
|
+
<xs:complexType name="ComicPageInfo">
|
99
|
+
<xs:attribute name="Image" type="xs:int" use="required"/>
|
100
|
+
<xs:attribute default="Story" name="Type" type="ComicPageType"/>
|
101
|
+
<xs:attribute default="false" name="DoublePage" type="xs:boolean"/>
|
102
|
+
<xs:attribute default="0" name="ImageSize" type="xs:long"/>
|
103
|
+
<xs:attribute default="" name="Key" type="xs:string"/>
|
104
|
+
<xs:attribute default="" name="Bookmark" type="xs:string"/>
|
105
|
+
<xs:attribute default="-1" name="ImageWidth" type="xs:int"/>
|
106
|
+
<xs:attribute default="-1" name="ImageHeight" type="xs:int"/>
|
107
|
+
</xs:complexType>
|
108
|
+
<xs:simpleType name="ComicPageType">
|
109
|
+
<xs:list>
|
110
|
+
<xs:simpleType>
|
111
|
+
<xs:restriction base="xs:string">
|
112
|
+
<xs:enumeration value="FrontCover"/>
|
113
|
+
<xs:enumeration value="InnerCover"/>
|
114
|
+
<xs:enumeration value="Roundup"/>
|
115
|
+
<xs:enumeration value="Story"/>
|
116
|
+
<xs:enumeration value="Advertisement"/>
|
117
|
+
<xs:enumeration value="Editorial"/>
|
118
|
+
<xs:enumeration value="Letters"/>
|
119
|
+
<xs:enumeration value="Preview"/>
|
120
|
+
<xs:enumeration value="BackCover"/>
|
121
|
+
<xs:enumeration value="Other"/>
|
122
|
+
<xs:enumeration value="Deleted"/>
|
123
|
+
</xs:restriction>
|
124
|
+
</xs:simpleType>
|
125
|
+
</xs:list>
|
126
|
+
</xs:simpleType>
|
127
|
+
</xs:schema>
|
data/script/schema
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'net/http'
|
3
|
+
require 'uri'
|
4
|
+
require 'fileutils'
|
5
|
+
|
6
|
+
# Schema download script for ComicInfo XSD files
|
7
|
+
# Downloads schema files from the upstream ComicInfo repository
|
8
|
+
class SchemaDownloader
|
9
|
+
BASE_URL = 'https://raw.githubusercontent.com/anansi-project/comicinfo'.freeze
|
10
|
+
SCHEMAS = {
|
11
|
+
'1.0' => {
|
12
|
+
branch: 'main',
|
13
|
+
path: 'schema/v1.0/ComicInfo.xsd'
|
14
|
+
},
|
15
|
+
'2.0' => {
|
16
|
+
branch: 'main',
|
17
|
+
path: 'schema/v2.0/ComicInfo.xsd'
|
18
|
+
},
|
19
|
+
'2.1-draft' => {
|
20
|
+
branch: 'main',
|
21
|
+
path: 'drafts/v2.1/ComicInfo.xsd'
|
22
|
+
}
|
23
|
+
}.freeze
|
24
|
+
|
25
|
+
def initialize
|
26
|
+
@base_dir = File.join __dir__, '..', 'schemas'
|
27
|
+
end
|
28
|
+
|
29
|
+
def download_all
|
30
|
+
puts 'Downloading ComicInfo schema files...'
|
31
|
+
|
32
|
+
SCHEMAS.each do |version, config|
|
33
|
+
download_schema(version, config)
|
34
|
+
end
|
35
|
+
|
36
|
+
puts '✅ All schema files downloaded successfully!'
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def download_schema version, config
|
42
|
+
url = build_url(config[:branch], config[:path])
|
43
|
+
destination = File.join @base_dir, version, 'ComicInfo.xsd'
|
44
|
+
|
45
|
+
puts "📥 Downloading #{version} schema from #{url}"
|
46
|
+
|
47
|
+
# Create directory structure
|
48
|
+
FileUtils.mkdir_p(File.dirname(destination))
|
49
|
+
|
50
|
+
# Download file
|
51
|
+
uri = URI(url)
|
52
|
+
response = Net::HTTP.get_response(uri)
|
53
|
+
|
54
|
+
unless response.is_a?(Net::HTTPSuccess)
|
55
|
+
raise "Failed to download #{version} schema: #{response.code} #{response.message}"
|
56
|
+
end
|
57
|
+
|
58
|
+
# Save file
|
59
|
+
File.write(destination, response.body)
|
60
|
+
puts " ✅ Saved to #{destination}"
|
61
|
+
|
62
|
+
# Validate it's XML
|
63
|
+
validate_xml(destination)
|
64
|
+
rescue StandardError => e
|
65
|
+
puts " ❌ Error downloading #{version}: #{e.message}"
|
66
|
+
raise
|
67
|
+
end
|
68
|
+
|
69
|
+
def build_url branch, path
|
70
|
+
"#{BASE_URL}/#{branch}/#{path}"
|
71
|
+
end
|
72
|
+
|
73
|
+
def validate_xml file_path
|
74
|
+
content = File.read(file_path)
|
75
|
+
|
76
|
+
# Basic validation - check it starts with XML declaration or schema element
|
77
|
+
raise "Downloaded file doesn't appear to be valid XML schema" unless content.strip.start_with?('<?xml', '<xs:schema')
|
78
|
+
|
79
|
+
# Check for schema namespace
|
80
|
+
raise "Downloaded file doesn't appear to be an XSD schema" unless content.include?('http://www.w3.org/2001/XMLSchema')
|
81
|
+
|
82
|
+
puts ' ✅ Schema file validated'
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# Run the downloader
|
87
|
+
if __FILE__ == $PROGRAM_NAME
|
88
|
+
begin
|
89
|
+
downloader = SchemaDownloader.new
|
90
|
+
downloader.download_all
|
91
|
+
rescue StandardError => e
|
92
|
+
puts "❌ Schema download failed: #{e.message}"
|
93
|
+
exit 1
|
94
|
+
end
|
95
|
+
end
|
data/sig/comicinfo.rbs
ADDED
metadata
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: comicinfo
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Shane Becker
|
8
|
+
bindir: exe
|
9
|
+
cert_chain: []
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
|
+
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: nokogiri
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - ">="
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: 1.18.10
|
19
|
+
type: :runtime
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - ">="
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: 1.18.10
|
26
|
+
description: |
|
27
|
+
An idiomatic Ruby interface for reading and writing ComicInfo.xml files,
|
28
|
+
following the official ComicInfo schema specifications from the Anansi Project
|
29
|
+
email:
|
30
|
+
- veganstraightedge@gmail.com
|
31
|
+
executables: []
|
32
|
+
extensions: []
|
33
|
+
extra_rdoc_files: []
|
34
|
+
files:
|
35
|
+
- ".ruby-version"
|
36
|
+
- CHANGELOG.md
|
37
|
+
- CODE_OF_CONDUCT.md
|
38
|
+
- LICENSE.md
|
39
|
+
- README.md
|
40
|
+
- Rakefile
|
41
|
+
- doc/development.md
|
42
|
+
- lib/comicinfo.rb
|
43
|
+
- lib/comicinfo/enums.rb
|
44
|
+
- lib/comicinfo/errors.rb
|
45
|
+
- lib/comicinfo/issue.rb
|
46
|
+
- lib/comicinfo/page.rb
|
47
|
+
- lib/comicinfo/version.rb
|
48
|
+
- schemas/1.0/ComicInfo.xsd
|
49
|
+
- schemas/2.0/ComicInfo.xsd
|
50
|
+
- schemas/2.1-draft/ComicInfo.xsd
|
51
|
+
- script/schema
|
52
|
+
- sig/comicinfo.rbs
|
53
|
+
homepage: https://github.com/veganstraightedge/comicinfo
|
54
|
+
licenses:
|
55
|
+
- MIT
|
56
|
+
metadata:
|
57
|
+
allowed_push_host: https://rubygems.org
|
58
|
+
homepage_uri: https://github.com/veganstraightedge/comicinfo
|
59
|
+
source_code_uri: https://github.com/veganstraightedge/comicinfo
|
60
|
+
changelog_uri: https://github.com/veganstraightedge/comicinfo/blob/main/CHANGELOG.md
|
61
|
+
rubygems_mfa_required: 'true'
|
62
|
+
rdoc_options: []
|
63
|
+
require_paths:
|
64
|
+
- lib
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 3.4.6
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
requirements: []
|
76
|
+
rubygems_version: 3.6.9
|
77
|
+
specification_version: 4
|
78
|
+
summary: Ruby interface for working with ComicInfo.xml files
|
79
|
+
test_files: []
|