spotify-client 0.0.10 → 1.0.0
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 +5 -5
- data/LICENSE +21 -0
- data/README.md +104 -0
- data/lib/spotify/version.rb +3 -1
- data/lib/spotify-client.rb +1 -1
- data/lib/spotify_client.rb +82 -61
- data/spotify-client.gemspec +36 -0
- metadata +30 -35
- data/lib/spotify/utils.rb +0 -11
- data/lib/spotify_client/version.rb +0 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 4a361b913ec9f98ccc159ec5c23a0f504905fa0d3f9ac991529f59bdb814ccbc
|
|
4
|
+
data.tar.gz: 499d48ce76d1999d5c7fa4d866927c3b7d0297c6cdb89a3d782a48b454c28e21
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 279fdba53d86dc07c61d38e3be2bc2e5874c13eaedea567fa93418c0e5c27d000b0623cd2f3d828b941f606440b4fbd1d51217efadfd36203e446872431db272
|
|
7
|
+
data.tar.gz: 542ede4f6390e03c99dfe175b78861201e7f119b597e1b525d69d85710ffd4c6fa21eb45ceb73ea7ea0285c261eb546d22916a00ab2732ae6cd837d4db444864
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT LICENSE
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 Claudio Poli <claudio@icorete.ch>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# spotify-client
|
|
2
|
+
|
|
3
|
+
Ruby client for the [Spotify Web API](https://developer.spotify.com/documentation/web-api).
|
|
4
|
+
|
|
5
|
+
[](https://rubygems.org/gems/spotify-client)
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Add this line to your application's `Gemfile`:
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
gem 'spotify-client'
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
And then execute:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
bundle install
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or install it yourself as:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
gem install spotify-client
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Supported Ruby Versions
|
|
28
|
+
|
|
29
|
+
The CI matrix runs this gem against Ruby `3.2`, `3.3`, `3.4`, `4.0`, and `ruby-head`.
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
```ruby
|
|
34
|
+
config = {
|
|
35
|
+
access_token: 'tk',
|
|
36
|
+
raise_errors: true,
|
|
37
|
+
retries: 0,
|
|
38
|
+
read_timeout: 10,
|
|
39
|
+
write_timeout: 10,
|
|
40
|
+
persistent: false
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
client = Spotify::Client.new(config)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Public API
|
|
47
|
+
|
|
48
|
+
```ruby
|
|
49
|
+
client.me
|
|
50
|
+
client.me_tracks
|
|
51
|
+
client.me_following
|
|
52
|
+
client.user(user_id)
|
|
53
|
+
client.user_playlists(user_id) # user_id kept for backward compatibility; requests /v1/me/playlists
|
|
54
|
+
client.user_playlist(user_id, playlist_id)
|
|
55
|
+
client.user_playlist_tracks(user_id, playlist_id, params = {})
|
|
56
|
+
client.create_user_playlist(user_id, name, is_public = true)
|
|
57
|
+
client.add_user_tracks_to_playlist(user_id, playlist_id, uris = [], position = nil)
|
|
58
|
+
client.remove_user_tracks_from_playlist(user_id, playlist_id, tracks)
|
|
59
|
+
client.replace_user_tracks_in_playlist(user_id, playlist_id, tracks)
|
|
60
|
+
client.truncate_user_playlist(user_id, playlist_id)
|
|
61
|
+
client.album(album_id)
|
|
62
|
+
client.album_tracks(album_id)
|
|
63
|
+
client.albums(album_ids)
|
|
64
|
+
client.track(track_id)
|
|
65
|
+
client.tracks(track_ids)
|
|
66
|
+
client.artist(artist_id)
|
|
67
|
+
client.artists(artist_ids)
|
|
68
|
+
client.artist_albums(artist_id)
|
|
69
|
+
client.search(entity, term, options = {})
|
|
70
|
+
client.artist_top_tracks(artist_id, country_id)
|
|
71
|
+
client.related_artists(artist_id)
|
|
72
|
+
client.follow(type, ids)
|
|
73
|
+
client.follow_playlist(user_id, playlist_id, is_public = true)
|
|
74
|
+
client.request(:get, '/v1/me') # generic helper for newer endpoints
|
|
75
|
+
client.request!(:post, '/v1/some-endpoint', [201], payload, false)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Spotify API Migration Notes
|
|
79
|
+
|
|
80
|
+
Spotify's Web API changed and removed several legacy endpoints in 2026. This gem now uses current routes while keeping backward-compatible method signatures:
|
|
81
|
+
|
|
82
|
+
- Playlist reads/writes use `/v1/me/playlists` and `/v1/playlists/{playlist_id}/*`.
|
|
83
|
+
- `follow(type, ids)` keeps the same signature but now targets `/v1/me/library` (the `type` argument is ignored for compatibility).
|
|
84
|
+
- `artist_top_tracks` now uses the top-songs route.
|
|
85
|
+
|
|
86
|
+
- Changelog: [Spotify Web API Changelog](https://developer.spotify.com/documentation/web-api/concepts/changelog)
|
|
87
|
+
- Migration guide: [Spotify Web API Migration Guide](https://developer.spotify.com/documentation/web-api/concepts/migration-guide)
|
|
88
|
+
|
|
89
|
+
## Development
|
|
90
|
+
|
|
91
|
+
Install dependencies and run checks:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
bundle install
|
|
95
|
+
bundle exec rake
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Release
|
|
99
|
+
|
|
100
|
+
Pushing a tag matching `v*` triggers the release workflow that builds and publishes the gem.
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
MIT. See [LICENSE](LICENSE).
|
data/lib/spotify/version.rb
CHANGED
data/lib/spotify-client.rb
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require File.dirname(__FILE__)
|
|
1
|
+
require "#{File.dirname(__FILE__)}/spotify_client"
|
data/lib/spotify_client.rb
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
require 'excon'
|
|
2
2
|
require 'json'
|
|
3
3
|
|
|
4
|
-
require File.dirname(__FILE__)
|
|
5
|
-
require File.dirname(__FILE__) + '/spotify/exceptions'
|
|
4
|
+
require "#{File.dirname(__FILE__)}/spotify/exceptions"
|
|
6
5
|
|
|
7
6
|
module Spotify
|
|
8
7
|
class Client
|
|
@@ -44,32 +43,37 @@ module Spotify
|
|
|
44
43
|
run(:get, '/v1/me/tracks', [200])
|
|
45
44
|
end
|
|
46
45
|
|
|
46
|
+
# params:
|
|
47
|
+
# - type: Required, The ID type, currently only 'artist' is supported
|
|
48
|
+
# - limit: Optional. The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
|
|
49
|
+
# - after: Optional. The last artist ID retrieved from the previous request.
|
|
50
|
+
def me_following(params = {})
|
|
51
|
+
params = params.merge(type: 'artist')
|
|
52
|
+
run(:get, '/v1/me/following', [200], params)
|
|
53
|
+
end
|
|
54
|
+
|
|
47
55
|
def user(user_id)
|
|
48
56
|
run(:get, "/v1/users/#{user_id}", [200])
|
|
49
57
|
end
|
|
50
58
|
|
|
51
|
-
def user_playlists(
|
|
52
|
-
run(:get,
|
|
59
|
+
def user_playlists(_user_id = nil)
|
|
60
|
+
run(:get, '/v1/me/playlists', [200])
|
|
53
61
|
end
|
|
54
62
|
|
|
55
|
-
def user_playlist(
|
|
56
|
-
run(:get, "/v1/
|
|
63
|
+
def user_playlist(_user_id, playlist_id)
|
|
64
|
+
run(:get, "/v1/playlists/#{playlist_id}", [200])
|
|
57
65
|
end
|
|
58
66
|
|
|
59
|
-
def user_playlist_tracks(
|
|
67
|
+
def user_playlist_tracks(_user_id, playlist_id, params = {})
|
|
60
68
|
tracks = { 'items' => [] }
|
|
61
|
-
path = "/v1/
|
|
69
|
+
path = "/v1/playlists/#{playlist_id}/tracks"
|
|
62
70
|
|
|
63
71
|
while path
|
|
64
72
|
response = run(:get, path, [200], params)
|
|
65
73
|
tracks['items'].concat(response.delete('items'))
|
|
66
74
|
tracks.merge!(response)
|
|
67
75
|
|
|
68
|
-
path =
|
|
69
|
-
response['next'].gsub(BASE_URI, '')
|
|
70
|
-
else
|
|
71
|
-
nil
|
|
72
|
-
end
|
|
76
|
+
path = response['next']&.gsub(BASE_URI, '')
|
|
73
77
|
end
|
|
74
78
|
|
|
75
79
|
tracks
|
|
@@ -79,8 +83,8 @@ module Spotify
|
|
|
79
83
|
#
|
|
80
84
|
# Requires playlist-modify-public for a public playlist.
|
|
81
85
|
# Requires playlist-modify-private for a private playlist.
|
|
82
|
-
def create_user_playlist(
|
|
83
|
-
run(:post,
|
|
86
|
+
def create_user_playlist(_user_id, name, is_public = true)
|
|
87
|
+
run(:post, '/v1/me/playlists', [201], JSON.dump(name: name, public: is_public), false)
|
|
84
88
|
end
|
|
85
89
|
|
|
86
90
|
# Add an Array of track uris to an existing playlist.
|
|
@@ -88,27 +92,31 @@ module Spotify
|
|
|
88
92
|
# Adding tracks to a user's public playlist requires authorization of the playlist-modify-public scope;
|
|
89
93
|
# adding tracks to a private playlist requires the playlist-modify-private scope.
|
|
90
94
|
#
|
|
91
|
-
# client.add_user_tracks_to_playlist(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
run(:post, "/v1/
|
|
95
|
+
# client.add_user_tracks_to_playlist(
|
|
96
|
+
# '1181346016', '7i3thJWDtmX04dJhFwYb0x', %w(spotify:track:... spotify:track:...)
|
|
97
|
+
# )
|
|
98
|
+
def add_user_tracks_to_playlist(_user_id, playlist_id, uris = [], position = nil)
|
|
99
|
+
params = { uris: Array(uris)[0..99].join(',') }
|
|
100
|
+
params.merge!(position: position) if position
|
|
101
|
+
run(:post, "/v1/playlists/#{playlist_id}/items", [200, 201], JSON.dump(params), false)
|
|
98
102
|
end
|
|
99
103
|
|
|
100
104
|
# Removes tracks from playlist
|
|
101
105
|
#
|
|
102
|
-
# client.remove_user_tracks_from_playlist(
|
|
103
|
-
|
|
104
|
-
|
|
106
|
+
# client.remove_user_tracks_from_playlist(
|
|
107
|
+
# '1181346016', '7i3thJWDtmX04dJhFwYb0x', [{ uri: 'spotify:track:...', positions: [0] }]
|
|
108
|
+
# )
|
|
109
|
+
def remove_user_tracks_from_playlist(_user_id, playlist_id, tracks)
|
|
110
|
+
run(:delete, "/v1/playlists/#{playlist_id}/tracks", [200], JSON.dump(tracks: tracks))
|
|
105
111
|
end
|
|
106
112
|
|
|
107
113
|
# Replaces all occurrences of tracks with what's in the playlist
|
|
108
114
|
#
|
|
109
|
-
# client.replace_user_tracks_in_playlist(
|
|
110
|
-
|
|
111
|
-
|
|
115
|
+
# client.replace_user_tracks_in_playlist(
|
|
116
|
+
# '1181346016', '7i3thJWDtmX04dJhFwYb0x', %w(spotify:track:... spotify:track:...)
|
|
117
|
+
# )
|
|
118
|
+
def replace_user_tracks_in_playlist(_user_id, playlist_id, tracks)
|
|
119
|
+
run(:put, "/v1/playlists/#{playlist_id}/tracks", [200, 201], JSON.dump(uris: tracks))
|
|
112
120
|
end
|
|
113
121
|
|
|
114
122
|
# Removes all tracks in playlist
|
|
@@ -127,7 +135,7 @@ module Spotify
|
|
|
127
135
|
end
|
|
128
136
|
|
|
129
137
|
def albums(album_ids)
|
|
130
|
-
params = { ids: Array
|
|
138
|
+
params = { ids: Array(album_ids).join(',') }
|
|
131
139
|
run(:get, '/v1/albums', [200], params)
|
|
132
140
|
end
|
|
133
141
|
|
|
@@ -136,7 +144,7 @@ module Spotify
|
|
|
136
144
|
end
|
|
137
145
|
|
|
138
146
|
def tracks(track_ids)
|
|
139
|
-
params = { ids: Array
|
|
147
|
+
params = { ids: Array(track_ids).join(',') }
|
|
140
148
|
run(:get, '/v1/tracks', [200], params)
|
|
141
149
|
end
|
|
142
150
|
|
|
@@ -145,7 +153,7 @@ module Spotify
|
|
|
145
153
|
end
|
|
146
154
|
|
|
147
155
|
def artists(artist_ids)
|
|
148
|
-
params = { ids: Array
|
|
156
|
+
params = { ids: Array(artist_ids).join(',') }
|
|
149
157
|
run(:get, '/v1/artists', [200], params)
|
|
150
158
|
end
|
|
151
159
|
|
|
@@ -153,18 +161,23 @@ module Spotify
|
|
|
153
161
|
run(:get, "/v1/artists/#{artist_id}/albums", [200])
|
|
154
162
|
end
|
|
155
163
|
|
|
156
|
-
def search(entity, term)
|
|
157
|
-
unless [
|
|
158
|
-
|
|
164
|
+
def search(entity, term, options = {})
|
|
165
|
+
unless %i[artist album track].include?(entity.to_sym)
|
|
166
|
+
raise(ImplementationError, "entity needs to be either artist, album or track, got: #{entity}")
|
|
159
167
|
end
|
|
160
|
-
|
|
168
|
+
|
|
169
|
+
params = {
|
|
170
|
+
q: term.to_s,
|
|
171
|
+
type: entity
|
|
172
|
+
}.merge(options)
|
|
173
|
+
run(:get, '/v1/search', [200], params)
|
|
161
174
|
end
|
|
162
175
|
|
|
163
176
|
# Get Spotify catalog information about an artist's top 10 tracks by country.
|
|
164
177
|
#
|
|
165
178
|
# +country_id+ is required. An ISO 3166-1 alpha-2 country code.
|
|
166
179
|
def artist_top_tracks(artist_id, country_id)
|
|
167
|
-
run(:get, "/v1/artists/#{artist_id}/top-
|
|
180
|
+
run(:get, "/v1/artists/#{artist_id}/top-songs", [200], market: country_id)
|
|
168
181
|
end
|
|
169
182
|
|
|
170
183
|
def related_artists(artist_id)
|
|
@@ -175,15 +188,26 @@ module Spotify
|
|
|
175
188
|
#
|
|
176
189
|
# client.follow('artist', ['0BvkDsjIUla7X0k6CSWh1I'])
|
|
177
190
|
def follow(type, ids)
|
|
178
|
-
|
|
179
|
-
|
|
191
|
+
_type = type # kept for backward-compatible signature
|
|
192
|
+
params = { ids: Array(ids).join(',') }
|
|
193
|
+
run(:put, '/v1/me/library', [200, 204], params)
|
|
180
194
|
end
|
|
181
195
|
|
|
182
196
|
# Follow a playlist
|
|
183
197
|
#
|
|
184
198
|
# client.follow_playlist('lukebryan', '0obRj9nNySESpFelMCLSya')
|
|
185
|
-
def follow_playlist(
|
|
186
|
-
run(:put, "/v1/
|
|
199
|
+
def follow_playlist(_user_id, playlist_id, is_public = true)
|
|
200
|
+
run(:put, "/v1/playlists/#{playlist_id}/followers", [200, 204], { public: is_public })
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Generic API helper for forward compatibility with newly added endpoints.
|
|
204
|
+
def request(verb, path, expected_status_codes = [200], params_or_body = {}, idempotent = true)
|
|
205
|
+
run(verb.to_sym, path, Array(expected_status_codes), params_or_body, idempotent)
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Bang variant that propagates mapped API errors.
|
|
209
|
+
def request!(verb, path, expected_status_codes = [200], params_or_body = {}, idempotent = true)
|
|
210
|
+
run!(verb.to_sym, path, Array(expected_status_codes), params_or_body, idempotent)
|
|
187
211
|
end
|
|
188
212
|
|
|
189
213
|
protected
|
|
@@ -191,11 +215,9 @@ module Spotify
|
|
|
191
215
|
def run(verb, path, expected_status_codes, params = {}, idempotent = true)
|
|
192
216
|
run!(verb, path, expected_status_codes, params, idempotent)
|
|
193
217
|
rescue Error => e
|
|
194
|
-
if @raise_errors
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
false
|
|
198
|
-
end
|
|
218
|
+
raise e if @raise_errors
|
|
219
|
+
|
|
220
|
+
false
|
|
199
221
|
end
|
|
200
222
|
|
|
201
223
|
def run!(verb, path, expected_status_codes, params_or_body = nil, idempotent = true)
|
|
@@ -209,7 +231,7 @@ module Spotify
|
|
|
209
231
|
retry_limit: @retries,
|
|
210
232
|
headers: {
|
|
211
233
|
'Content-Type' => 'application/json',
|
|
212
|
-
'User-Agent'
|
|
234
|
+
'User-Agent' => 'Spotify Ruby Client'
|
|
213
235
|
}
|
|
214
236
|
}
|
|
215
237
|
if params_or_body.is_a?(Hash)
|
|
@@ -218,30 +240,29 @@ module Spotify
|
|
|
218
240
|
packet.merge!(body: params_or_body)
|
|
219
241
|
end
|
|
220
242
|
|
|
221
|
-
if !@access_token.nil? && @access_token != ''
|
|
222
|
-
packet[:headers].merge!('Authorization' => "Bearer #{@access_token}")
|
|
223
|
-
end
|
|
243
|
+
packet[:headers].merge!('Authorization' => "Bearer #{@access_token}") if !@access_token.nil? && @access_token != ''
|
|
224
244
|
|
|
225
245
|
# puts "\033[31m [Spotify] HTTP Request: #{verb.upcase} #{BASE_URI}#{path} #{packet[:headers].inspect} \e[0m"
|
|
226
246
|
response = @connection.request(packet)
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
247
|
+
return {} if response.body.nil? || response.body.empty?
|
|
248
|
+
|
|
249
|
+
::JSON.parse(response.body)
|
|
250
|
+
rescue Excon::Errors::NotFound => e
|
|
251
|
+
raise(ResourceNotFound, "Error: #{e.message}")
|
|
252
|
+
rescue Excon::Errors::BadRequest => e
|
|
253
|
+
raise(BadRequest, "Error: #{e.message}")
|
|
254
|
+
rescue Excon::Errors::Forbidden => e
|
|
255
|
+
raise(InsufficientClientScopeError, "Error: #{e.message}")
|
|
256
|
+
rescue Excon::Errors::Unauthorized => e
|
|
257
|
+
raise(AuthenticationError, "Error: #{e.message}")
|
|
258
|
+
rescue Excon::Errors::Error => e
|
|
238
259
|
# Catch all others errors. Samples:
|
|
239
260
|
#
|
|
240
261
|
# <Excon::Errors::SocketError: Connection refused - connect(2) (Errno::ECONNREFUSED)>
|
|
241
262
|
# <Excon::Errors::InternalServerError: Expected([200, 204, 404]) <=> Actual(500 InternalServerError)>
|
|
242
263
|
# <Excon::Errors::Timeout: read timeout reached>
|
|
243
264
|
# <Excon::Errors::BadGateway: Expected([200]) <=> Actual(502 Bad Gateway)>
|
|
244
|
-
raise(HTTPError, "Error: #{
|
|
265
|
+
raise(HTTPError, "Error: #{e.message}")
|
|
245
266
|
end
|
|
246
267
|
end
|
|
247
268
|
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
|
+
version_file = File.expand_path('lib/spotify/version.rb', __dir__)
|
|
6
|
+
version = File.read(version_file).match(/VERSION = '([^']+)'/)&.captures&.first
|
|
7
|
+
raise 'Could not determine gem version' unless version
|
|
8
|
+
|
|
9
|
+
Gem::Specification.new do |spec|
|
|
10
|
+
spec.name = 'spotify-client'
|
|
11
|
+
spec.version = version
|
|
12
|
+
spec.authors = ['Claudio Poli']
|
|
13
|
+
spec.email = ['masterkain@gmail.com']
|
|
14
|
+
|
|
15
|
+
spec.summary = 'Ruby client for the Spotify Web API'
|
|
16
|
+
spec.description = 'Lightweight Ruby client for the Spotify Web API with playlist and catalog helpers.'
|
|
17
|
+
spec.homepage = 'https://github.com/icoretech/spotify-client'
|
|
18
|
+
spec.license = 'MIT'
|
|
19
|
+
spec.required_ruby_version = '>= 3.2'
|
|
20
|
+
|
|
21
|
+
spec.metadata['source_code_uri'] = 'https://github.com/icoretech/spotify-client'
|
|
22
|
+
spec.metadata['bug_tracker_uri'] = 'https://github.com/icoretech/spotify-client/issues'
|
|
23
|
+
spec.metadata['changelog_uri'] = 'https://github.com/icoretech/spotify-client/releases'
|
|
24
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
25
|
+
|
|
26
|
+
spec.files = Dir[
|
|
27
|
+
'lib/**/*.rb',
|
|
28
|
+
'README*',
|
|
29
|
+
'LICENSE*',
|
|
30
|
+
'*.gemspec'
|
|
31
|
+
]
|
|
32
|
+
spec.require_paths = ['lib']
|
|
33
|
+
|
|
34
|
+
spec.add_dependency 'excon', '>= 0.112', '< 2.0'
|
|
35
|
+
spec.add_dependency 'logger', '>= 1.7'
|
|
36
|
+
end
|
metadata
CHANGED
|
@@ -1,74 +1,71 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spotify-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Claudio Poli
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: excon
|
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
|
16
15
|
requirements:
|
|
17
|
-
- - "
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0.112'
|
|
19
|
+
- - "<"
|
|
18
20
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0
|
|
21
|
+
version: '2.0'
|
|
20
22
|
type: :runtime
|
|
21
23
|
prerelease: false
|
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
25
|
requirements:
|
|
24
|
-
- - "
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '0.37'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: rspec
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - "~>"
|
|
26
|
+
- - ">="
|
|
32
27
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
34
|
-
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - "~>"
|
|
28
|
+
version: '0.112'
|
|
29
|
+
- - "<"
|
|
39
30
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
31
|
+
version: '2.0'
|
|
41
32
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
33
|
+
name: logger
|
|
43
34
|
requirement: !ruby/object:Gem::Requirement
|
|
44
35
|
requirements:
|
|
45
36
|
- - ">="
|
|
46
37
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
48
|
-
type: :
|
|
38
|
+
version: '1.7'
|
|
39
|
+
type: :runtime
|
|
49
40
|
prerelease: false
|
|
50
41
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
42
|
requirements:
|
|
52
43
|
- - ">="
|
|
53
44
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
55
|
-
description: Ruby client for the Spotify Web API
|
|
45
|
+
version: '1.7'
|
|
46
|
+
description: Lightweight Ruby client for the Spotify Web API with playlist and catalog
|
|
47
|
+
helpers.
|
|
56
48
|
email:
|
|
57
|
-
-
|
|
49
|
+
- masterkain@gmail.com
|
|
58
50
|
executables: []
|
|
59
51
|
extensions: []
|
|
60
52
|
extra_rdoc_files: []
|
|
61
53
|
files:
|
|
54
|
+
- LICENSE
|
|
55
|
+
- README.md
|
|
62
56
|
- lib/spotify-client.rb
|
|
63
57
|
- lib/spotify/exceptions.rb
|
|
64
|
-
- lib/spotify/utils.rb
|
|
65
58
|
- lib/spotify/version.rb
|
|
66
59
|
- lib/spotify_client.rb
|
|
67
|
-
-
|
|
60
|
+
- spotify-client.gemspec
|
|
68
61
|
homepage: https://github.com/icoretech/spotify-client
|
|
69
|
-
licenses:
|
|
70
|
-
|
|
71
|
-
|
|
62
|
+
licenses:
|
|
63
|
+
- MIT
|
|
64
|
+
metadata:
|
|
65
|
+
source_code_uri: https://github.com/icoretech/spotify-client
|
|
66
|
+
bug_tracker_uri: https://github.com/icoretech/spotify-client/issues
|
|
67
|
+
changelog_uri: https://github.com/icoretech/spotify-client/releases
|
|
68
|
+
rubygems_mfa_required: 'true'
|
|
72
69
|
rdoc_options: []
|
|
73
70
|
require_paths:
|
|
74
71
|
- lib
|
|
@@ -76,16 +73,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
76
73
|
requirements:
|
|
77
74
|
- - ">="
|
|
78
75
|
- !ruby/object:Gem::Version
|
|
79
|
-
version: '
|
|
76
|
+
version: '3.2'
|
|
80
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
78
|
requirements:
|
|
82
79
|
- - ">="
|
|
83
80
|
- !ruby/object:Gem::Version
|
|
84
81
|
version: '0'
|
|
85
82
|
requirements: []
|
|
86
|
-
|
|
87
|
-
rubygems_version: 2.4.8
|
|
88
|
-
signing_key:
|
|
83
|
+
rubygems_version: 4.0.3
|
|
89
84
|
specification_version: 4
|
|
90
85
|
summary: Ruby client for the Spotify Web API
|
|
91
86
|
test_files: []
|
data/lib/spotify/utils.rb
DELETED