spotify 12.5.0 → 12.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf64e70f3fd55a846fc2a016a2948cf547e92f54
4
- data.tar.gz: 1012f48eb4fcb112b5866d63defe433a0974e2bb
3
+ metadata.gz: 20694ef78fc1b426595ffabf8d655da1875060fc
4
+ data.tar.gz: 5b99e59242913e03a3a3c1ef5e8e8f3835fbd4a0
5
5
  SHA512:
6
- metadata.gz: c6b782905e37db551e1291e1769508d5f0fa0d6f1c6932700b9c0bace51433228e558ea607d99937a6e2f5b26c2a0066e93e069c74a7b2878cd5f315f6c5d376
7
- data.tar.gz: b402e97d8772d953ae453b7b1d61a3cd73ad9346f970b739adb23d97cc3740a0677c4c1c14845af482ace77434adef085333bb9b491ba70ee53e3dcb5a29d9f3
6
+ metadata.gz: 042287392a9ad3ea971eb9110b8654e4e757077d6da762c5f43953632f5e99bee6a26e9f4622a73cbe97cd703df3b1e1f03cb6bd805040cc566ad7b252e796f2
7
+ data.tar.gz: 1bfc03fd117914dc937e3a5cb247f914287250032630aa763051db5acde55ddb0f2760720ed86ea246023567c8f57d4bb7187969106e29ba68699ba4b3ece2cb
@@ -1,6 +1,11 @@
1
1
  [HEAD][]
2
2
  -----------
3
3
 
4
+ [v12.5.1][]
5
+ -----------
6
+
7
+ - [b775947d6] Fix retaining class bug on Ruby 1.9.2
8
+
4
9
  [v12.5.0][]
5
10
  -----------
6
11
  This release *also* breaks backwards-compatibilty, now all functions
@@ -185,8 +190,9 @@ v0.0.0
185
190
  ------
186
191
  - release to register rubygems.org name
187
192
 
188
- [HEAD]: https://github.com/Burgestrand/spotify/compare/v12.5.0...HEAD
193
+ [HEAD]: https://github.com/Burgestrand/spotify/compare/v12.5.1...HEAD
189
194
 
195
+ [v12.5.1]: https://github.com/Burgestrand/spotify/compare/v12.5.0...v12.5.1
190
196
  [v12.5.0]: https://github.com/Burgestrand/spotify/compare/v12.4.0...v12.5.0
191
197
  [v12.4.0]: https://github.com/Burgestrand/spotify/compare/v12.3.0...v12.4.0
192
198
  [v12.3.0]: https://github.com/Burgestrand/spotify/compare/v12.2.0...v12.3.0
@@ -90,8 +90,9 @@ module Spotify
90
90
  end
91
91
  end
92
92
 
93
- def initialize(*)
94
- super
93
+ alias_method :super_initialize, :initialize
94
+ def initialize(*args, &block)
95
+ super_initialize(*args, &block)
95
96
  self.class.retain(self)
96
97
  end
97
98
  end
@@ -1,7 +1,7 @@
1
1
  module Spotify
2
2
  # @note See README for versioning policy.
3
3
  # @return [String] Spotify gem version.
4
- VERSION = '12.5.0'
4
+ VERSION = '12.5.1'
5
5
 
6
6
  # @return [String] Compatible libspotify API version.
7
7
  API_VERSION = '12.1.51'
@@ -3,68 +3,61 @@ describe Spotify::ManagedPointer do
3
3
  let(:klass) { described_class }
4
4
  let(:null) { FFI::Pointer::NULL }
5
5
  let(:pointer) { FFI::Pointer.new(1) }
6
- let(:subject) do
7
- Class.new(Spotify::ManagedPointer) do
8
- def initialize(*)
9
- super
10
- self.autorelease = false
11
- end
12
-
13
- def self.name
14
- "Anonymous"
15
- end
16
- end
17
- end
6
+ let(:klass) { Spotify::User }
7
+ let(:retaining_klass) { klass.retaining_class }
18
8
 
19
9
  it "adds a ref if it is a retaining class" do
