strava-ruby-client 0.4.0 → 0.4.1

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: 777e28f34938d8792c31fe66c9f2add94feecd78e522df82be8773ea0a7a5e07
4
- data.tar.gz: 2cc3237633550576760d5e3c668f509ce9200322e2a8606535d27e281c7b67f6
3
+ metadata.gz: f045573621bd73cc02f898a0490f82e9dd23bb16c3bb19b59d8a221769f82b05
4
+ data.tar.gz: bad5418a5021c71875676cdcad683d436f2e3d657a1bf5dd0f235140d625c7fa
5
5
  SHA512:
6
- metadata.gz: 3995d0bb3b9650376e8be26e5746be89f9f37e93361914b0784260449b13c52326c0636d8d1cc193302ffed639e40a1b5151184b9d5c830d6024b293bea253bc
7
- data.tar.gz: 938a4c833f7dd11a444c7c16f1949ed32a8c2639770a68186b211218a037bf1856a79e04719baaf5e8ff1d63e9a603d0b2e6e9bf5b17684bea9c309e84c90213
6
+ metadata.gz: e7df01bd670072327b685ecfdeee70f9e2eb04be470a950baa6c7fb577236c263d8938c128ee9aad08c9290f8976883094a54f14fb621a8ebe8d5992a49e7741
7
+ data.tar.gz: 2044195773cb4676fd417d73746c4f0287f986f15a8fa997c703ae9aa3c857dabe65dc4533f102ca5ee077531d6d6a82ab1978f2d236892592fadc4b511ca155
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 0.4.1 (2021/07/11)
2
+
3
+ * [#37](https://github.com/dblock/strava-ruby-client/pull/38): Added `Club#club_events` - [@simonneutert](https://github.com/simonneutert).
4
+ * [#34](https://github.com/dblock/strava-ruby-client/pull/34): Added `Athlete#ftp` - [@virae](https://github.com/virae).
5
+
1
6
  ### 0.4.0 (2020/05/09)
2
7
 
3
8
  * [#29](https://github.com/dblock/strava-ruby-client/pull/29): Cache `Faraday::Connection` for persistent adapters - [@dblock](https://github.com/dblock).
data/README.md CHANGED
@@ -357,6 +357,20 @@ activity.name # => 'Afternoon Run'
357
357
 
358
358
  See [Strava::Models::Activity](lib/strava/models/activity.rb) for all available properties. Note that Strava does not return activity or athlete ID via this API.
359
359
 
360
+ #### List Club Events
361
+
362
+ Retrieve recent Events from a specific club.
363
+
364
+ ```ruby
365
+ events = client.club_events(108605) # => Array[Strava::Models::ClubEvent]
366
+
367
+ event = events.first # => Strava::Models::ClubEvent
368
+
369
+ event.title # => 'First Group Event Ever! Yippieh!'
370
+ ```
371
+
372
+ See [Strava::Models::ClubEvent](lib/strava/models/club_event.rb) for all available properties.
373
+
360
374
  #### List Club Administrators
361
375
 
362
376
  Returns a list of the administrators of a given club.
@@ -1058,6 +1072,7 @@ $ STRAVA_CLIENT_ID=... STRAVA_CLIENT_SECRET=... strava-oauth-token
1058
1072
 
1059
1073
  * [Slava: Strava integration with Slack](https://slava.playplay.io), [source](https://github.com/dblock/slack-strava).
1060
1074
  * [Jekyll Blog at run.dblock.org](https://run.dblock.org), [source](https://github.com/dblock/run.dblock.org)
1075
+ * [Secret Strava](https://steele.blue/secret-strava/), [source](https://github.com/mattdsteele/secret-strava)
1061
1076
 
1062
1077
  ## Resources
1063
1078
 
@@ -25,6 +25,7 @@ require_relative 'strava/models/map'
25
25
  require_relative 'strava/models/activity'
26
26
  require_relative 'strava/models/club'
27
27
  require_relative 'strava/models/club_admin'
28
+ require_relative 'strava/models/club_event'
28
29
  require_relative 'strava/models/club_member'
29
30
  require_relative 'strava/models/segment_effort'
30
31
  require_relative 'strava/models/photos'
@@ -17,6 +17,21 @@ module Strava
17
17
  paginate "clubs/#{id}/activities", options, Strava::Models::Activity, &block
18
18
  end
19
19
 
20
+ #
21
+ # List club / group events.
22
+ #
23
+ # @option options [String] :id
24
+ # Club id.
25
+ # @option options [Integer] :page
26
+ # Page number.
27
+ # @option options [Integer] :per_page
28
+ # Number of items per page. Defaults to 30.
29
+ #
30
+ def club_events(id_or_options, options = {}, &block)
31
+ id, options = parse_args(id_or_options, options)
32
+ paginate "clubs/#{id}/group_events", options, Strava::Models::ClubEvent, &block
33
+ end
34
+
20
35
  #
21
36
  # List club administrators.
22
37
  #
@@ -27,6 +27,7 @@ module Strava
27
27
  property 'date_preference'
28
28
  property 'measurement_preference'
29
29
  property 'clubs', transform_with: ->(v) { v.map { |r| Strava::Models::Club.new(r) } }
30
+ property 'ftp'
30
31
  property 'weight'
31
32
  property 'bikes', transform_with: ->(v) { v.map { |r| Strava::Models::Gear.new(r) } }
32
33
  property 'shoes', transform_with: ->(v) { v.map { |r| Strava::Models::Gear.new(r) } }
@@ -0,0 +1,28 @@
1
+ module Strava
2
+ module Models
3
+ class ClubEvent < Model
4
+ property 'id'
5
+ property 'resource_state'
6
+ property 'title'
7
+ property 'club_id'
8
+ property 'club', transform_with: ->(c) { Strava::Models::Club.new(c) }
9
+ property 'organizing_athlete', transform_with: ->(oa) { Strava::Models::Athlete.new(oa) }
10
+ property 'activity_type'
11
+ property 'created_at', transform_with: ->(v) { Time.parse(v) }
12
+ property 'route_id'
13
+ property 'route', transform_with: ->(r) { Strava::Models::Route.new(r) }
14
+ property 'women_only'
15
+ property 'private'
16
+ property 'skill_levels'
17
+ property 'terrain'
18
+ property 'upcoming_occurrences', transform_with: ->(upcoming) { upcoming.map { |o| Time.parse(o) } }
19
+ property 'zone'
20
+ property 'address'
21
+ property 'start_latlng'
22
+
23
+ def strava_url
24
+ "https://www.strava.com/clubs/#{club_id}/group_events/#{id}"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,3 +1,3 @@
1
1
  module Strava
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.4.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strava-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-09 00:00:00.000000000 Z
11
+ date: 2021-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description:
69
+ description:
70
70
  email: dblock@dblock.org
71
71
  executables:
72
72
  - strava-oauth-token
@@ -105,6 +105,7 @@ files:
105
105
  - lib/strava/models/authorization.rb
106
106
  - lib/strava/models/club.rb
107
107
  - lib/strava/models/club_admin.rb
108
+ - lib/strava/models/club_event.rb
108
109
  - lib/strava/models/club_member.rb
109
110
  - lib/strava/models/comment.rb
110
111
  - lib/strava/models/explorer_segment.rb
@@ -154,7 +155,7 @@ homepage: http://github.com/dblock/strava-ruby-client
154
155
  licenses:
155
156
  - MIT
156
157
  metadata: {}
157
- post_install_message:
158
+ post_install_message:
158
159
  rdoc_options: []
159
160
  require_paths:
160
161
  - lib
@@ -169,8 +170,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
170
  - !ruby/object:Gem::Version
170
171
  version: 1.3.6
171
172
  requirements: []
172
- rubygems_version: 3.0.3
173
- signing_key:
173
+ rubygems_version: 3.0.6
174
+ signing_key:
174
175
  specification_version: 4
175
176
  summary: Strava API Ruby client.
176
177
  test_files: []