atp_scraper 0.7.0 → 0.7.2
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/README.md +1 -1
- data/lib/atp_scraper.rb +1 -0
- data/lib/atp_scraper/activities/record.rb +1 -1
- data/lib/atp_scraper/utility.rb +20 -0
- data/lib/atp_scraper/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4bfa1a9cf5f055d98682a6ae73c8c6ebc25d078
|
4
|
+
data.tar.gz: 95c75134b8011b3375493632e9ce6f0d7c803f54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 473138f4c22867179c802ec1ecaea81d3f7087aae761e52f6adb7be5ed40aa135cb2046f18f530cdc018132b76a148c65fac93c0d9b85b463ba210b6ad9bf96b
|
7
|
+
data.tar.gz: b4777082f9b9055a021c2013120f24f9b956044d0e3d5ffb6a5e69709203533dbabc117d8495a001d1dfffce08c6765cfec2012bdef07d2816f7f02314c12e55
|
data/README.md
CHANGED
@@ -50,7 +50,7 @@ AtpScraper::Get.player_activity("n409", 2016)
|
|
50
50
|
# opponent_name: "Fernand Verdasco",
|
51
51
|
# opponent_rank: "45",
|
52
52
|
# round: "Round of 128",
|
53
|
-
# score: "
|
53
|
+
# score: "67(3) 64 63 67(4) 26",
|
54
54
|
# win_loss: "L",
|
55
55
|
# tournament_name: "Australian Open",
|
56
56
|
# tournament_category: "grandslam",
|
data/lib/atp_scraper.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
module AtpScraper
|
2
|
+
# Utility class
|
3
|
+
class Utility
|
4
|
+
# "62 765" -> "62 76(5)"
|
5
|
+
# "768 64 46 46 76-74" -> "76(8) 64 46 46 76-74"
|
6
|
+
# "76 63" -> "76 64"
|
7
|
+
def self.convert_score(score)
|
8
|
+
result = []
|
9
|
+
score.split("\s").each do |s|
|
10
|
+
# Str starts '76' or '67' (not '76-' or '67-')
|
11
|
+
if (a = s.slice!(/^(76|67)(?!-|$)/))
|
12
|
+
result.push("#{a}(#{s})")
|
13
|
+
else
|
14
|
+
result.push(s)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
result.join("\s")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/atp_scraper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atp_scraper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mosuke5
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -176,6 +176,7 @@ files:
|
|
176
176
|
- lib/atp_scraper/get.rb
|
177
177
|
- lib/atp_scraper/html.rb
|
178
178
|
- lib/atp_scraper/ranking.rb
|
179
|
+
- lib/atp_scraper/utility.rb
|
179
180
|
- lib/atp_scraper/version.rb
|
180
181
|
homepage: https://github.com/mosuke5/atp_scraper
|
181
182
|
licenses:
|