20
- api.should_receive(:anonymous_add_ref)
21
- subject.retaining_class.new(FFI::Pointer.new(1))
10
+ api.should_receive(:user_add_ref)
11
+ ptr = retaining_klass.new(FFI::Pointer.new(1))
12
+ ptr.autorelease = false
22
13
  end
23
14
 
24
15
  it "does not add or release when the pointer is null" do
25
- api.should_not_receive(:anonymous_add_ref)
26
- api.should_not_receive(:anonymous_release)
16
+ api.should_not_receive(:user_add_ref)
17
+ api.should_not_receive(:user_release)
27
18
 
28
- ptr = subject.retaining_class.new(FFI::Pointer::NULL)
19
+ ptr = retaining_klass.new(FFI::Pointer::NULL)
20
+ ptr.autorelease = false
29
21
  ptr.free
30
22
  end
31
23
 
32
24
  describe "#release" do
33
25
  it "wraps the release pointer properly to avoid type-failures" do
34
- api.should_receive(:anonymous_release).and_return do |pointer|
35
- pointer.should be_instance_of(subject)
26
+ api.should_receive(:user_release).and_return do |pointer|
27
+ pointer.should be_instance_of(klass)
36
28
  pointer.should_not be_autorelease # autorelease should be off
37
29
  end
38
30
 
39
- ptr = subject.new(FFI::Pointer.new(1))
31
+ ptr = klass.new(FFI::Pointer.new(1))
32
+ ptr.autorelease = false
40
33
  ptr.free
41
34
  end
42
35
  end
43
36
 
44
37
  describe ".to_native" do
45
38
  it "does not accept null pointers" do
46
- expect { subject.to_native(nil, nil) }.to raise_error(TypeError, /cannot be null/)
47
- expect { subject.to_native(Spotify::Session.new(null), nil) }.to raise_error(TypeError, /cannot be null/)
39
+ expect { klass.to_native(nil, nil) }.to raise_error(TypeError, /cannot be null/)
40
+ expect { klass.to_native(Spotify::Session.new(null), nil) }.to raise_error(TypeError, /cannot be null/)
48
41
  end
49
42
 
50
43
  it "does not accept pointers of another type" do
51
- expect { subject.to_native(pointer, nil) }.to raise_error(TypeError, /expected a kind of Anonymous/)
52
- expect { subject.to_native(Spotify::Session.new(pointer), nil) }.to raise_error(TypeError, /expected a kind of Anonymous/)
44
+ expect { klass.to_native(pointer, nil) }.to raise_error(TypeError, /expected a kind of Spotify::User/)
45
+ expect { klass.to_native(Spotify::Session.new(pointer), nil) }.to raise_error(TypeError, /expected a kind of Spotify::User/)
53
46
  end
54
47
 
55
48
  it "accepts pointers of the same kind, or a subkind" do
56
- api.stub(:anonymous_add_ref)
49
+ api.stub(:user_add_ref)
57
50
 
58
- retaining = subject.retaining_class.new(pointer)
51
+ retaining = retaining_klass.new(pointer)
59
52
  retaining.autorelease = false
60
53
 
61
- regular = subject.new(pointer)
54
+ regular = klass.new(pointer)
62
55
  regular.autorelease = false
63
56
 
64
- expect { subject.to_native(retaining, nil) }.to_not raise_error
65
- expect { subject.to_native(regular, nil) }.to_not raise_error
66
- expect { subject.retaining_class.to_native(retaining, nil) }.to_not raise_error
67
- expect { subject.retaining_class.to_native(regular, nil) }.to_not raise_error
57
+ expect { klass.to_native(retaining, nil) }.to_not raise_error
58
+ expect { klass.to_native(regular, nil) }.to_not raise_error
59
+ expect { retaining_klass.to_native(retaining, nil) }.to_not raise_error
60
+ expect { retaining_klass.to_native(regular, nil) }.to_not raise_error
68
61
  end
69
62
  end
70
63
 
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.5.0
4
+ version: 12.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kim Burgestrand