rspotify 2.11.1 → 2.12.0

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: 0d9d7a49993e755934d77091d568c04862f676c0b52ffe14ab80355cf38c17c1
4
- data.tar.gz: 13d0709271280fb895df8f8941915a3090e426d020013552fb0af50656e21f3d
3
+ metadata.gz: 9ad5348b6d88e2e2f36d4f8a08a5979e84cf6b09c0674c65ce49095b7536284d
4
+ data.tar.gz: 2a369690af6ad4401c081ff980d156fd31eaa853ab5b36a7a0b4bede28ec53e2
5
5
  SHA512:
6
- metadata.gz: def7d61e7f73af6ff9f03bdfbe562c21b462a6820778d76437a6c660bbeb3d3e4f23f11e6ab6c349abb8458da6ad769545e2edc0de3caf563c653ff069c14ee0
7
- data.tar.gz: d79c15a25e18878e3a27cba75e0e41a7fab88ecd430e25ae9183c97a88a6d6ff46d9001326d848fe16ed77094a7e8e4a680dd1e0ace6b6271684b728131fc4c4
6
+ metadata.gz: 1a9f861ce328736c47078c3f64b051621e3c442037c9636e24bf64dbde4c85a7efcc0fb3ec7c85db96fb297b41a7f0a37b20446e0ecfa0d1ab8f23d682c1a202
7
+ data.tar.gz: 84e5dcfecd734d927b63a79365b5a4dc0669dec8412028322d19944be7f4995d15a0adaaf4287066de66bf6452c29003fd6a2e6cfa29a1bc2d9a9b8da223b09e
@@ -0,0 +1,26 @@
1
+ name: Ruby
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+
9
+ strategy:
10
+ matrix:
11
+ ruby-version: ['head', '3.1', '3.0', '2.7', '2.6', '2.3']
12
+
13
+ steps:
14
+ - uses: actions/checkout@v3
15
+
16
+ - name: Set up Ruby ${{ matrix.ruby-version }}
17
+ uses: ruby/setup-ruby@v1
18
+ with:
19
+ ruby-version: ${{ matrix.ruby-version }}
20
+ bundler-cache: true
21
+
22
+ - name: Install dependencies
23
+ run: bundle install
24
+
25
+ - name: Run tests
26
+ run: bundle exec rspec
data/.gitignore CHANGED
@@ -6,3 +6,5 @@ doc
6
6
  pkg
7
7
  Gemfile.lock
8
8
  *.swp
9
+ .tool-versions
10
+ .DS_Store
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # RSpotify
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/rspotify.svg)](http://badge.fury.io/rb/rspotify)
4
- [![Build Status](https://travis-ci.org/guilhermesad/rspotify.svg?branch=master)](https://travis-ci.org/guilhermesad/rspotify)
4
+ [![Build Status](https://github.com/guilhermesad/rspotify/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/guilhermesad/rspotify/actions)
5
5
 
6
6
  This is a ruby wrapper for the [Spotify Web API](https://developer.spotify.com/web-api).
7
7
 
@@ -31,7 +31,7 @@ RSpotify was designed with usability as its primary goal, so that you can forget
31
31
 
32
32
  You can write things like `my_playlist.tracks.sort_by(&:popularity).last.album` without having to think which API calls must be done. RSpotify fills the gaps for you.
33
33
 
34
- Below are some basic usage examples. Check the [documentation](http://rdoc.info/github/guilhermesad/rspotify/master/frames) for the complete reference.
34
+ Below are some basic usage examples. Check the [documentation](http://rubydoc.info/github/guilhermesad/rspotify/master/frames) for the complete reference.
35
35
 
36
36
  ```ruby
37
37
  require 'rspotify'
@@ -153,6 +153,8 @@ require 'rspotify/oauth'
153
153
  Rails.application.config.middleware.use OmniAuth::Builder do
154
154
  provider :spotify, "<your_client_id>", "<your_client_secret>", scope: 'user-read-email playlist-modify-public user-library-read user-library-modify'
155
155
  end
156
+
157
+ OmniAuth.config.allowed_request_methods = [:post, :get]
156
158
  ```
157
159
 
158
160
  You should replace the scope values for the ones your own app will require from the user. You can see the list of available scopes in [here](https://developer.spotify.com/documentation/general/guides/authorization/scopes/).
@@ -160,7 +162,7 @@ You should replace the scope values for the ones your own app will require from
160
162
  Next, make a link so the user can log in with his Spotify account:
161
163
 
162
164
  ```ruby
163
- <%= link_to 'Sign in with Spotify', '/auth/spotify' %>
165
+ <%= link_to 'Sign in with Spotify', '/auth/spotify', method: :post %>
164
166
  ```
165
167
 
166
168
  And create a route to receive the callback:
@@ -73,6 +73,22 @@ module RSpotify
73
73
  User.oauth_put(@user.id, url, params.to_json)
74
74
  end
75
75
 
76
+ # Get the user’s current playback queue
77
+ #
78
+ # @example
79
+ # player = user.player
80
+ # player.next_up
81
+ def next_up
82
+ url = "me/player/queue"
83
+ response = User.oauth_get(@user.id, url)
84
+ return response if RSpotify.raw_response
85
+
86
+ response["queue"].map do |item|
87
+ type_class = RSpotify.const_get(item["type"].capitalize)
88
+ type_class.new item
89
+ end
90
+ end
91
+
76
92
  # Add an item to the end of the user’s current playback queue
77
93
  # If `device_id` is not passed, the currently active spotify app will be triggered
78
94
  #
@@ -1,3 +1,3 @@
1
1
  module RSpotify
2
- VERSION = '2.11.1'.freeze
2
+ VERSION = '2.12.0'.freeze
3
3
  end
data/rspotify.gemspec CHANGED
@@ -27,5 +27,5 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'yard'
28
28
  spec.add_development_dependency 'vcr', '~> 3.0'
29
29
 
30
- spec.required_ruby_version = '>= 2.0.0'
30
+ spec.required_ruby_version = '>= 2.3.0'
31
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspotify
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.11.1
4
+ version: 2.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Sad
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-06 00:00:00.000000000 Z
11
+ date: 2023-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -145,9 +145,9 @@ extra_rdoc_files: []
145
145
  files:
146
146
  - ".editorconfig"
147
147
  - ".github/FUNDING.yml"
148
+ - ".github/workflows/main.yml"
148
149
  - ".gitignore"
149
150
  - ".rspec"
150
- - ".travis.yml"
151
151
  - Gemfile
152
152
  - LICENSE.txt
153
153
  - README.md
@@ -294,14 +294,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
294
294
  requirements:
295
295
  - - ">="
296
296
  - !ruby/object:Gem::Version
297
- version: 2.0.0
297
+ version: 2.3.0
298
298
  required_rubygems_version: !ruby/object:Gem::Requirement
299
299
  requirements:
300
300
  - - ">="
301
301
  - !ruby/object:Gem::Version
302
302
  version: '0'
303
303
  requirements: []
304
- rubygems_version: 3.0.6
304
+ rubygems_version: 3.1.6
305
305
  signing_key:
306
306
  specification_version: 4
307
307
  summary: A ruby wrapper for the Spotify Web API
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- language: ruby
2
-
3
- notifications:
4
- email: false
5
-
6
- rvm:
7
- - ruby-head
8
-
9
- script:
10
- - "bundle exec rspec"