mpc 0.6 → 0.7
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 +9 -9
- metadata +3 -3
data/lib/mpc.rb
CHANGED
@@ -126,7 +126,7 @@ class Mpc
|
|
126
126
|
|
127
127
|
def ping
|
128
128
|
unless status[:state] == "stop"
|
129
|
-
output = {:song_time=>current_song[:
|
129
|
+
output = {:song_time=>current_song[:time],:time=>status[:time].split(":").first,:artist=>current_song[:artist],:title=>current_song[:title],:file=>current_song[:file],:album=>current_song[:album],:id=>current_song[:id]}
|
130
130
|
else
|
131
131
|
output = {:song_time=>0,:time=>0,:artist=>nil,:title=>nil,:file=>nil,:album=>nil,:id=>nil}
|
132
132
|
end
|
@@ -237,7 +237,7 @@ class Mpc
|
|
237
237
|
status_hash = Hash.new
|
238
238
|
string.each do |line|
|
239
239
|
key, value = line.chomp.split(": ", 2)
|
240
|
-
status_hash[key.to_sym] = value
|
240
|
+
status_hash[key.downcase.to_sym] = value
|
241
241
|
end
|
242
242
|
status_hash
|
243
243
|
end
|
data/test/mpc_test.rb
CHANGED
@@ -149,16 +149,16 @@ class MpcTest < Test::Unit::TestCase
|
|
149
149
|
|
150
150
|
test "ping method should return hash with informations about song" do
|
151
151
|
@mpc.stubs(:current_song).returns({
|
152
|
-
:
|
153
|
-
:
|
154
|
-
:
|
152
|
+
:date=> "2001",
|
153
|
+
:id=> "23",
|
154
|
+
:title=> "ToNieMy",
|
155
155
|
:file=> "Paktofonika - Kinematografia/ToNieMy.mp3",
|
156
|
-
:
|
157
|
-
:
|
158
|
-
:
|
159
|
-
:
|
160
|
-
:
|
161
|
-
:
|
156
|
+
:time=> "227",
|
157
|
+
:album=> "Kinematografia",
|
158
|
+
:track=> "6",
|
159
|
+
:pos=> "5",
|
160
|
+
:genre=> "Hip-Hop",
|
161
|
+
:artist=> "Paktofonika"} )
|
162
162
|
@mpc.stubs(:status).returns({
|
163
163
|
:bitrate=> "128",
|
164
164
|
:song=> "5",
|
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: 5
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: "0.
|
8
|
+
- 7
|
9
|
+
version: "0.7"
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "Micha\xC5\x82 Krzy\xC5\xBCanowski"
|