metal_archives 3.1.1 → 3.2.0

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: 39ec01fd7f1c69fc54d794cd58693912fd4c1ece0ca6f70c4281ba3b3d7cad4c
4
- data.tar.gz: d518c8a15a0e5a9fbb26565696aeead06435a06f12dafcd586b54a4c50be5f3e
3
+ metadata.gz: 2c000d091859fb144ab19500353d4901a3cb2aa2e10962e5a138a12e40c5eb11
4
+ data.tar.gz: cf9428989c5b8c3f5b36169219fbb62632703a797df2c31bf041ed8dd7e053ad
5
5
  SHA512:
6
- metadata.gz: 15cf3a9ae549ff1a43aae068a83b16287c7a70ad95ee176e41dbccac78fe0884031bfff6ec1a4cdda098b7dcbcc7b720b1087cfd9fa3a6da39a766b805321720
7
- data.tar.gz: f4738548bd36c4af3e97e6a666df23861a3a2bc969a1148d66fccf9cd2d404593f1fb77b3a63a61fa9f1a0325dd754173a7763424653c271abdbefcf201f2817
6
+ metadata.gz: 56d38a266d6d882b9df4fe4a2efb0d2d9cf9a7f473a19d0bf3ff360a1967edd566c1f49f98a58e58cfcd2d245e856dd28b9fdc3d9bca6f283d253e752c99778e
7
+ data.tar.gz: a0db17d07d3703743247ed7c59dffcdbefa7686f7d50b8af4f3b6ff9d3fcc640a25208253125ad94784f9b6755298dade393a7a435fac24a8797dcf5d85ff25f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.2.0
4
+
5
+ - Add band property on release
6
+
3
7
  ## 3.1.1
4
8
 
5
9
  - Fix some invalid parsing
@@ -26,7 +26,16 @@ module MetalArchives
26
26
  #
27
27
  property :title
28
28
 
29
- # TODO: band
29
+ ##
30
+ # :attr_reader: band
31
+ #
32
+ # Returns +rdoc-ref:MetalArchives::Band+
33
+ #
34
+ # [Raises]
35
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
36
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
37
+ #
38
+ property :band, type: Band
30
39
 
31
40
  ##
32
41
  # :attr_reader: type
@@ -104,6 +104,7 @@ module MetalArchives
104
104
  # Set default props
105
105
  props = {
106
106
  title: nil,
107
+ band: nil,
107
108
  type: nil,
108
109
  date_released: nil,
109
110
  catalog_id: nil,
@@ -117,6 +118,12 @@ module MetalArchives
117
118
 
118
119
  props[:title] = sanitize doc.css("#album_info .album_name a").first.content
119
120
 
121
+ # Band
122
+ band_doc = doc.css("#album_info .band_name a").first
123
+ id = Integer(band_doc.attr("href").split("/").last)
124
+
125
+ props[:band] = MetalArchives::Band.find(id)
126
+
120
127
  doc.css("#album_info dl").each do |dl|
121
128
  dl.search("dt").each do |dt|
122
129
  content = sanitize dt.next_element.content
@@ -6,8 +6,8 @@ module MetalArchives
6
6
  #
7
7
  module Version
8
8
  MAJOR = 3
9
- MINOR = 1
10
- PATCH = 1
9
+ MINOR = 2
10
+ PATCH = 0
11
11
  PRE = nil
12
12
 
13
13
  VERSION = [MAJOR, MINOR, PATCH].compact.join(".")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metal_archives
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Dejonckheere
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-02 00:00:00.000000000 Z
11
+ date: 2021-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: countries