shale 0.2.1 → 0.2.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: 6782c72ce484d19c953642fee3503647013602cbbbb09f993f4d3a4739901b28
4
- data.tar.gz: 9859301452b89ad78fd4a336a5af1e1415d0aa72679d19c273d75b9a93514799
3
+ metadata.gz: 5907ba25342167fa8079e683c671f83f89b51777d0b27e8d0126ba404304c2bd
4
+ data.tar.gz: d88f5acb763a1aaa5f3ceff194613df16377107035cf2c5528bbda593a70b6fa
5
5
  SHA512:
6
- metadata.gz: 888390259e517dc27a323497b5a7a7f5db850c6f7545970d4e8cfbedc71d8b1a138f9bdbcf0b72dab883d5f5ba6a9d1f484c7ba3d7b2fa7d48299df7882a3f4a
7
- data.tar.gz: fb87b01bc61faf271f06faed140221e31eb8d894b64dc68d0afb4883c3e3943f54e464c969b6f939271405f3b14646288b327d8bf561da047dabd46075823717
6
+ metadata.gz: 967646fcc21c1735acc67ad67b467013dae4da76c2e7cfc3a863b8bc811ae3fcee73cc3a99e1344ab0ea38ef03fed181ba14286666afc6e965399c8929de045a
7
+ data.tar.gz: bebfbda2bb8fab102ae8b70506cd3fad3e1b178c02ed0486576d2fb26ef5a98ac45a0f62d410888e95b40d9a21ace32c76da36e2a75151ce104c4764a98b1b68
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [0.2.2] - 2022-03-06
2
+
3
+ ### Fixed
4
+ - Fix handling of blank attributes in XML format
5
+ - Fix incorrect types in README examples
6
+
1
7
  ## [0.2.1] - 2022-02-06
2
8
 
3
9
  ### Fixed
data/README.md CHANGED
@@ -40,7 +40,7 @@ end
40
40
  class Person < Shale::Mapper
41
41
  attribute :first_name, Shale::Type::String
42
42
  attribute :last_name, Shale::Type::String
43
- attribute :age, Shale::Type::Date
43
+ attribute :age, Shale::Type::Integer
44
44
  attribute :married, Shale::Type::Boolean, default: -> { false }
45
45
  attribute :hobbies, Shale::Type::String, collection: true
46
46
  attribute :address, Address
@@ -291,7 +291,7 @@ end
291
291
  class Person < Shale::Mapper
292
292
  attribute :first_name, Shale::Type::String
293
293
  attribute :last_name, Shale::Type::String
294
- attribute :age, Shale::Type::Date
294
+ attribute :age, Shale::Type::Integer
295
295
  attribute :hobbies, Shale::Type::String, collection: true
296
296
  attribute :address, Address
297
297
 
@@ -234,10 +234,9 @@ module Shale
234
234
  next unless attribute
235
235
 
236
236
  value = instance.public_send(attribute.name)
237
+ next if value.nil?
237
238
 
238
- if value && !value.empty?
239
- doc.add_attribute(element, xml_attr, value)
240
- end
239
+ doc.add_attribute(element, xml_attr, value)
241
240
  end
242
241
  end
243
242
 
data/lib/shale/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Shale
4
4
  # @api private
5
- VERSION = '0.2.1'
5
+ VERSION = '0.2.2'
6
6
  end
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.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kamil Giszczak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-06 00:00:00.000000000 Z
11
+ date: 2022-03-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby object mapper and serializer for XML, JSON and YAML.
14
14
  email: