yao 0.20.0 → 0.21.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 390b05f4ca044196755551231ee7f297900816c3742318bcc502b0376e70512a
4
- data.tar.gz: 0a6bb49a598bb7667d488ce316280ed3504b5ab2c3e0f97da0019783a5f6a939
3
+ metadata.gz: de0f6bd46142708d89f1f34d46f40aace3ed5dd4800cbdecb72c7db2b2abf336
4
+ data.tar.gz: fc4d96899ce74185f9e60efdcb6320a89cdc54db5441d43c50e7c4bd0a9f523a
5
5
  SHA512:
6
- metadata.gz: 731688676c2b1b9d120ef76f67131de2b060a25b8e3c9cb0b1cbf138c6a58fe632220c7f02c87c58972ee51c40f0d902bca2e69d254cd9eecd427d3960a1740b
7
- data.tar.gz: 63b4adfd5b841b0c4b99c262b8cc2235a980165c574db4b60dab8b39ba39b4b659b0d4761286e81a48e61f33a57821ba1167b1bd53ba35387fb6f1c0b37dc2cc
6
+ metadata.gz: 35fe4d0604d2bd59de354f271dd9e9b4c953723053a332a2184c1f10f602466c9d015be7d7fc7f47757f19fa02d33b895908fd44f3ec5ffb2a6f306ae35caad7
7
+ data.tar.gz: 8c51f2b375c7e57747ef38d395a295d8124ae6b2d4d84464d042ac25e9ec7289ba5b3c7c6b5eb44790e6ff2f44f28f35d910ea700920a9398580e1bcf084e252
@@ -68,7 +68,8 @@ module Yao::Resources
68
68
  names.map(&:to_s).each do |name|
69
69
  add_instantiation_name_list(name)
70
70
  define_method(name) do
71
- Time.parse(self[name])
71
+ time = self[name]
72
+ Time.parse(time) if time
72
73
  end
73
74
  end
74
75
  end
data/lib/yao/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yao
2
- VERSION = "0.20.0"
2
+ VERSION = "0.21.0"
3
3
  end
@@ -23,6 +23,16 @@ class TestResourceBase < TestYaoResource
23
23
  assert_equal(nil, base.empty)
24
24
  end
25
25
 
26
+ def test_map_attributes_to_time
27
+ base = Yao::Resources::Base.new("updated_at" => "2015-01-01T00:00:00Z")
28
+ base.class.map_attributes_to_time :updated_at
29
+ assert_equal(Time.parse("2015-01-01T00:00:00Z"), base.updated_at)
30
+
31
+ base = Yao::Resources::Base.new("updated_at" => nil)
32
+ base.class.map_attributes_to_time :updated_at
33
+ assert(base.updated_at.nil?)
34
+ end
35
+
26
36
  def test_update
27
37
  stub(Yao::Resources::Base).update('foo', {name: 'BAR'}) { Yao::Resources::Base.new('id' => 'foo', 'name' => 'BAR')}
28
38
  base = Yao::Resources::Base.new({'id' => 'foo', 'name' => 'bar'})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yao
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uchio, KONDO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-05 00:00:00.000000000 Z
11
+ date: 2023-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  - !ruby/object:Gem::Version
221
221
  version: '0'
222
222
  requirements: []
223
- rubygems_version: 3.4.6
223
+ rubygems_version: 3.4.10
224
224
  signing_key:
225
225
  specification_version: 4
226
226
  summary: Yet Another OpenStack API Wrapper that rocks!!