spotify 12.0.1 → 12.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@ __v12.1.0__
2
2
  -----------
3
3
  - erroneously released (wrong version number, does not follow version policy)
4
4
 
5
+ [v12.0.2][]
6
+ -----------
7
+ - use error checking in Spotify::Pointer add_ref and release
8
+
5
9
  [v12.0.1][]
6
10
  -----------
7
11
  - add Spotify::Pointer, a FFI::Pointer that manages spotify pointer refcount!
@@ -118,6 +122,7 @@ v0.0.0
118
122
  ------
119
123
  - release to register rubygems.org name
120
124
 
125
+ [v12.0.2]: https://github.com/Burgestrand/libspotify-ruby/compare/v12.0.1...v12.0.2
121
126
  [v12.0.1]: https://github.com/Burgestrand/libspotify-ruby/compare/v12.0.0...v12.0.1
122
127
  [v12.0.0]: https://github.com/Burgestrand/libspotify-ruby/compare/v11.0.2...v12.0.0
123
128
  [v11.0.2]: https://github.com/Burgestrand/libspotify-ruby/compare/v11.0.1...v11.0.2
data/README.markdown CHANGED
@@ -22,7 +22,7 @@ Finally, if you, for some reason, are having trouble deciding if you should use
22
22
 
23
23
  Need help installing libspotify?
24
24
  --------------------------------
25
- You’re in luck! I’ve got you covered in the wiki, just [visit its main page](https://github.com/Burgestrand/libspotify-ruby/wiki)!
25
+ You’re in luck! I’ve got you covered in Hallon’s wiki: [How to install libspotify](https://github.com/Burgestrand/Hallon/wiki/How-to-install-libspotify)!
26
26
 
27
27
  A note about versioning scheme
28
28
  ------------------------------
@@ -16,13 +16,13 @@ module Spotify
16
16
  # @param [Symbol] type
17
17
  # @return [Proc]
18
18
  def releaser_for(type)
19
- unless Spotify.respond_to?(:"#{type}_release")
19
+ unless Spotify.respond_to?(:"#{type}_release!")
20
20
  raise InvalidTypeError, "#{type} is not a valid Spotify type"
21
21
  end
22
22
 
23
23
  lambda do |pointer|
24
- $stdout.puts "Spotify::#{type}_release(#{pointer})" if $DEBUG
25
- Spotify.send(:"#{type}_release", pointer) unless pointer.null?
24
+ $stdout.puts "Spotify::#{type}_release!(#{pointer})" if $DEBUG
25
+ Spotify.send(:"#{type}_release!", pointer) unless pointer.null?
26
26
  end
27
27
  end
28
28
 
@@ -49,7 +49,7 @@ module Spotify
49
49
  super pointer, self.class.releaser_for(@type = type.to_s)
50
50
 
51
51
  unless pointer.null?
52
- Spotify.send(:"#{type}_add_ref", pointer)
52
+ Spotify.send(:"#{type}_add_ref!", pointer)
53
53
  end if add_ref
54
54
  end
55
55
 
@@ -1,4 +1,4 @@
1
1
  module Spotify
2
2
  # See README for versioning policy.
3
- VERSION = [12, 0, 1].join('.')
3
+ VERSION = [12, 0, 2].join('.')
4
4
  end
data/spec/spotify_spec.rb CHANGED
@@ -49,14 +49,14 @@ end
49
49
 
50
50
  # Used for checking Spotify::Pointer things.
51
51
  module Spotify
52
- def bogus_add_ref(pointer)
52
+ def bogus_add_ref!(pointer)
53
53
  end
54
54
 
55
- def bogus_release(pointer)
55
+ def bogus_release!(pointer)
56
56
  end
57
57
 
58
58
  # This may be called after our GC test. Randomly.
59
- def garbage_release(pointer)
59
+ def garbage_release!(pointer)
60
60
  end
61
61
  end
62
62
 
@@ -164,7 +164,7 @@ describe Spotify do
164
164
  ref_added = false
165
165
 
166
166
  Spotify.stub(:session_user, FFI::Pointer.new(1)) do
167
- Spotify.stub(:user_add_ref, proc { ref_added = true }) do
167
+ Spotify.stub(:user_add_ref, proc { ref_added = true; :ok }) do
168
168
  Spotify.session_user!(session)
169
169
  end
170
170
  end
@@ -208,7 +208,7 @@ describe Spotify do
208
208
  it "adds a reference on the given pointer" do
209
209
  ref_added = false
210
210
 
211
- Spotify.stub(:bogus_add_ref, proc { ref_added = true }) do
211
+ Spotify.stub(:bogus_add_ref!, proc { ref_added = true; :ok }) do
212
212
  Spotify::Pointer.new(FFI::Pointer.new(1), :bogus, true)
213
213
  end
214
214
 
@@ -218,7 +218,7 @@ describe Spotify do
218
218
  it "does not add a reference on the given pointer if it is NULL" do
219
219
  ref_added = false
220
220
 
221
- Spotify.stub(:bogus_add_ref, proc { ref_added = true }) do
221
+ Spotify.stub(:bogus_add_ref!, proc { ref_added = true; :ok }) do
222
222
  Spotify::Pointer.new(FFI::Pointer::NULL, :bogus, true)
223
223
  end
224
224
 
@@ -247,7 +247,7 @@ describe Spotify do
247
247
  it "should work" do
248
248
  gc_count = 0
249
249
 
250
- Spotify.stub(:garbage_release, proc { gc_count += 1 }) do
250
+ Spotify.stub(:garbage_release!, proc { gc_count += 1 }) do
251
251
  5.times { Spotify::Pointer.new(my_pointer, :garbage, false) }
252
252
  5.times { GC.start; sleep 0.01 }
253
253
  end
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: 12.0.1
4
+ version: 12.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-06 00:00:00.000000000 Z
12
+ date: 2012-06-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -140,7 +140,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  segments:
142
142
  - 0
143
- hash: 876530711000755866
143
+ hash: -3119347920568123085
144
144
  required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  none: false
146
146
  requirements:
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  version: '0'
150
150
  segments:
151
151
  - 0
152
- hash: 876530711000755866
152
+ hash: -3119347920568123085
153
153
  requirements: []
154
154
  rubyforge_project:
155
155
  rubygems_version: 1.8.24