ruby-mpd 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65799fe0826f542ebb67a82b3041bdaf8b17aacd
4
- data.tar.gz: 0416d81eaf92f7f559c9bfd969c11b5f519f9e53
3
+ metadata.gz: ea50c78be2957c3c8baa9a4f5dfb7fde0f789c16
4
+ data.tar.gz: 4f42a33ba182a33ebfeeeb1b969c03510051fb38
5
5
  SHA512:
6
- metadata.gz: a9bc49c2e0f69bdd15be62cd0676597ae0730b5e263c1f8ed6dbb7d27d9cbd2e60502c62ee981addc6b5386e32ab182845fe3173be00517ab9b721b34dde04db
7
- data.tar.gz: f75b7368594cb02b8cfa225c57e8a27e16737562e984262059bffd8cce8740a31bcf9b33866343b89f68594790b71e5945d3972a1005eaf246e6f75bcd82a0fd
6
+ metadata.gz: 394b4830f32257749942a3a01faf8b41a2ef69dd3292430883956f34ff39d4f1298c78262c1039f7a45c5dc941a0d7ffbb8ab9780af37dfedd06fb63aebb5e4d
7
+ data.tar.gz: 02c228eec5ab7e2d1ce4014c761a1e3fdeca8ae12051f4457d68e9c7d777dc4ee6abf2993f1c8b4fa9e27ff3a105426ef3a7bb76aae0fa2562abc16e1b9260c8
@@ -46,7 +46,7 @@ class MPD
46
46
 
47
47
 
48
48
  # Commands, where it makes sense to always explicitly return an array.
49
- RETURN_ARRAY = [:channels, :outputs, :readmessages, :list, :listall,
49
+ RETURN_ARRAY = [:channels, :outputs, :readmessages, :list,
50
50
  :listallinfo, :find, :search, :listplaylists, :listplaylist, :playlistfind,
51
51
  :playlistsearch, :plchanges, :tagtypes, :commands, :notcommands, :urlhandlers,
52
52
  :decoders, :listplaylistinfo, :playlistinfo]
@@ -131,14 +131,15 @@ class MPD
131
131
  #
132
132
  # @return [Array<Hash>, Array<String>, String, Integer] Parsed response.
133
133
  def parse_response(command, string)
134
- # return explicit array or true if the message is empty
135
- return RETURN_ARRAY.include?(command) ? [] : true if string.empty?
136
- if command == :listall
134
+ if command == :listall # Explicitly handle :listall (#files) -> always return a Hash
137
135
  return build_hash(string)
138
136
  elsif command == :listallinfo
139
137
  string = filter_lines(string, [:directory, :playlist])
140
138
  end
141
139
 
140
+ # return explicit array or true if the message is empty
141
+ return RETURN_ARRAY.include?(command) ? [] : true if string.empty?
142
+
142
143
  build_response(command, string)
143
144
  end
144
145
 
@@ -87,8 +87,7 @@ class MPD
87
87
  #
88
88
  # @return [Array<String>] Array of directory names
89
89
  def directories(path = nil)
90
- response = send_command(:listall, path)
91
- return response[:directory]
90
+ return files[:directory]
92
91
  end
93
92
 
94
93
  # Lists all of the albums in the database.
@@ -1,3 +1,3 @@
1
1
  class MPD
2
- VERSION = '0.2.5'
2
+ VERSION = '0.2.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-mpd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blaž Hrastnik