vkpd 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +4 -0
- data/lib/vkpd/cli.rb +16 -5
- data/lib/vkpd/version.rb +1 -1
- metadata +2 -2
data/README
CHANGED
data/lib/vkpd/cli.rb
CHANGED
@@ -9,6 +9,7 @@ module Vkpd
|
|
9
9
|
do_clear = true
|
10
10
|
do_play = true
|
11
11
|
params["auto_complete"] = '1'
|
12
|
+
player = :mpd
|
12
13
|
|
13
14
|
if ARGV.empty?
|
14
15
|
ARGV.push "-h"
|
@@ -23,6 +24,8 @@ module Vkpd
|
|
23
24
|
exit 0
|
24
25
|
when '-v', '--verbose'
|
25
26
|
@verbose = true
|
27
|
+
when '-p', '--mplayer'
|
28
|
+
player = :mplayer
|
26
29
|
when '-c', '--count', /^--count=\d+$/
|
27
30
|
value = current.include?("=") ? current.match(/=(.*)/)[1] : ARGV.shift
|
28
31
|
params["count"] = value
|
@@ -69,12 +72,20 @@ module Vkpd
|
|
69
72
|
if method.match /search/
|
70
73
|
response.shift
|
71
74
|
end
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
75
|
+
case player
|
76
|
+
when :mpd
|
77
|
+
mpd.clear if do_clear
|
78
|
+
response.each do |song|
|
79
|
+
puts song if @verbose
|
80
|
+
mpd.add song["url"]
|
81
|
+
end
|
82
|
+
mpd.play if do_play
|
83
|
+
when :mplayer
|
84
|
+
response.each do |song|
|
85
|
+
puts song if @verbose
|
86
|
+
system "mplayer --cache=8192 --cache-min=2 #{song['url']}"
|
87
|
+
end
|
76
88
|
end
|
77
|
-
mpd.play if do_play
|
78
89
|
end
|
79
90
|
|
80
91
|
private
|
data/lib/vkpd/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vkpd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-09-
|
12
|
+
date: 2013-09-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|