libxml-ruby 4.1.1 → 4.1.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: 791562c871b9c8d9680778bf68bdde22c5911ad147bd28634f3051d2c3b5bf6a
4
- data.tar.gz: e2782de74edb9609634ef022f9d94d98591d3e49c38cb5d667af407ffa87b5da
3
+ metadata.gz: d298b5603240e7ea8b02a030fce5d7a850cd00f0a6a1aac4325dc37b85f7bed4
4
+ data.tar.gz: 8f9f870fe5f055d9d4b3d30afc9a20cc5c1dbea3332e11e2426ee703fcb83202
5
5
  SHA512:
6
- metadata.gz: f3569183ea0e3cc00895c2fa3760b280dd1244f7c69144e661c7fbbdc575f57c67b479b5f0074a6cbf13c93d25bb6e9bd1c89df443388187f8f6472ba00ddfd8
7
- data.tar.gz: d856e272adb85fa91aca6d83fd3a5d1c4ae4e1e40f2cb318d9e369ed86c14df973c942c74a4c84e76c83f270eaaadc47021571852e1e39ef750927a3c5930f07
6
+ metadata.gz: ef9b908bf3c1b2f4fe1fe848557e3e8e5265e980a5285c9f213395b80229c295868e007f2f03913ff286d716720d1d995938bcdcdcccaf65dc73022b2cedf15e
7
+ data.tar.gz: d44818d023a575fd2e5c6d40580382fe809f694d28462fff16500109aa33fa483ee555c6ea27ece9dd4f9756f7fe6c34d1aeaa34162b99e847d4171585624265
data/HISTORY CHANGED
@@ -1,5 +1,13 @@
1
1
  = Release History
2
2
 
3
+ == 4.1.2 / 2023-11-04
4
+
5
+ * Fix Ruby warnings about undefined allocators (yuuji.yaginuma, Christopher Sahnwaldt)
6
+ * Fix Schema::Element required? and array? (John Andrews)
7
+ * Remove SchemaElement#minOccurs and SchemaElement#maxOccurs since they actually did not work (Charlie Savage)
8
+ * Fix typo: XPatch -> XPath (Christopher Sahnwaldt)
9
+ * Introduce new alternative Homebrew installation search paths to extconf makefile (Pierce Brooks)
10
+
3
11
  == 4.1.1 / 2023-05-01
4
12
 
5
13
  * Fix compile warning (or error) for input_callbacks_register_input_callbacks (Charlie Savage)
