rapa 0.5.1 → 0.5.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
  SHA1:
3
- metadata.gz: f5b7038a1d2e0b226439d25014351907abaef445
4
- data.tar.gz: f01f0f430853d80866438add0bf6169460f70774
3
+ metadata.gz: e9ceb89b2621af6ad448d72cce84ec32b39c8c62
4
+ data.tar.gz: fcae95c513d568dff5c26480c988291c6f61cd49
5
5
  SHA512:
6
- metadata.gz: 313c277bd07d18f745505fc190e28bc2ebaaba6f10f00cc47599d91ebb3733a80d47e0c9310f0a1bce2ba3907c05d5a2577e094492bd86bc8a2487a10f436dec
7
- data.tar.gz: 67685e16f114e00f536af1028d72c1b53ef88c7b11c42dcf0c31d188723437d1e5cd63832bd9dd11be847cac2f53fa51616f77237b95906b9ea34efb9ee271cd
6
+ metadata.gz: 510ae1769236b56584933cd18ee2b60dfc9b663e9074d72bed903549bebb0376beea21cefd8b7d6b54a7517bca19ef45cd7d6fbf72c68c59180d8d9da3efb285
7
+ data.tar.gz: 50fc87fb4a121e71723656a1446c3204fc0bb8ab0491a9238d28a7eacf9b8dc1180d079b8a922e66e5b7e930cb89205a0721b996339a24c05b2487418e703c65
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v0.5.2
2
+
3
+ - Support YYYY-mm format on `#publication_date` and `#release_date`
4
+
1
5
  ## v0.5.1
2
6
 
3
7
  - Fix `Rapa::Resources::ItemResource#alternate_versions` type
@@ -230,7 +230,7 @@ module Rapa
230
230
  # @return [Date, nil]
231
231
  def publication_date
232
232
  if value = source.dig("ItemAttributes", "PublicationDate")
233
- ::Date.parse(value)
233
+ parse_date(value)
234
234
  end
235
235
  end
236
236
 
@@ -287,7 +287,7 @@ module Rapa
287
287
  # @return [Date, nil]
288
288
  def release_date
289
289
  if value = source.dig("ItemAttributes", "ReleaseDate")
290
- ::Date.parse(value)
290
+ parse_date(value)
291
291
  end
292
292
  end
293
293
 
@@ -401,6 +401,13 @@ module Rapa
401
401
  result[element["Description"]] = element["URL"]
402
402
  end
403
403
  end
404
+
405
+ # @param string [String]
406
+ # @return [Date]
407
+ def parse_date(string)
408
+ string += "-01" if /\A(\d{4})-(\d{2})\z/ === string
409
+ ::Date.parse(string)
410
+ end
404
411
  end
405
412
  end
406
413
  end
data/lib/rapa/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rapa
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rapa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura