sutazekarate 0.0.8 → 0.0.9
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 +4 -4
- data/lib/sutazekarate/category.rb +9 -0
- data/lib/sutazekarate/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d634c436128b74a8c862220ff7b580d25257cae676e63dbec3644fd2b0f13fe8
|
|
4
|
+
data.tar.gz: 71c32e15098702df9dc23b2cc9bba33e6ac3d02f11b68fdb6111385519ae429b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cf52132698ba781788f20d3b4dfc2dc2a5c90ea5495aacfc9e778303b5df4eb47251f639ea9bc9fc2be31f72d356530f0d5653ee98cd33afc7b33b7c634afd6c
|
|
7
|
+
data.tar.gz: bd0e81a7c1e77f38cdaa2333c0c9d6b554427f4cb0febe896dc48441b3c6eee38f08d18afaf8fa94406a97ada1e91204986ac8ffa9407ca71b7b98041031bd4b
|
|
@@ -10,6 +10,7 @@ module Sutazekarate
|
|
|
10
10
|
attribute :id
|
|
11
11
|
attribute :position
|
|
12
12
|
attribute :name
|
|
13
|
+
attribute :gender
|
|
13
14
|
attribute :discipline
|
|
14
15
|
attribute :duration
|
|
15
16
|
attribute :location
|
|
@@ -116,6 +117,13 @@ module Sutazekarate
|
|
|
116
117
|
category_element = Nokogiri::HTML5.fragment(data['kategoria'])
|
|
117
118
|
category_span_elements = category_element.search('span')
|
|
118
119
|
name_raw = category_span_elements[0].text.strip
|
|
120
|
+
gender = :unknown
|
|
121
|
+
if category_span_elements[0].attr('class').include?('classzeny')
|
|
122
|
+
gender = :female
|
|
123
|
+
end
|
|
124
|
+
if category_span_elements[0].attr('class').include?('classmuzi')
|
|
125
|
+
gender = :male
|
|
126
|
+
end
|
|
119
127
|
name_match = name_raw.match(/^([^(\/]+?)\s*(?:\(([^)]+)\))?\s*(?:\/([^\/]+)\/)?$/)
|
|
120
128
|
name = name_match[1]
|
|
121
129
|
duration = name_match[3]
|
|
@@ -136,6 +144,7 @@ module Sutazekarate
|
|
|
136
144
|
id:,
|
|
137
145
|
position: data['pc'],
|
|
138
146
|
name:,
|
|
147
|
+
gender:,
|
|
139
148
|
discipline:,
|
|
140
149
|
duration:,
|
|
141
150
|
location:,
|
data/lib/sutazekarate/version.rb
CHANGED