playlist 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/playlist.rb +2 -2
- data/lib/playlist/format/xspf.rb +4 -0
- data/lib/playlist/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30be0088143707327ec29c8888bd04f94ee2ff22
|
4
|
+
data.tar.gz: 1c462de277427d226a81ce130c060910ac74c525
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53b751fa9ad238e6acb13c0287e84ec4387a86d406d3a6ade773eb2bad5d1571b656328ac336a6cd5f24932ed4e609be4dd283cac437b57200293d290ebd54cc
|
7
|
+
data.tar.gz: 21563296d9604407988d425bc9002b830bee0be57c118982ffa32408fefc0e04e87de29d506be7a7e85b560cdefc4cdc66143a6969173bbc74b036ced80c841a
|
data/README.md
CHANGED
@@ -39,7 +39,7 @@ Playlists can be constructed by passing a list of attributes to the constructor
|
|
39
39
|
|
40
40
|
```ruby
|
41
41
|
playlist = Playlist.new(:title => "My awesome playlist")
|
42
|
-
playlist.
|
42
|
+
playlist.description = "Each week I add best tracks I can think of."
|
43
43
|
playlist.add_track(
|
44
44
|
:performer => "Jon Hopkins",
|
45
45
|
:title => "Everything Connected"
|
data/lib/playlist.rb
CHANGED
@@ -10,9 +10,9 @@ class Playlist
|
|
10
10
|
# @return [String]
|
11
11
|
attr_accessor :creator
|
12
12
|
|
13
|
-
# A description/synopsis of the playlist
|
13
|
+
# A description/annotation/synopsis of the playlist
|
14
14
|
# @return [String]
|
15
|
-
attr_accessor :
|
15
|
+
attr_accessor :description
|
16
16
|
|
17
17
|
# A URI (or filename) to the location of the media
|
18
18
|
# Use this if the playlist is a single file
|
data/lib/playlist/format/xspf.rb
CHANGED
@@ -14,6 +14,9 @@ module Playlist::Format::XSPF
|
|
14
14
|
Playlist.new do |playlist|
|
15
15
|
doc = Nokogiri::XML(input)
|
16
16
|
playlist.title = doc.content_at('/xmlns:playlist/xmlns:title')
|
17
|
+
playlist.description = doc.content_at(
|
18
|
+
'/xmlns:playlist/xmlns:annotation'
|
19
|
+
)
|
17
20
|
doc.xpath('/xmlns:playlist/xmlns:trackList/xmlns:track').each do |track|
|
18
21
|
playlist.tracks << parse_track(track)
|
19
22
|
end
|
@@ -27,6 +30,7 @@ module Playlist::Format::XSPF
|
|
27
30
|
builder = Nokogiri::XML::Builder.new do |xml|
|
28
31
|
xml.playlist(:version => 1, :xmlns => 'http://xspf.org/ns/0/') do
|
29
32
|
xml.title(playlist.title) unless playlist.title.nil?
|
33
|
+
xml.annotation(playlist.description) unless playlist.description.nil?
|
30
34
|
xml.trackList do
|
31
35
|
playlist.tracks.each { |track| generate_track(xml, track) }
|
32
36
|
end
|
data/lib/playlist/version.rb
CHANGED