playlist_creator 0.1.0
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 +7 -0
- checksums.yaml.gz.sig +0 -0
- data/lib/playlist_creator.rb +55 -0
- data.tar.gz.sig +0 -0
- metadata +111 -0
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 21509af0edffb525f0104f0f5f31975286bc61f37ec47db9482e67e68bd0c027
|
4
|
+
data.tar.gz: b54970e4159d8e1d248c0403c6ccafa9042e9ce38ee971b6bcfaab34f94db082
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5b00999cfabd641dd15bfde5d30a6005749cda797964a4768eea13cf9609985d4c38cb6f7fda5d8ee81f44cda596d59af33283989a2f5d0d3e70b8188048f0ee
|
7
|
+
data.tar.gz: 604f2d8b70939f2a822b85e5d776be85fc372988fc4cc349cc757de2878ca3808753a08f87ab38314c8897dfe99756ef7540634c3c17d39e1806cd86a543faf0
|
checksums.yaml.gz.sig
ADDED
Binary file
|
@@ -0,0 +1,55 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# file: playlist_creator.rb
|
4
|
+
|
5
|
+
require 'dynarex'
|
6
|
+
require 'nokogiri'
|
7
|
+
|
8
|
+
|
9
|
+
XSLT_DX = <<XSLT
|
10
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
11
|
+
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
|
12
|
+
<xsl:output method='xml' indent='yes' omit-xml-declaration='no' encoding='utf-8'/>
|
13
|
+
<xsl:template match='tracklist'>
|
14
|
+
<playlist version="1" xmlns="http://xspf.org/ns/0/">
|
15
|
+
<tracklist>
|
16
|
+
<xsl:apply-templates select='summary'/>
|
17
|
+
<xsl:apply-templates select='records/track'/>
|
18
|
+
</tracklist>
|
19
|
+
</playlist>
|
20
|
+
</xsl:template>
|
21
|
+
<xsl:template match='tracklist/summary'/>
|
22
|
+
<xsl:template match='records/track'>
|
23
|
+
<track>
|
24
|
+
<title>
|
25
|
+
<xsl:value-of select='title'/>
|
26
|
+
</title>
|
27
|
+
<location>
|
28
|
+
<xsl:value-of select='location'/>
|
29
|
+
</location>
|
30
|
+
</track>
|
31
|
+
</xsl:template>
|
32
|
+
</xsl:stylesheet>
|
33
|
+
XSLT
|
34
|
+
|
35
|
+
|
36
|
+
class PlaylistCreator
|
37
|
+
|
38
|
+
def initialize(obj)
|
39
|
+
|
40
|
+
@dx = if obj.is_a? String then
|
41
|
+
header = "<?dynarex schema='tracklist/track(title, location)'?>\n--+\n"
|
42
|
+
Dynarex.new(header + obj)
|
43
|
+
elsif obj.is_a? Dynarex
|
44
|
+
obj
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
def to_xspf()
|
50
|
+
doc = Nokogiri::XML(@dx.to_xml(pretty: true))
|
51
|
+
xslt = Nokogiri::XSLT(XSLT_DX)
|
52
|
+
xslt.transform(doc).to_xml
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
data.tar.gz.sig
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: playlist_creator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- James Robertson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMjExMTI3MjIzOTQ4WhcN
|
15
|
+
MjIxMTI3MjIzOTQ4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+LPfdEvb+XMC9MJor3
|
30
|
+
+DzuOt2NrBLXTGCh/3pa7JQFh8tgiOTu94e2wdvBvwku9e6Lx3nTbfdg3cHk+vgm
|
31
|
+
T5vpI28Lxh3zf1qS6LvOII6KeMnY4U5K6AaKzg6NDqMyTDHKXIGORsPHQGUtVByb
|
32
|
+
3akhqCaKIE2AyksI24pY0fkANr4R3SLxa04S4qCJgjj3N9Xo4AId88sdB4ACttaU
|
33
|
+
y3Pb88my9BPbtnj6ka7CQpzNQWnvj0ZuOWTObfI21t4mtOEj3c3JMh4xYiAz0syV
|
34
|
+
OzrQkveNRGUdNQbxac7qx29VB4vtSBJJT3pcQFfltiKzJ/lNtwru3EGF3FM9hYIb
|
35
|
+
3gBiTtMBjF7+0wQ7XsAV0M2s+rul6mpyQTDBWbwOArnLmDWVtWcEr0G+4AAloRh2
|
36
|
+
U1ZWR/R6TfQXs+jFXG4fV8wX
|
37
|
+
-----END CERTIFICATE-----
|
38
|
+
date: 2021-11-27 00:00:00.000000000 Z
|
39
|
+
dependencies:
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: dynarex
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1.8'
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 1.8.27
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - "~>"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '1.8'
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 1.8.27
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: nokogiri
|
62
|
+
requirement: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - "~>"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '1.12'
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 1.12.5
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '1.12'
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: 1.12.5
|
80
|
+
description:
|
81
|
+
email: digital.robertson@gmail.com
|
82
|
+
executables: []
|
83
|
+
extensions: []
|
84
|
+
extra_rdoc_files: []
|
85
|
+
files:
|
86
|
+
- lib/playlist_creator.rb
|
87
|
+
homepage: https://github.com/jrobertson/playlist_creator
|
88
|
+
licenses:
|
89
|
+
- MIT
|
90
|
+
metadata: {}
|
91
|
+
post_install_message:
|
92
|
+
rdoc_options: []
|
93
|
+
require_paths:
|
94
|
+
- lib
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
requirements: []
|
106
|
+
rubyforge_project:
|
107
|
+
rubygems_version: 2.7.10
|
108
|
+
signing_key:
|
109
|
+
specification_version: 4
|
110
|
+
summary: Creates an XML Shareable Playlist Format (XSPF) file from plain text.
|
111
|
+
test_files: []
|
metadata.gz.sig
ADDED
Binary file
|