mpc 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mpc.rb +2 -2
- data/test/mpc_test.rb +7 -1
- metadata +4 -4
data/lib/mpc.rb
CHANGED
@@ -117,7 +117,7 @@ class Mpc
|
|
117
117
|
end
|
118
118
|
|
119
119
|
def current_song
|
120
|
-
parse_song_list(puts("currentsong"))
|
120
|
+
parse_song_list(puts("currentsong")).first
|
121
121
|
end
|
122
122
|
|
123
123
|
def stats
|
@@ -125,7 +125,7 @@ class Mpc
|
|
125
125
|
end
|
126
126
|
|
127
127
|
def ping
|
128
|
-
song = current_song
|
128
|
+
song = current_song
|
129
129
|
unless status[:state] == "stop"
|
130
130
|
output = {:song_time=>song[:time],:time=>status[:time].split(":").first,:artist=>song[:artist],:title=>song[:title],:file=>song[:file],:album=>song[:album],:id=>song[:id]}
|
131
131
|
else
|
data/test/mpc_test.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
require "
|
1
|
+
require File.join(File.dirname(__FILE__),"..","lib","mpc")
|
2
|
+
require "test/unit"
|
2
3
|
class MpcTest < Test::Unit::TestCase
|
3
4
|
|
4
5
|
def setup
|
@@ -121,4 +122,9 @@ class MpcTest < Test::Unit::TestCase
|
|
121
122
|
|
122
123
|
assert_equal(@root.to_s,@mpc.list_library.to_s)
|
123
124
|
end
|
125
|
+
|
126
|
+
test "move_song should send move command" do
|
127
|
+
@mpc.expects(:puts).with("move 1 3")
|
128
|
+
@mpc.move(1,3)
|
129
|
+
end
|
124
130
|
end
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mpc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: "0.
|
8
|
+
- 3
|
9
|
+
version: "0.3"
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "Micha\xC5\x82 Krzy\xC5\xBCanowski"
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-08-
|
17
|
+
date: 2010-08-10 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|