xrb 0.6.0 → 0.6.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc1a872695a8ee34651e251bf308937e21574f9b0afb440a61df9daeb8d74b0a
4
- data.tar.gz: f988346791ede4ac09e142835032cf2e418acbf2e33c215b2dfa4d1b0d887f5a
3
+ metadata.gz: fd37ae9601f70b0cfcbabe16d8fcb75979e9f1f3c31b09c09dc09e0778ecee62
4
+ data.tar.gz: 24fec49db14fee7d33279c8a1ebd886be3c260c094a40315525ca53c86e82421
5
5
  SHA512:
6
- metadata.gz: 1756d1c6fef163d6be10e260b2b18ccce1f8fe22f5eeb32a2645fbb0394728c566152819a183ccd2d13d95ee4e58f431b6855fb37eb68e9b7d5ca109bcc3afe3
7
- data.tar.gz: ed1c87e16209e8ba874cfb48e9a0623784957711462189eeb019cda57e369c91e780933f252f2752bdda4b4dbe7ebcdc77dd784f71c5ad9b8d79b86319f3f183
6
+ metadata.gz: 95f9e7530e0d5419c5a55a0a33d242f54fc15ac1f1e48d046c27b2b46d627e19b4fc7a90c111e428e502f58afe2a93818610758ecb757c31cc7990f2756f8220
7
+ data.tar.gz: 0fc975c1d6b59077b326efd428bb2f0039ead7198145c4b66aaab098fe0c58caaf0018c2568ea8fc0cab81b0f5346bd35df102eaac0ebe02e28ee7713ca020bd
checksums.yaml.gz.sig CHANGED
Binary file
data/ext/xrb/tag.c CHANGED
@@ -97,13 +97,18 @@ VALUE XRB_Tag_append_attributes(VALUE self, VALUE buffer, VALUE attributes, VALU
97
97
 
98
98
  for (i = 0; i < RARRAY_LEN(attributes); i++) {
99
99
  VALUE attribute = RARRAY_AREF(attributes, i);
100
+
101
+ if (rb_type(attribute) != T_ARRAY || RARRAY_LEN(attribute) != 2) {
102
+ rb_raise(rb_eTypeError, "expected array for attribute key/value pair");
103
+ }
104
+
100
105
  VALUE key = RARRAY_AREF(attribute, 0);
101
106
  VALUE value = RARRAY_AREF(attribute, 1);
102
107
 
103
108
  XRB_Tag_append_tag_attribute(buffer, key, value, prefix);
104
109
  }
105
110
  } else {
106
- rb_raise(rb_eArgError, "expected hash or array for attributes");
111
+ rb_raise(rb_eTypeError, "expected hash or array for attributes");
107
112
  }
108
113
 
109
114
  return Qnil;
data/lib/xrb/tag.rb CHANGED
@@ -99,7 +99,11 @@ module XRB
99
99
  when Hash
100
100
  self.append_attributes(buffer, value, attribute_key)
101
101
  when Array
102
- self.append_attributes(buffer, value, attribute_key)
102
+ value.each do |attribute|
103
+ raise TypeError, "expected array of key-value pairs" unless attribute.is_a?(Array) and attribute.size == 2
104
+
105
+ self.append_attributes(buffer, [attribute], attribute_key)
106
+ end
103
107
  when TrueClass
104
108
  buffer << ' ' << attribute_key.to_s
105
109
  else
data/lib/xrb/version.rb CHANGED
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2012-2024, by Samuel Williams.
5
5
 
6
6
  module XRB
7
- VERSION = "0.6.0"
7
+ VERSION = "0.6.1"
8
8
  end
data/license.md CHANGED
@@ -3,6 +3,7 @@
3
3
  Copyright, 2012-2024, by Samuel Williams.
4
4
  Copyright, 2020, by Cyril Roelandt.
5
5
  Copyright, 2022, by Adam Daniels.
6
+ Copyright, 2024, by Jean Boussier.
6
7
 
7
8
  Permission is hereby granted, free of charge, to any person obtaining a copy
8
9
  of this software and associated documentation files (the "Software"), to deal
data.tar.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- ��D��v���������[��& q&���?-a��tw.�z$��2��R�P���~Nđr⳧!���]�\�\N=:�8��=J���xX �\���ަ/�����hןH�"ɧ=IPCޤ��/lev�������c��Et��Cz�^1K���
2
- phV� ����NRʶO�Yߏ�‰�[qB݈��D:�*�<���Y;:���)�4V�;b����<]����Z�x�s��'_9�߂��Q{ Vx�?˩��}F}EB=��܃���xtt��"�ط�5iZV? d(C/>s����/-�,q�2���q)�����Q��u��L}� x���V0M'�G��U�)
1
+ =hZ�� ^u\ ��*�P99�gА�*锵�(�8�'u�n�ߖ C���z���z��SX�455]w��G3L(��3��#������!�R"Ba7`=!�m���KXqʙQf�]Ve_�����$O۱����_���S�{�k���4b����
2
+ P���t/����w�Z�*�+ܙ}���90Qv�&�a��cơ�dN��JEbmfE�D��I���}-qs7
3
+ ��؅��B^(��|}}�q�IT%N}����N�Ǚ�/ה%
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  - Adam Daniels
9
9
  - Cyril Roelandt
10
+ - Jean Boussier
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain:
@@ -39,7 +40,7 @@ cert_chain:
39
40
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
40
41
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
41
42
  -----END CERTIFICATE-----
42
- date: 2024-05-03 00:00:00.000000000 Z
43
+ date: 2024-05-06 00:00:00.000000000 Z
43
44
  dependencies: []
44
45
  description:
45
46
  email:
metadata.gz.sig CHANGED
Binary file