spotifyrb 0.1.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.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/.env.example +3 -0
  3. data/.github/FUNDING.yml +5 -0
  4. data/.github/dependabot.yml +11 -0
  5. data/.github/workflows/ci.yml +42 -0
  6. data/.gitignore +9 -0
  7. data/.rubocop.yml +8 -0
  8. data/Gemfile +11 -0
  9. data/Gemfile.lock +124 -0
  10. data/LICENSE.txt +21 -0
  11. data/README.md +574 -0
  12. data/Rakefile +10 -0
  13. data/bin/console +19 -0
  14. data/bin/setup +8 -0
  15. data/lib/spotify/client.rb +56 -0
  16. data/lib/spotify/collection.rb +82 -0
  17. data/lib/spotify/error.rb +4 -0
  18. data/lib/spotify/error_generator.rb +128 -0
  19. data/lib/spotify/oauth.rb +61 -0
  20. data/lib/spotify/object.rb +19 -0
  21. data/lib/spotify/objects/album.rb +4 -0
  22. data/lib/spotify/objects/artist.rb +4 -0
  23. data/lib/spotify/objects/audiobook.rb +4 -0
  24. data/lib/spotify/objects/device.rb +4 -0
  25. data/lib/spotify/objects/episode.rb +4 -0
  26. data/lib/spotify/objects/player.rb +4 -0
  27. data/lib/spotify/objects/playlist.rb +4 -0
  28. data/lib/spotify/objects/show.rb +4 -0
  29. data/lib/spotify/objects/snapshot.rb +4 -0
  30. data/lib/spotify/objects/track.rb +4 -0
  31. data/lib/spotify/objects/user.rb +4 -0
  32. data/lib/spotify/resource.rb +64 -0
  33. data/lib/spotify/resources/albums.rb +16 -0
  34. data/lib/spotify/resources/artists.rb +20 -0
  35. data/lib/spotify/resources/me.rb +13 -0
  36. data/lib/spotify/resources/player.rb +46 -0
  37. data/lib/spotify/resources/playlists.rb +37 -0
  38. data/lib/spotify/resources/search.rb +10 -0
  39. data/lib/spotify/resources/users.rb +13 -0
  40. data/lib/spotify/version.rb +3 -0
  41. data/lib/spotify.rb +36 -0
  42. data/lib/spotifyrb.rb +1 -0
  43. data/spotifyrb.gemspec +29 -0
  44. metadata +111 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 345ef99e89558b4a5c11c6a836359de78ff54f8db0bcef8bde85a32b1a936ba3
