spotify 10.1.0 → 10.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +23 -0
- data/README.markdown +9 -2
- data/lib/spotify.rb +17 -5
- data/lib/spotify/version.rb +1 -1
- data/spotify.gemspec +4 -3
- metadata +29 -18
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,26 @@
|
|
1
|
+
[v10.1.1][]
|
2
|
+
-----------
|
3
|
+
- mark ALL libspotify functions as blocking
|
4
|
+
|
5
|
+
[v10.1.0][]
|
6
|
+
-----------
|
7
|
+
- fix Spotify::Subscribers for empty subscribers
|
8
|
+
- Up FFI version dependency to v1.0.11 (Spotify::Bool is no more)
|
9
|
+
|
10
|
+
[v10.0.0][]
|
11
|
+
-----------
|
12
|
+
- upgrade to libspotify v10 (see changelog for details)
|
13
|
+
|
14
|
+
[v9.1.0][]
|
15
|
+
----------
|
16
|
+
- Spotify::Subscribers now supports retrieving members by array index
|
17
|
+
|
1
18
|
[v9.0.1][]
|
19
|
+
----------
|
2
20
|
- mark sp_session_player_load as blocking
|
3
21
|
|
4
22
|
[v9.0.0][]
|
23
|
+
----------
|
5
24
|
- upgrade to libspotify 9
|
6
25
|
- loosen up dependency version constraints
|
7
26
|
|
@@ -54,6 +73,10 @@ v0.0.0
|
|
54
73
|
------
|
55
74
|
- release to register rubygems.org name
|
56
75
|
|
76
|
+
[v10.1.1]: https://github.com/Burgestrand/libspotify-ruby/compare/v10.1.0...v10.1.1
|
77
|
+
[v10.1.0]: https://github.com/Burgestrand/libspotify-ruby/compare/v10.0.0...v10.1.0
|
78
|
+
[v10.0.0]: https://github.com/Burgestrand/libspotify-ruby/compare/v9.1.0...v10.0.0
|
79
|
+
[v9.1.0]: https://github.com/Burgestrand/libspotify-ruby/compare/v9.0.1...v9.1.0
|
57
80
|
[v9.0.1]: https://github.com/Burgestrand/libspotify-ruby/compare/v9.0.0...v9.0.1
|
58
81
|
[v9.0.0]: https://github.com/Burgestrand/libspotify-ruby/compare/v8.0.5...v9.0.0
|
59
82
|
[v8.0.5]: https://github.com/Burgestrand/libspotify-ruby/compare/v8.0.2...v8.0.5
|
data/README.markdown
CHANGED
@@ -6,12 +6,19 @@ Ruby FFI bindings for [libspotify][]
|
|
6
6
|
|
7
7
|
[Spotify][] is a really nice music streaming service, and being able to interact with it in an API is awesome. However, because libspotify is a C library, writing applications with it is cumbersome and error-prone compared to doing it in Ruby. As I found myself needing to do this one day, knowing I’d rather not be writing it in C, this gem was born.
|
8
8
|
|
9
|
-
Spotify, the gem, is a thin layer of Ruby atop the [libspotify][] C library. It allows developers to use libspotify without writing a line of C, thanks to [Ruby FFI](https://rubygems.org/gems/ffi). Do note that there is no sugar-coating, and no attempts of abstraction will be made.
|
9
|
+
Spotify, the gem, is a thin layer of Ruby atop the [libspotify][] C library. It allows developers to use libspotify without writing a line of C, thanks to [Ruby FFI](https://rubygems.org/gems/ffi). Do note that there is no sugar-coating, and no attempts of abstraction will be made.
|
10
|
+
|
11
|
+
You want easy-to-use Ruby bindings for libspotify?
|
12
|
+
--------------------------------------------------
|
13
|
+
Then you should check out [Hallon][]! While libspotify-ruby is just the simplest bindings to libspotify possible, Hallon works really hard to make libspotify a joy to use in Ruby.
|
14
|
+
|
15
|
+
Finally, if you, for some reason, are having trouble deciding if you should use libspotify-ruby or Hallon, you should probably use Hallon.
|
10
16
|
|
11
17
|
(anecdotal note: this code base was previously a part of Hallon, but I decided to extract it and make a gem out of it)
|
12
18
|
|
13
19
|
[libspotify]: http://developer.spotify.com/en/libspotify/overview/
|
14
20
|
[Spotify]: https://www.spotify.com/
|
21
|
+
[Hallon]: https://github.com/Burgestrand/Hallon
|
15
22
|
|
16
23
|
Need help installing libspotify?
|
17
24
|
--------------------------------
|
@@ -29,4 +36,4 @@ When X increases (support for new libspotify versions) there are **no guarantees
|
|
29
36
|
|
30
37
|
License
|
31
38
|
-------
|
32
|
-
X11 license, see the LICENSE document for details.
|
39
|
+
X11 license, see the LICENSE document for details.
|
data/lib/spotify.rb
CHANGED
@@ -12,6 +12,18 @@ module Spotify
|
|
12
12
|
extend FFI::Library
|
13
13
|
ffi_lib ['libspotify', '/Library/Frameworks/libspotify.framework/libspotify']
|
14
14
|
|
15
|
+
# Override FFI::Library#attach_function to always add the `:blocking` option.
|
16
|
+
#
|
17
|
+
# The reason for this is that which libspotify functions may call callbacks
|
18
|
+
# is unspecified. And really… I don’t know of any drawbacks with this method.
|
19
|
+
def self.attach_function(*arguments, &block)
|
20
|
+
options = arguments.pop if arguments.last.is_a?(Hash)
|
21
|
+
options ||= {}
|
22
|
+
options = { blocking: true }.merge(options)
|
23
|
+
arguments << options
|
24
|
+
super(*arguments, &block)
|
25
|
+
end
|
26
|
+
|
15
27
|
# libspotify API version
|
16
28
|
# @return [Fixnum]
|
17
29
|
API_VERSION = VERSION.split('.').first.to_i
|
@@ -210,11 +222,11 @@ module Spotify
|
|
210
222
|
:allow_sync_over_mobile, 0x4,
|
211
223
|
:allow_sync_over_wifi , 0x8]
|
212
224
|
|
213
|
-
attach_function :session_create, :sp_session_create, [ SessionConfig, :buffer_out ], :error
|
225
|
+
attach_function :session_create, :sp_session_create, [ SessionConfig, :buffer_out ], :error
|
214
226
|
attach_function :session_release, :sp_session_release, [ :session ], :void
|
215
227
|
|
216
|
-
attach_function :session_process_events, :sp_session_process_events, [ :session, :buffer_out ], :void
|
217
|
-
attach_function :session_login, :sp_session_login, [ :session, :string, :string, :bool ], :void
|
228
|
+
attach_function :session_process_events, :sp_session_process_events, [ :session, :buffer_out ], :void
|
229
|
+
attach_function :session_login, :sp_session_login, [ :session, :string, :string, :bool ], :void
|
218
230
|
attach_function :session_relogin, :sp_session_relogin, [ :session ], :error
|
219
231
|
attach_function :session_forget_me, :sp_session_forget_me, [ :session ], :void
|
220
232
|
attach_function :session_remembered_user, :sp_session_remembered_user, [ :session, :buffer_out, :size_t ], :int
|
@@ -224,7 +236,7 @@ module Spotify
|
|
224
236
|
attach_function :session_connectionstate, :sp_session_connectionstate, [ :session ], :connectionstate
|
225
237
|
attach_function :session_userdata, :sp_session_userdata, [ :session ], :userdata
|
226
238
|
attach_function :session_set_cache_size, :sp_session_set_cache_size, [ :session, :size_t ], :void
|
227
|
-
attach_function :session_player_load, :sp_session_player_load, [ :session, :track ], :error
|
239
|
+
attach_function :session_player_load, :sp_session_player_load, [ :session, :track ], :error
|
228
240
|
attach_function :session_player_seek, :sp_session_player_seek, [ :session, :int ], :void
|
229
241
|
attach_function :session_player_play, :sp_session_player_play, [ :session, :bool ], :void
|
230
242
|
attach_function :session_player_unload, :sp_session_player_unload, [ :session ], :void
|
@@ -259,7 +271,7 @@ module Spotify
|
|
259
271
|
enum :linktype, [:invalid, :track, :album, :artist, :search,
|
260
272
|
:playlist, :profile, :starred, :localtrack, :image]
|
261
273
|
|
262
|
-
attach_function :link_create_from_string, :sp_link_create_from_string, [ :string ], :link
|
274
|
+
attach_function :link_create_from_string, :sp_link_create_from_string, [ :string ], :link
|
263
275
|
attach_function :link_create_from_track, :sp_link_create_from_track, [ :track, :int ], :link
|
264
276
|
attach_function :link_create_from_album, :sp_link_create_from_album, [ :album ], :link
|
265
277
|
attach_function :link_create_from_artist, :sp_link_create_from_artist, [ :artist ], :link
|
data/lib/spotify/version.rb
CHANGED
data/spotify.gemspec
CHANGED
@@ -5,9 +5,9 @@ Gem::Specification.new do |gem|
|
|
5
5
|
gem.name = 'spotify'
|
6
6
|
gem.summary = 'Bare-bones Ruby bindings for libspotify'
|
7
7
|
gem.description = <<-DESC
|
8
|
-
Spotify for Ruby is
|
9
|
-
|
10
|
-
|
8
|
+
Spotify for Ruby is a primitive wrapper around libspotify using Ruby FFI.
|
9
|
+
If all you want is libspotify for Ruby, you should probably use at Hallon
|
10
|
+
instead: https://rubygems.org/gems/hallon
|
11
11
|
DESC
|
12
12
|
|
13
13
|
gem.homepage = 'https://github.com/Burgestrand/libspotify-ruby'
|
@@ -24,6 +24,7 @@ Gem::Specification.new do |gem|
|
|
24
24
|
gem.platform = Gem::Platform::RUBY
|
25
25
|
|
26
26
|
gem.add_dependency 'ffi', ['~> 1.0', '>= 1.0.11']
|
27
|
+
gem.add_development_dependency 'rake'
|
27
28
|
gem.add_development_dependency 'yard'
|
28
29
|
gem.add_development_dependency 'rbgccxml'
|
29
30
|
gem.add_development_dependency 'gccxml_gem', '!= 0.9.3'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spotify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 10.1.
|
4
|
+
version: 10.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-11-
|
12
|
+
date: 2011-11-30 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
16
|
-
requirement: &
|
16
|
+
requirement: &70261854253800 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -24,10 +24,21 @@ dependencies:
|
|
24
24
|
version: 1.0.11
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
|
-
version_requirements: *
|
27
|
+
version_requirements: *70261854253800
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rake
|
30
|
+
requirement: &70261854253120 !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - ! '>='
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
36
|
+
type: :development
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: *70261854253120
|
28
39
|
- !ruby/object:Gem::Dependency
|
29
40
|
name: yard
|
30
|
-
requirement: &
|
41
|
+
requirement: &70261848428400 !ruby/object:Gem::Requirement
|
31
42
|
none: false
|
32
43
|
requirements:
|
33
44
|
- - ! '>='
|
@@ -35,10 +46,10 @@ dependencies:
|
|
35
46
|
version: '0'
|
36
47
|
type: :development
|
37
48
|
prerelease: false
|
38
|
-
version_requirements: *
|
49
|
+
version_requirements: *70261848428400
|
39
50
|
- !ruby/object:Gem::Dependency
|
40
51
|
name: rbgccxml
|
41
|
-
requirement: &
|
52
|
+
requirement: &70261848427980 !ruby/object:Gem::Requirement
|
42
53
|
none: false
|
43
54
|
requirements:
|
44
55
|
- - ! '>='
|
@@ -46,10 +57,10 @@ dependencies:
|
|
46
57
|
version: '0'
|
47
58
|
type: :development
|
48
59
|
prerelease: false
|
49
|
-
version_requirements: *
|
60
|
+
version_requirements: *70261848427980
|
50
61
|
- !ruby/object:Gem::Dependency
|
51
62
|
name: gccxml_gem
|
52
|
-
requirement: &
|
63
|
+
requirement: &70261848427480 !ruby/object:Gem::Requirement
|
53
64
|
none: false
|
54
65
|
requirements:
|
55
66
|
- - ! '!='
|
@@ -57,10 +68,10 @@ dependencies:
|
|
57
68
|
version: 0.9.3
|
58
69
|
type: :development
|
59
70
|
prerelease: false
|
60
|
-
version_requirements: *
|
71
|
+
version_requirements: *70261848427480
|
61
72
|
- !ruby/object:Gem::Dependency
|
62
73
|
name: minitest
|
63
|
-
requirement: &
|
74
|
+
requirement: &70261848426980 !ruby/object:Gem::Requirement
|
64
75
|
none: false
|
65
76
|
requirements:
|
66
77
|
- - ~>
|
@@ -68,10 +79,10 @@ dependencies:
|
|
68
79
|
version: '2.0'
|
69
80
|
type: :development
|
70
81
|
prerelease: false
|
71
|
-
version_requirements: *
|
82
|
+
version_requirements: *70261848426980
|
72
83
|
- !ruby/object:Gem::Dependency
|
73
84
|
name: bundler
|
74
|
-
requirement: &
|
85
|
+
requirement: &70261848426520 !ruby/object:Gem::Requirement
|
75
86
|
none: false
|
76
87
|
requirements:
|
77
88
|
- - ~>
|
@@ -79,10 +90,10 @@ dependencies:
|
|
79
90
|
version: '1.0'
|
80
91
|
type: :development
|
81
92
|
prerelease: false
|
82
|
-
version_requirements: *
|
83
|
-
description: ! " Spotify for Ruby is
|
84
|
-
|
85
|
-
|
93
|
+
version_requirements: *70261848426520
|
94
|
+
description: ! " Spotify for Ruby is a primitive wrapper around libspotify using
|
95
|
+
Ruby FFI.\n If all you want is libspotify for Ruby, you should probably use at
|
96
|
+
Hallon\n instead: https://rubygems.org/gems/hallon\n"
|
86
97
|
email:
|
87
98
|
- kim@burgestrand.se
|
88
99
|
executables: []
|
@@ -122,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
133
|
version: '0'
|
123
134
|
requirements: []
|
124
135
|
rubyforge_project:
|
125
|
-
rubygems_version: 1.8.
|
136
|
+
rubygems_version: 1.8.10
|
126
137
|
signing_key:
|
127
138
|
specification_version: 3
|
128
139
|
summary: Bare-bones Ruby bindings for libspotify
|