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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16ac5a9c5b4b3fae8dab24e4a54a9d34a4770a761178a9ae65e0c258477ce21c
4
- data.tar.gz: 4ba6df9b65642ffe710f336a316642b5af214c2b15c21cb7838c6d7ea454bb93
3
+ metadata.gz: 242b77178ce5c728c7a06c6e268dc6d570f7b87a0203fc99c250746b9c64a868
4
+ data.tar.gz: 2bba3f4abf8e2beb204fad5a7c1d76f00d132c60e437f8d57e2c860bbcd0d618
5
5
  SHA512:
6
- metadata.gz: 9587d159550540f9116fa85d7f458448338183821859cb766f5954a3c7cd45425917c84c4678e88924e5707b6c02f890fbf0010ab02b98486e90a251419fd0e7
7
- data.tar.gz: f109fde28982978cb86d90a2deb3823f25ced8dd5477a02ee443d166a981c828321e4fbc87c8e06a064f682da8ed3e160539af51afae8a71de2ccb918f949873
6
+ metadata.gz: 12cf034f2e99bdb78fe30734278c9926d5f70587fc77c333fa597883ab50dd51a7750a4f6bc88f996db69541332170863c6d91af5bdf515e7fd4d2b9caf4946c
7
+ data.tar.gz: 5e4fd91a0a6c730eab90ebe4e992f62aaa4d17ef2cf8e838a08482dce6c9e0bfdb8015e7d6244d7e39f8f688bf86f64a6f81fbe556ac3df017e6ea2901ab6dfe
@@ -38,9 +38,10 @@ module Strava
38
38
  end
39
39
  @graph = config[:graph]
40
40
  @scope = config[:scope]
41
- @cache_key = config[:cache_key] || "activities"
42
- @publicize = config[:publicize]
43
- @simulate = config[:simulate]
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(@cache_key, record: :new_episodes) do
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(per_page: per_page, page: page)
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
@@ -1,3 +1,3 @@
1
1
  module Strava
2
- VERSION = '0.0.4'.freeze
2
+ VERSION = '0.0.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strava-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Bonaud