kagu 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: b5e575043dff2dec033f7489c3597d55c299fd42
4
- data.tar.gz: 35401e87c1ffb91bc1ae6b74e31d97757f76cf4f
3
+ metadata.gz: 1eb0f771713959afb4cdf8b85f3fb336f8ac3d92
4
+ data.tar.gz: 0939af7e4a7f6878304c7c9f808012ba88bfddec
5
5
  SHA512:
6
- metadata.gz: 2a35eddae3a6f9716a9e9deb4f56554573da0b1ef945d53387d7dffc6d26383acd41cbcce2a4636a25647d313d79f891f44e9d2e17d217004e30331804f748b5
7
- data.tar.gz: ff9d99d3298110c66afeaf4e6e4115414edf8410a8dbef6790523800c28c5f9356a31174f224961ebc1900042f65dbdee0b0d062b8520a0d4da9377c4d8adb83
6
+ metadata.gz: 0d34928759a2cc7780fae36765ed6b09242108ff7e903f25756f6e6e0030b4608d75c9802763704c0064b4439ad5b7bfe8f94401bd70f3fa90614525555b9a68
7
+ data.tar.gz: bf0fa5600d8b5aa998d77ce3247fa686a55bbdd2af78b37ba9580c7d518e9bcc6998ff3c792c8ab2e0d08c10818e15c70fef664311bceea9b3a134b2d216b87c
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
data/lib/kagu/library.rb CHANGED
@@ -11,11 +11,11 @@ module Kagu
11
11
  end
12
12
 
13
13
  def playlists
14
- Playlists.new(self)
14
+ @playlists ||= Playlists.new(self)
15
15
  end
16
16
 
17
17
  def tracks
18
- Tracks.new(self)
18
+ @tracks ||= Tracks.new(self)
19
19
  end
20
20
 
21
21
  private
data/lib/kagu/playlist.rb CHANGED
@@ -34,7 +34,7 @@ module Kagu
34
34
  end repeat
35
35
  end tell
36
36
  })
37
- nil
37
+ true
38
38
  rescue => e
39
39
  raise Error.new(e)
40
40
  end
@@ -45,7 +45,7 @@ module Kagu
45
45
  delete tracks of playlist #{name.inspect}
46
46
  end tell
47
47
  })
48
- nil
48
+ true
49
49
  rescue => e
50
50
  raise Error.new(e)
51
51
  end
@@ -58,7 +58,7 @@ module Kagu
58
58
  end if
59
59
  end tell
60
60
  })
61
- nil
61
+ true
62
62
  rescue => e
63
63
  raise Error.new(e)
64
64
  end
@@ -11,8 +11,12 @@ module Kagu
11
11
  @library = library
12
12
  end
13
13
 
14
+ def build(attributes = {})
15
+ Playlist.new(attributes)
16
+ end
17
+
14
18
  def create(attributes = {})
15
- Playlist.new(attributes).save
19
+ build(attributes).tap(&:save)
16
20
  end
17
21
 
18
22
  def each(&block)
@@ -31,6 +31,10 @@ describe Kagu::Library do
31
31
  expect(library.playlists.library).to be(library)
32
32
  end
33
33
 
34
+ it 'always return same object' do
35
+ expect(library.playlists.object_id).to be(library.playlists.object_id)
36
+ end
37
+
34
38
  end
35
39
 
36
40
  describe '#tracks' do
@@ -40,6 +44,10 @@ describe Kagu::Library do
40
44
  expect(library.tracks.library).to be(library)
41
45
  end
42
46
 
47
+ it 'always return same object' do
48
+ expect(library.tracks.object_id).to be(library.tracks.object_id)
49
+ end
50
+
43
51
  end
44
52
 
45
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kagu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Toulotte