world_cup_cli 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scores.rb +5 -1
- data/lib/scores_scraper.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25615188b9939eda53c0f4f9bbbe8a7798b045c3
|
4
|
+
data.tar.gz: 8fbea73dc274a8d67176e2c8e650239e11c10992
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e090a4835c67da44f12bb99e6265ffdd770f791316752d87a8ba3cc9cefe7ac9a28caf5853a97ff4f95384190a261799e0d6c16bc35b656696bebfc50f563ba1
|
7
|
+
data.tar.gz: 16b78ec7a7b4ffd68409d92d81a70e58729cc480cd8b8823b4f306d2f74062938b6c1c743bdcbb146805695d1fd5785e8e12d3a3dc44232bb02f472ae18ff875
|
data/lib/scores.rb
CHANGED
@@ -24,7 +24,11 @@ class Scores
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def self.display_match(match)
|
27
|
-
puts "#{match[:home_team]} #{match[:score]} #{match[:away_team]}"
|
27
|
+
puts "#{match[:home_team]} #{match[:score]} #{match[:away_team]} #{match_status(match)}"
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.match_status(match)
|
31
|
+
"Status: #{match[:status]}" unless match[:status].strip.empty?
|
28
32
|
end
|
29
33
|
|
30
34
|
end
|
data/lib/scores_scraper.rb
CHANGED
@@ -18,7 +18,8 @@ class ScoresScraper
|
|
18
18
|
date: convert_to_datetime(match.children.css('.mu-i-datetime').text),
|
19
19
|
home_team: match.children.css('.t.home span.t-nTri').text,
|
20
20
|
away_team: match.children.css('.t.away span.t-nTri').text,
|
21
|
-
score: match.children.css('.s span.s-scoreText').text
|
21
|
+
score: match.children.css('.s span.s-scoreText').text,
|
22
|
+
status: match.children.css('.s .s-status').text
|
22
23
|
}
|
23
24
|
end
|
24
25
|
clean_array = arr.select{|item| item unless invalid_match?(item)}
|