spfy 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +9 -8
- data/lib/spfy.rb +2 -2
- data/lib/spfy/optionreader.rb +21 -0
- data/spfy.gemspec +2 -2
- metadata +1 -1
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#Spfy ("spiffy")
|
2
2
|
|
3
3
|
##Overview
|
4
|
-
**Spfy** is a command-line
|
4
|
+
**Spfy** is a command-line tool for generating XSPF playlists from metadata stored in several popular audio formats, developed entirely in [Ruby](http://www.ruby-lang.org/).
|
5
5
|
|
6
6
|
##Installation
|
7
7
|
[TagLib](http://developer.kde.org/~wheeler/taglib.html) is required for spfy to work. Follow the steps below (taken from the [taglib-ruby installation guide](http://robinst.github.com/taglib-ruby/)) to install the necessary files for your respective system type:
|
@@ -12,17 +12,15 @@
|
|
12
12
|
> | Fedora/RHEL | `sudo yum install taglib-devel` |
|
13
13
|
> | Brew | `brew install taglib` |
|
14
14
|
> | MacPorts | `sudo port install taglib` |
|
15
|
-
>
|
16
|
-
> Windows users on Ruby 1.9 don't need that, because there is a pre-compiled binary gem available which bundles taglib.
|
17
15
|
|
18
|
-
With the prerequisites
|
16
|
+
With the prerequisites taken care of spfy can be installed with the following command:
|
19
17
|
|
20
18
|
gem install spfy
|
21
19
|
|
22
20
|
##Using spfy
|
23
|
-
By default, spfy will output a formatted [XSPF](http://xspf.org/) playlist to the standard output stream that will include _title_, _artist_, and _album_
|
21
|
+
By default, spfy will output a formatted [XSPF](http://xspf.org/) playlist to the standard output stream that will include _location_, _title_, _artist_, and _album_ elements for each audio file where available.
|
24
22
|
|
25
|
-
The general syntax for
|
23
|
+
The general syntax for spfy is `spfy [options] dir1 ... dirN`, where _dir1 ... dirN_ is one or more paths to directories containing audio files.
|
26
24
|
|
27
25
|
For example:
|
28
26
|
|
@@ -34,6 +32,7 @@ For example:
|
|
34
32
|
<playlist version="1" xmlns="http://xspf.org/ns/0/">
|
35
33
|
<trackList>
|
36
34
|
<track>
|
35
|
+
<location>file:///Users/spfy/music/03%20A%20Stitch%20In%20Time.mp3</location>
|
37
36
|
<title>A Stitch In Time</title>
|
38
37
|
<creator>The Smashing Pumpkins</creator>
|
39
38
|
<album>Teargarden by Kaleidyscope</album>
|
@@ -41,9 +40,11 @@ For example:
|
|
41
40
|
</trackList>
|
42
41
|
</playlist>
|
43
42
|
|
44
|
-
|
43
|
+
Spfy supports multiple directory paths (e.g. `spfy /dir1 /dir2`) and traverses each directory recursively by default. Unsupported files and empty directories in a directory tree are silently ignored and will not impact spfy's output.
|
45
44
|
|
46
|
-
|
45
|
+
Command-line arguments allow you to control which elements spfy outputs:
|
46
|
+
|
47
|
+
-f, --no-location Suppress file location output
|
47
48
|
-t, --no-title Suppress track title in output
|
48
49
|
-a, --no-artist Suppress artist name in output
|
49
50
|
-l, --no-album Suppress album name in output
|
data/lib/spfy.rb
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
# GNU General Public License for more details.
|
18
18
|
#
|
19
19
|
# You should have received a copy of the GNU General Public License
|
20
|
-
# along with Spfy. If not, see <http
|
20
|
+
# along with Spfy. If not, see <http://www.gnu.org/licenses/>.
|
21
21
|
|
22
22
|
require "spfy/optionreader"
|
23
23
|
require "optparse"
|
@@ -26,7 +26,7 @@ require "taglib"
|
|
26
26
|
require 'find'
|
27
27
|
require 'uri'
|
28
28
|
|
29
|
-
$version = "0.1.
|
29
|
+
$version = "0.1.5"
|
30
30
|
$dirs = []
|
31
31
|
|
32
32
|
# The main Spfy class
|
data/lib/spfy/optionreader.rb
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
#
|
2
|
+
# optionreader.rb
|
3
|
+
# Spfy ("spiffy")
|
4
|
+
#
|
5
|
+
# Copyright (c) 2012, Marc Ransome <marc.ransome@fidgetbox.co.uk>
|
6
|
+
#
|
7
|
+
# This file is part of Spfy.
|
8
|
+
#
|
9
|
+
# Spfy is free software: you can redistribute it and/or modify
|
10
|
+
# it under the terms of the GNU General Public License as published by
|
11
|
+
# the Free Software Foundation, either version 3 of the License, or
|
12
|
+
# (at your option) any later version.
|
13
|
+
#
|
14
|
+
# Spfy is distributed in the hope that it will be useful,
|
15
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
# GNU General Public License for more details.
|
18
|
+
#
|
19
|
+
# You should have received a copy of the GNU General Public License
|
20
|
+
# along with Spfy. If not, see <http://www.gnu.org/licenses/>.
|
21
|
+
|
1
22
|
class OptionReader
|
2
23
|
|
3
24
|
def self.parse(args)
|
data/spfy.gemspec
CHANGED
@@ -17,11 +17,11 @@
|
|
17
17
|
# GNU General Public License for more details.
|
18
18
|
#
|
19
19
|
# You should have received a copy of the GNU General Public License
|
20
|
-
# along with Spfy. If not, see <http
|
20
|
+
# along with Spfy. If not, see <http://www.gnu.org/licenses/>.
|
21
21
|
|
22
22
|
Gem::Specification.new do |s|
|
23
23
|
s.name = 'spfy'
|
24
|
-
s.version = '0.1.
|
24
|
+
s.version = '0.1.5'
|
25
25
|
s.date = '2012-05-06'
|
26
26
|
s.summary = 'XSPF playlist generator'
|
27
27
|
s.description = 'Spfy is a simple command-line tool for generating XSPF playlists from metadata stored in several popular audio formats.'
|