4
+ data.tar.gz: 0e679b99c79f66528134becc5cdd6b30c89a0d7e942bf787aedabaf71fcf7e82
5
+ SHA512:
6
+ metadata.gz: c3df60285cca7ec260913ea4fe3f40a5de2902a13b63dabb15e160b9c14b87dcda4f4998884bfc779e1decb14002ae33bdfa7dcd544447dadd9c59025aa9e2bc
7
+ data.tar.gz: d8851f465644af778387b5f4bf564e6e798cc156367bfcd8866387ab5f6e4178efc75027c82532e51840fbbcaa034040107cc45ec324fc41b2f29aa595fe9e81
data/.env.example ADDED
@@ -0,0 +1,3 @@
1
+ SPOTIFY_CLIENT_ID=
2
+ SPOTIFY_CLIENT_SECRET=
3
+ SPOTIFY_ACCESS_TOKEN=
@@ -0,0 +1,5 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: deanpcmad
4
+ buy_me_a_coffee: deanpcmad
5
+ ko_fi: deanpcmad
@@ -0,0 +1,11 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: weekly
7
+ open-pull-requests-limit: 10
8
+ - package-ecosystem: github-actions
9
+ directory: "/"
10
+ schedule:
11
+ interval: monthly
@@ -0,0 +1,42 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ pull_request:
7
+ branches:
8
+ - main
9
+ jobs:
10
+ lint:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v4
15
+ - name: Set up Ruby
16
+ uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: '3.3'
19
+ bundler-cache: true
20
+ - name: Lint code for consistent style
21
+ run: bundle exec rubocop -f github
22
+
23
+ test:
24
+ runs-on: ubuntu-latest
25
+ needs: lint
26
+ strategy:
27
+ fail-fast: false
28
+ matrix:
29
+ ruby_version:
30
+ - '3.1'
31
+ - '3.2'
32
+ - '3.3'
33
+ steps:
34
+ - uses: actions/checkout@v4
35
+ - uses: ruby/setup-ruby@v1
36
+ with:
37
+ ruby-version: ${{ matrix.ruby_version }}
38
+ bundler: default
39
+ bundler-cache: true
40
+
41
+ - name: Run tests
42
+ run: bundle exec rake test
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ .env
data/.rubocop.yml ADDED
@@ -0,0 +1,8 @@
1
+ # Omakase Ruby styling for Rails
2
+ inherit_gem: { rubocop-rails-omakase: rubocop.yml }
3
+
4
+ # Overwrite or add rules to create your own house style
5
+ #
6
+ # # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
7
+ # Layout/SpaceInsideArrayLiteralBrackets:
8
+ # Enabled: false
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in spotify.gemspec
4
+ gemspec
5
+
6
+ gem "rake", "~> 12.0"
7
+ gem "minitest", "~> 5.0"
8
+ gem "dotenv"
9
+ gem "vcr"
10
+ gem "rubocop-rails-omakase", require: false
11
+ gem "irb"
data/Gemfile.lock ADDED
@@ -0,0 +1,124 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ spotifyrb (0.1.0)
5
+ faraday (~> 2.11)
6
+ ostruct (~> 0.6.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activesupport (7.1.3.4)
12
+ base64
13
+ bigdecimal
14
+ concurrent-ruby (~> 1.0, >= 1.0.2)
15
+ connection_pool (>= 2.2.5)
16
+ drb
17
+ i18n (>= 1.6, < 2)
18
+ minitest (>= 5.1)
19
+ mutex_m
20
+ tzinfo (~> 2.0)
21
+ ast (2.4.2)
22
+ base64 (0.2.0)
23
+ bigdecimal (3.1.8)
24
+ concurrent-ruby (1.3.3)
25
+ connection_pool (2.4.1)
26
+ date (3.4.1)
27
+ dotenv (3.1.2)
28
+ drb (2.2.1)
29
+ erb (5.0.1)
30
+ faraday (2.13.1)
31
+ faraday-net_http (>= 2.0, < 3.5)
32
+ json
33
+ logger
34
+ faraday-net_http (3.1.1)
35
+ net-http
36
+ i18n (1.14.5)
37
+ concurrent-ruby (~> 1.0)
38
+ io-console (0.8.0)
39
+ irb (1.15.2)
40
+ pp (>= 0.6.0)
41
+ rdoc (>= 4.0.0)
42
+ reline (>= 0.4.2)
43
+ json (2.7.2)
44
+ language_server-protocol (3.17.0.3)
45
+ logger (1.6.0)
46
+ minitest (5.24.1)
47
+ mutex_m (0.2.0)
48
+ net-http (0.4.1)
49
+ uri
50
+ ostruct (0.6.1)
51
+ parallel (1.25.1)
52
+ parser (3.3.4.0)
53
+ ast (~> 2.4.1)
54
+ racc
55
+ pp (0.6.2)
56
+ prettyprint
57
+ prettyprint (0.2.0)
58
+ psych (5.2.6)
59
+ date
60
+ stringio
61
+ racc (1.8.1)
62
+ rack (3.1.7)
63
+ rainbow (3.1.1)
64
+ rake (12.3.3)
65
+ rdoc (6.14.0)
66
+ erb
67
+ psych (>= 4.0.0)
68
+ regexp_parser (2.9.2)
69
+ reline (0.6.1)
70
+ io-console (~> 0.5)
71
+ rexml (3.3.4)
72
+ strscan
73
+ rubocop (1.65.1)
74
+ json (~> 2.3)
75
+ language_server-protocol (>= 3.17.0)
76
+ parallel (~> 1.10)
77
+ parser (>= 3.3.0.2)
78
+ rainbow (>= 2.2.2, < 4.0)
79
+ regexp_parser (>= 2.4, < 3.0)
80
+ rexml (>= 3.2.5, < 4.0)
81
+ rubocop-ast (>= 1.31.1, < 2.0)
82
+ ruby-progressbar (~> 1.7)
83
+ unicode-display_width (>= 2.4.0, < 3.0)
84
+ rubocop-ast (1.31.3)
85
+ parser (>= 3.3.1.0)
86
+ rubocop-minitest (0.35.1)
87
+ rubocop (>= 1.61, < 2.0)
88
+ rubocop-ast (>= 1.31.1, < 2.0)
89
+ rubocop-performance (1.21.1)
90
+ rubocop (>= 1.48.1, < 2.0)
91
+ rubocop-ast (>= 1.31.1, < 2.0)
92
+ rubocop-rails (2.25.1)
93
+ activesupport (>= 4.2.0)
94
+ rack (>= 1.1)
95
+ rubocop (>= 1.33.0, < 2.0)
96
+ rubocop-ast (>= 1.31.1, < 2.0)
97
+ rubocop-rails-omakase (1.0.0)
98
+ rubocop
99
+ rubocop-minitest
100
+ rubocop-performance
101
+ rubocop-rails
102
+ ruby-progressbar (1.13.0)
103
+ stringio (3.1.7)
104
+ strscan (3.1.0)
105
+ tzinfo (2.0.6)
106
+ concurrent-ruby (~> 1.0)
107
+ unicode-display_width (2.5.0)
108
+ uri (0.13.0)
109
+ vcr (6.2.0)
110
+
111
+ PLATFORMS
112
+ ruby
113
+
114
+ DEPENDENCIES
115
+ dotenv
116
+ irb
117
+ minitest (~> 5.0)
118
+ rake (~> 12.0)
119
+ rubocop-rails-omakase
120
+ spotifyrb!
121
+ vcr
122
+
123
+ BUNDLED WITH
124
+ 2.5.17
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Dean Perry
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.