strava-cli 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/strava/app.rb +15 -7
- data/lib/strava/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: 242b77178ce5c728c7a06c6e268dc6d570f7b87a0203fc99c250746b9c64a868
|
4
|
+
data.tar.gz: 2bba3f4abf8e2beb204fad5a7c1d76f00d132c60e437f8d57e2c860bbcd0d618
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12cf034f2e99bdb78fe30734278c9926d5f70587fc77c333fa597883ab50dd51a7750a4f6bc88f996db69541332170863c6d91af5bdf515e7fd4d2b9caf4946c
|
7
|
+
data.tar.gz: 5e4fd91a0a6c730eab90ebe4e992f62aaa4d17ef2cf8e838a08482dce6c9e0bfdb8015e7d6244d7e39f8f688bf86f64a6f81fbe556ac3df017e6ea2901ab6dfe
|
data/lib/strava/app.rb
CHANGED
@@ -38,9 +38,10 @@ module Strava
|
|
38
38
|
end
|
39
39
|
@graph = config[:graph]
|
40
40
|
@scope = config[:scope]
|
41
|
-
@cache_key
|
42
|
-
@
|
43
|
-
@
|
41
|
+
@cache_key = config[:cache_key] || 'activities'
|
42
|
+
@cache_time = config[:cache_time] || 24 * 3600
|
43
|
+
@publicize = config[:publicize]
|
44
|
+
@simulate = config[:simulate]
|
44
45
|
@activities = []
|
45
46
|
end
|
46
47
|
|
@@ -141,13 +142,20 @@ module Strava
|
|
141
142
|
end
|
142
143
|
|
143
144
|
def fetch_activities_data
|
144
|
-
VCR.use_cassette(
|
145
|
+
VCR.use_cassette(
|
146
|
+
@cache_key,
|
147
|
+
record: :new_episodes,
|
148
|
+
re_record_interval: @cache_time
|
149
|
+
) do
|
145
150
|
page = 0
|
146
151
|
per_page = 100
|
147
152
|
|
148
|
-
while activities.count == page*per_page
|
149
|
-
page +=1
|
150
|
-
@activities += client.list_athlete_activities(
|
153
|
+
while activities.count == page * per_page
|
154
|
+
page += 1
|
155
|
+
@activities += client.list_athlete_activities(
|
156
|
+
per_page: per_page,
|
157
|
+
page: page
|
158
|
+
)
|
151
159
|
end
|
152
160
|
end
|
153
161
|
end
|
data/lib/strava/version.rb
CHANGED