Hash :
141cc085
Author :
Date :
2018-07-31T17:31:06
Rename MPDClient to MPD::Client (#6) * Rename MPDClient to MPD::Client * remove redundants return * Avoid single-line method definitions * nothing special * update readme * add idle example * add rubocop * add .hound.yml * add travis config * add badges to readme * remove rakefile * add rake * revert rakefile * ichange gemspec * add rspec * change travis config * remove rakefile * remove rack-test * add spec * add test * fix rubocop * update badges
# frozen_string_literal: true
require 'bundler'
Bundler.setup :default
require 'pp'
require 'logger'
require 'mpd_client'
MPD::Client.log = Logger.new($stderr)
client = MPD::Client.new
client.connect('localhost', 6600)
# delete all songs from the current playlist, except for the firts ten
client.delete([10])
# move the first three songs after the fifth number in the playlist
client.move([0, 3], 5)
# print songs form 5 to 10
client.playlistinfo([5, 10]).each { |s| puts "#{s['artist']} - #{s['title']}" }