@@ -1,61 +1,67 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'mkmf'
4
-
5
- def crash(str)
6
- printf(" extconf failure: %s\n", str)
7
- exit 1
8
- end
9
-
10
- xc = with_config('xml2-config')
11
- if xc
12
- cflags = `#{xc} --cflags`.chomp
13
- if $? != 0
14
- cflags = nil
15
- else
16
- libs = `#{xc} --libs`.chomp
17
- if $? != 0
18
- libs = nil
19
- else
20
- $CFLAGS += ' ' + cflags
21
- $libs = libs + " " + $libs
22
- end
23
- end
24
- else
25
- dir_config('xml2')
26
- end
27
-
28
- found_header = find_header('libxml/xmlversion.h',
29
- '/opt/include/libxml2',
30
- '/opt/local/include/libxml2',
31
- '/usr/local/include/libxml2',
32
- '/usr/include/libxml2',
33
- '/usr/local/include')
34
-
35
- found_lib = find_library('xml2', 'xmlParseDoc',
36
- '/opt/lib',
37
- '/opt/local/lib',
38
- '/usr/local/lib',
39
- '/usr/lib')
40
-
41
- found_lib ||= find_library('libxml2', 'xmlParseDoc',
42
- '/opt/lib',
43
- '/opt/local/lib',
44
- '/usr/local/lib',
45
- '/usr/lib')
46
-
47
- if !found_header || !found_lib
48
- crash(<<~EOL)
49
- Cannot find libxml2.
50
-
51
- Install the library or try one of the following options to extconf.rb:
52
-
53
- --with-xml2-config=/path/to/xml2-config
54
- --with-xml2-dir=/path/to/libxml2
55
- --with-xml2-lib=/path/to/libxml2/lib
56
- --with-xml2-include=/path/to/libxml2/include
57
- EOL
58
- end
59
-
60
- create_header()
61
- create_makefile('libxml_ruby')
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'mkmf'
4
+
5
+ def crash(str)
6
+ printf(" extconf failure: %s\n", str)
7
+ exit 1
8
+ end
9
+
10
+ xc = with_config('xml2-config')
11
+ if xc
12
+ cflags = `#{xc} --cflags`.chomp
13
+ if $? != 0
14
+ cflags = nil
15
+ else
16
+ libs = `#{xc} --libs`.chomp
17
+ if $? != 0
18
+ libs = nil
19
+ else
20
+ $CFLAGS += ' ' + cflags
21
+ $libs = libs + " " + $libs
22
+ end
23
+ end
24
+ else
25
+ dir_config('xml2')
26
+ end
27
+
28
+ found_header = find_header('libxml/xmlversion.h',
29
+ '/opt/include/libxml2',
30
+ '/opt/local/include/libxml2',
31
+ '/opt/homebrew/opt/libxml2/include/libxml2',
32
+ '/usr/local/include/libxml2',
33
+ '/usr/include/libxml2',
34
+ '/usr/local/include',
35
+ '/usr/local/opt/libxml2/include/libxml2')
36
+
37
+ found_lib = find_library('xml2', 'xmlParseDoc',
38
+ '/opt/lib',
39
+ '/opt/local/lib',
40
+ '/opt/homebrew/opt/libxml2/lib',
41
+ '/usr/lib',
42
+ '/usr/local/lib',
43
+ '/usr/local/opt/libxml2/lib')
44
+
45
+ found_lib ||= find_library('libxml2', 'xmlParseDoc',
46
+ '/opt/lib',
47
+ '/opt/local/lib',
48
+ '/opt/homebrew/opt/libxml2/lib',
49
+ '/usr/lib',
50
+ '/usr/local/lib',
51
+ '/usr/local/opt/libxml2/lib')
52
+
53
+ if !found_header || !found_lib
54
+ crash(<<~EOL)
55
+ Cannot find libxml2.
56
+
57
+ Install the library or try one of the following options to extconf.rb:
58
+
59
+ --with-xml2-config=/path/to/xml2-config
60
+ --with-xml2-dir=/path/to/libxml2
61
+ --with-xml2-lib=/path/to/libxml2/lib
62
+ --with-xml2-include=/path/to/libxml2/include
63
+ EOL
64
+ end
65
+
66
+ create_header()
67
+ create_makefile('libxml_ruby')
@@ -1,153 +1,154 @@
1
- /* Please see the LICENSE file for copyright and distribution information */
2
-
3
- /*
4
- * Document-class: LibXML::XML::AttrDecl
5
- *
6
- * At attribute declaration is used in XML::Dtds to define
7
- * what attributes are allowed on an element. An attribute
8
- * declaration defines an attribues name, data type and default
9
- * value (if any).
10
- */
11
-
12
- #include "ruby_libxml.h"
13
-
14
- VALUE cXMLAttrDecl;
15
-
16
- void rxml_attr_decl_mark(xmlAttributePtr xattr)
17
- {
18
- rxml_node_mark((xmlNodePtr) xattr);
19
- }
20
-
21
- VALUE rxml_attr_decl_wrap(xmlAttributePtr xattr)
22
- {
23
- return Data_Wrap_Struct(cXMLAttrDecl, rxml_attr_decl_mark, NULL, xattr);
24
- }
25
-
26
- /*
27
- * call-seq:
28
- * attr_decl.doc -> XML::Document
29
- *
30
- * Returns this attribute declaration's document.
31
- */
32
- static VALUE rxml_attr_decl_doc_get(VALUE self)
33
- {
34
- xmlAttributePtr xattr;
35
- Data_Get_Struct(self, xmlAttribute, xattr);
36
- if (xattr->doc == NULL)
37
- return Qnil;
38
- else
39
- return rxml_document_wrap(xattr->doc);
40
- }
41
-
42
-
43
- /*
44
- * call-seq:
45
- * attr_decl.name -> "name"
46
- *
47
- * Obtain this attribute declaration's name.
48
- */
49
- static VALUE rxml_attr_decl_name_get(VALUE self)
50
- {
51
- xmlAttributePtr xattr;
52
- Data_Get_Struct(self, xmlAttribute, xattr);
53
-
54
- if (xattr->name == NULL)
55
- return Qnil;
56
- else
57
- return rxml_new_cstr( xattr->name, xattr->doc->encoding);
58
- }
59
-
60
- /*
61
- * call-seq:
62
- * attr_decl.next -> XML::AttrDecl
63
- *
64
- * Obtain the next attribute declaration.
65
- */
66
- static VALUE rxml_attr_decl_next_get(VALUE self)
67
- {
68
- xmlAttributePtr xattr;
69
- Data_Get_Struct(self, xmlAttribute, xattr);
70
- if (xattr->next == NULL)
71
- return Qnil;
72
- else
73
- return rxml_attr_decl_wrap((xmlAttributePtr)xattr->next);
74
- }
75
-
76
- /*
77
- * call-seq:
78
- * attr_decl.type -> num
79
- *
80
- * Obtain this attribute declaration's type node type.
81
- */
82
- static VALUE rxml_attr_decl_node_type(VALUE self)
83
- {
84
- xmlAttrPtr xattr;
85
- Data_Get_Struct(self, xmlAttr, xattr);
86
- return INT2NUM(xattr->type);
87
- }
88
-
89
- /*
90
- * call-seq:
91
- * attr_decl.parent -> XML::Dtd
92
- *
93
- * Obtain this attribute declaration's parent which
94
- * is an instance of a XML::DTD.
95
- */
96
- static VALUE rxml_attr_decl_parent_get(VALUE self)
97
- {
98
- xmlAttributePtr xattr;
99
- Data_Get_Struct(self, xmlAttribute, xattr);
100
-
101
- if (xattr->parent == NULL)
102
- return Qnil;
103
- else
104
- return rxml_dtd_wrap(xattr->parent);
105
- }
106
-
107
- /*
108
- * call-seq:
109
- * attr_decl.prev -> (XML::AttrDecl | XML::ElementDecl)
110
- *
111
- * Obtain the previous attribute declaration or the owning
112
- * element declration (not implemented).
113
- */
114
- static VALUE rxml_attr_decl_prev_get(VALUE self)
115
- {
116
- xmlAttributePtr xattr;
117
- Data_Get_Struct(self, xmlAttribute, xattr);
118
-
119
- if (xattr->prev == NULL)
120
- return Qnil;
121
- else
122
- return rxml_attr_decl_wrap((xmlAttributePtr)xattr->prev);
123
- }
124
-
125
- /*
126
- * call-seq:
127
- * attr_decl.value -> "value"
128
- *
129
- * Obtain the default value of this attribute declaration.
130
- */
131
- VALUE rxml_attr_decl_value_get(VALUE self)
132
- {
133
- xmlAttributePtr xattr;
134
-
135
- Data_Get_Struct(self, xmlAttribute, xattr);
136
-
137
- if (xattr->defaultValue)
138
- return rxml_new_cstr(xattr->defaultValue, NULL);
139
- else
140
- return Qnil;
141
- }
142
-
143
- void rxml_init_attr_decl(void)
144
- {
145
- cXMLAttrDecl = rb_define_class_under(mXML, "AttrDecl", rb_cObject);
146
- rb_define_method(cXMLAttrDecl, "doc", rxml_attr_decl_doc_get, 0);
147
- rb_define_method(cXMLAttrDecl, "name", rxml_attr_decl_name_get, 0);
148
- rb_define_method(cXMLAttrDecl, "next", rxml_attr_decl_next_get, 0);
149
- rb_define_method(cXMLAttrDecl, "node_type", rxml_attr_decl_node_type, 0);
150
- rb_define_method(cXMLAttrDecl, "parent", rxml_attr_decl_parent_get, 0);
151
- rb_define_method(cXMLAttrDecl, "prev", rxml_attr_decl_prev_get, 0);
152
- rb_define_method(cXMLAttrDecl, "value", rxml_attr_decl_value_get, 0);
153
- }
1
+ /* Please see the LICENSE file for copyright and distribution information */
2
+
3
+ /*
4
+ * Document-class: LibXML::XML::AttrDecl
5
+ *
6
+ * At attribute declaration is used in XML::Dtds to define
7
+ * what attributes are allowed on an element. An attribute
8
+ * declaration defines an attribues name, data type and default
9
+ * value (if any).
10
+ */
11
+
12
+ #include "ruby_libxml.h"
13
+
14
+ VALUE cXMLAttrDecl;
15
+
16
+ void rxml_attr_decl_mark(xmlAttributePtr xattr)
17
+ {
18
+ rxml_node_mark((xmlNodePtr) xattr);
19
+ }
20
+
21
+ VALUE rxml_attr_decl_wrap(xmlAttributePtr xattr)
22
+ {
23
+ return Data_Wrap_Struct(cXMLAttrDecl, rxml_attr_decl_mark, NULL, xattr);
24
+ }
25
+
26
+ /*
27
+ * call-seq:
28
+ * attr_decl.doc -> XML::Document
29
+ *
30
+ * Returns this attribute declaration's document.
31
+ */
32
+ static VALUE rxml_attr_decl_doc_get(VALUE self)
33
+ {
34
+ xmlAttributePtr xattr;
35
+ Data_Get_Struct(self, xmlAttribute, xattr);
36
+ if (xattr->doc == NULL)
37
+ return Qnil;
38
+ else
39
+ return rxml_document_wrap(xattr->doc);
40
+ }
41
+
42
+
43
+ /*
44
+ * call-seq:
45
+ * attr_decl.name -> "name"
46
+ *
47
+ * Obtain this attribute declaration's name.
48
+ */
49
+ static VALUE rxml_attr_decl_name_get(VALUE self)
50
+ {
51
+ xmlAttributePtr xattr;
52
+ Data_Get_Struct(self, xmlAttribute, xattr);
53
+
54
+ if (xattr->name == NULL)
55
+ return Qnil;
56
+ else
57
+ return rxml_new_cstr( xattr->name, xattr->doc->encoding);
58
+ }
59
+
60
+ /*
61
+ * call-seq:
62
+ * attr_decl.next -> XML::AttrDecl
63
+ *
64
+ * Obtain the next attribute declaration.
65
+ */
66
+ static VALUE rxml_attr_decl_next_get(VALUE self)
67
+ {
68
+ xmlAttributePtr xattr;
69
+ Data_Get_Struct(self, xmlAttribute, xattr);
70
+ if (xattr->next == NULL)
71
+ return Qnil;
72
+ else
73
+ return rxml_attr_decl_wrap((xmlAttributePtr)xattr->next);
74
+ }
75
+
76
+ /*
77
+ * call-seq:
78
+ * attr_decl.type -> num
79
+ *
80
+ * Obtain this attribute declaration's type node type.
81
+ */
82
+ static VALUE rxml_attr_decl_node_type(VALUE self)
83
+ {
84
+ xmlAttrPtr xattr;
85
+ Data_Get_Struct(self, xmlAttr, xattr);
86
+ return INT2NUM(xattr->type);
87
+ }
88
+
89
+ /*
90
+ * call-seq:
91
+ * attr_decl.parent -> XML::Dtd
92
+ *
93
+ * Obtain this attribute declaration's parent which
94
+ * is an instance of a XML::DTD.
95
+ */
96
+ static VALUE rxml_attr_decl_parent_get(VALUE self)
97
+ {
98
+ xmlAttributePtr xattr;
99
+ Data_Get_Struct(self, xmlAttribute, xattr);
100
+
101
+ if (xattr->parent == NULL)
102
+ return Qnil;
103
+ else
104
+ return rxml_dtd_wrap(xattr->parent);
105
+ }
106
+
107
+ /*
108
+ * call-seq:
109
+ * attr_decl.prev -> (XML::AttrDecl | XML::ElementDecl)
110
+ *
111
+ * Obtain the previous attribute declaration or the owning
112
+ * element declration (not implemented).
113
+ */
114
+ static VALUE rxml_attr_decl_prev_get(VALUE self)
115
+ {
116
+ xmlAttributePtr xattr;
117
+ Data_Get_Struct(self, xmlAttribute, xattr);
118
+
119
+ if (xattr->prev == NULL)
120
+ return Qnil;
121
+ else
122
+ return rxml_attr_decl_wrap((xmlAttributePtr)xattr->prev);
123
+ }
124
+
125
+ /*
126
+ * call-seq:
127
+ * attr_decl.value -> "value"
128
+ *
129
+ * Obtain the default value of this attribute declaration.
130
+ */
131
+ VALUE rxml_attr_decl_value_get(VALUE self)
132
+ {
133
+ xmlAttributePtr xattr;
134
+
135
+ Data_Get_Struct(self, xmlAttribute, xattr);
136
+
137
+ if (xattr->defaultValue)
138
+ return rxml_new_cstr(xattr->defaultValue, NULL);
139
+ else
140
+ return Qnil;
141
+ }
142
+
143
+ void rxml_init_attr_decl(void)
144
+ {
145
+ cXMLAttrDecl = rb_define_class_under(mXML, "AttrDecl", rb_cObject);
146
+ rb_undef_alloc_func(cXMLAttrDecl);
147
+ rb_define_method(cXMLAttrDecl, "doc", rxml_attr_decl_doc_get, 0);
148
+ rb_define_method(cXMLAttrDecl, "name", rxml_attr_decl_name_get, 0);
149
+ rb_define_method(cXMLAttrDecl, "next", rxml_attr_decl_next_get, 0);
150
+ rb_define_method(cXMLAttrDecl, "node_type", rxml_attr_decl_node_type, 0);
151
+ rb_define_method(cXMLAttrDecl, "parent", rxml_attr_decl_parent_get, 0);
152
+ rb_define_method(cXMLAttrDecl, "prev", rxml_attr_decl_prev_get, 0);
153
+ rb_define_method(cXMLAttrDecl, "value", rxml_attr_decl_value_get, 0);
154
+ }