mpd_client 0.0.6 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.hound.yml +2 -0
- data/.rubocop.yml +27 -0
- data/.ruby-version +1 -0
- data/.travis.yml +4 -0
- data/CHANGELOG.md +11 -7
- data/Gemfile +8 -1
- data/MPD_COMMANDS.md +41 -45
- data/README.md +19 -15
- data/bin/console +4 -3
- data/examples/Gemfile +2 -0
- data/examples/idle.rb +27 -0
- data/examples/range.rb +6 -4
- data/examples/rangeid.rb +5 -3
- data/examples/search_and_replace_playlist.rb +7 -5
- data/examples/stickers.rb +10 -6
- data/lib/mpd_client.rb +394 -351
- data/lib/mpd_client/version.rb +6 -2
- data/mpd_client.gemspec +18 -11
- data/spec/mpd_client/mpd_client_spec.rb +17 -0
- data/spec/spec_helper.rb +8 -0
- metadata +30 -7
- data/Rakefile +0 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 | 
            -
             | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 2 | 
            +
            SHA256:
         | 
| 3 | 
            +
              metadata.gz: 6bbeae5055e98a65a3f47b86aaf40d85dbe4d1447dbabe1efffa70c801efb6b9
         | 
| 4 | 
            +
              data.tar.gz: ba2f70d5db12c266c6bf70d714867dcdbd51a2845b4906f79689e6d724fc1dee
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: d4d105484473b078f546e9d961289552f09336e491fed04aa8213271127fcc6f725d2973746a77731fa0f505d9bf3656338b8ca40b5f908963c7dafa2daf66c4
         | 
| 7 | 
            +
              data.tar.gz: 3d9829735ff01c8b5fc27d9c3e9d9dce06dad9504a80423bb6b938a849797ecd9443a842d0fecd37a7355d1062231df74238f7c30ee49d1fbfdc99e1d6a704df
         | 
    
        data/.hound.yml
    ADDED
    
    
    
        data/.rubocop.yml
    ADDED
    
    | @@ -0,0 +1,27 @@ | |
| 1 | 
            +
            Metrics/LineLength:
         | 
| 2 | 
            +
              Max: 120
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            Metrics/AbcSize:
         | 
| 5 | 
            +
              Enabled: false
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            Metrics/ClassLength:
         | 
| 8 | 
            +
              Enabled: false
         | 
| 9 | 
            +
             | 
| 10 | 
            +
            Metrics/MethodLength:
         | 
| 11 | 
            +
              Enabled: false
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            Metrics/ModuleLength:
         | 
| 14 | 
            +
              Enabled: false
         | 
| 15 | 
            +
             | 
| 16 | 
            +
            # TODO FIXME
         | 
| 17 | 
            +
            Metrics/CyclomaticComplexity:
         | 
| 18 | 
            +
              Max: 7
         | 
| 19 | 
            +
             | 
| 20 | 
            +
            Metrics/PerceivedComplexity:
         | 
| 21 | 
            +
              Max: 8
         | 
| 22 | 
            +
             | 
| 23 | 
            +
            Security/Eval:
         | 
| 24 | 
            +
              Exclude:
         | 
| 25 | 
            +
                - 'lib/mpd_client.rb'
         | 
| 26 | 
            +
             | 
| 27 | 
            +
             | 
    
        data/.ruby-version
    ADDED
    
    | @@ -0,0 +1 @@ | |
| 1 | 
            +
            2.5.1
         | 
    
        data/.travis.yml
    ADDED
    
    
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,33 +1,37 @@ | |
| 1 | 
            -
            #  | 
| 1 | 
            +
            # MPD::Client CHANGELOG
         | 
| 2 2 |  | 
| 3 | 
            -
             | 
| 3 | 
            +
            ## 0.1.0
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            * Rename `MPDClient` to `MPD::Client`
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            ## 0.0.6
         | 
| 4 8 |  | 
| 5 9 | 
             
            * Fixed readcomments command
         | 
| 6 10 |  | 
| 7 | 
            -
             | 
| 11 | 
            +
            ## 0.0.5
         | 
| 8 12 |  | 
| 9 13 | 
             
            * Support for mount, umount, listmounts, listneighbors
         | 
| 10 14 | 
             
            * Support for listfiles
         | 
| 11 15 | 
             
            * Support for rangeid, addtagid, cleartagid
         | 
| 12 16 |  | 
| 13 | 
            -
             | 
| 17 | 
            +
            ## 0.0.4
         | 
| 14 18 |  | 
| 15 19 | 
             
            * Added support for readcomments, toggleoutput, volume
         | 
| 16 20 | 
             
            * Added a mutex protecting execution of MPD commands
         | 
| 17 21 | 
             
            * Automatic reconnect after the server dropped the connection
         | 
| 18 22 |  | 
| 19 | 
            -
             | 
| 23 | 
            +
            ## 0.0.3
         | 
| 20 24 |  | 
| 21 25 | 
             
            * Support for logging
         | 
| 22 26 | 
             
            * Better support for fetching stickers from MPD
         | 
| 23 27 | 
             
            * Fixed sticker commands
         | 
| 24 28 | 
             
            * Add support for ranges
         | 
| 25 29 |  | 
| 26 | 
            -
             | 
| 30 | 
            +
            ## 0.0.2
         | 
| 27 31 |  | 
| 28 32 | 
             
            * Support for connecting to unix domain sockets
         | 
| 29 33 | 
             
            * Fixed some bugs
         | 
| 30 34 |  | 
| 31 | 
            -
             | 
| 35 | 
            +
            ## 0.0.1
         | 
| 32 36 |  | 
| 33 37 | 
             
            * Porting code from mpd-python2
         | 
    
        data/Gemfile
    CHANGED
    
    | @@ -1,8 +1,15 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 1 3 | 
             
            source 'https://rubygems.org'
         | 
| 2 4 |  | 
| 3 5 | 
             
            # Specify your gem's dependencies in mpd_client.gemspec
         | 
| 4 6 | 
             
            gemspec
         | 
| 5 7 |  | 
| 6 | 
            -
            group :development do
         | 
| 8 | 
            +
            group :development, :test do
         | 
| 7 9 | 
             
              gem 'pry'
         | 
| 10 | 
            +
              gem 'rubocop'
         | 
| 11 | 
            +
            end
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            group :test do
         | 
| 14 | 
            +
              gem 'rspec'
         | 
| 8 15 | 
             
            end
         | 
    
        data/MPD_COMMANDS.md
    CHANGED
    
    | @@ -1,3 +1,5 @@ | |
| 1 | 
            +
            # MPD Commands
         | 
| 2 | 
            +
             | 
| 1 3 | 
             
            * [Status Commands](#status-commands)
         | 
| 2 4 | 
             
            * [Playback Option Commands](#playback-option-commands)
         | 
| 3 5 | 
             
            * [Playback Control Commands](#playback-control-commands)
         | 
| @@ -10,7 +12,7 @@ | |
| 10 12 | 
             
            * [Reflection Commands](#reflection-commands)
         | 
| 11 13 | 
             
            * [Client to client](#client-to-client)
         | 
| 12 14 |  | 
| 13 | 
            -
             | 
| 15 | 
            +
            ## Status Commands
         | 
| 14 16 |  | 
| 15 17 | 
             
            ---
         | 
| 16 18 | 
             
            `clearerror => fetch_nothing`
         | 
| @@ -27,7 +29,7 @@ | |
| 27 29 |  | 
| 28 30 | 
             
            > Waits until there is a noteworthy change in one or more of MPD's subsystems. As soon as there is one, it lists all changed systems in a line in the format changed: `SUBSYSTEM`, where `SUBSYSTEM` is one of the following:
         | 
| 29 31 |  | 
| 30 | 
            -
             | 
| 32 | 
            +
            * `database`: the song database has been modified after update.
         | 
| 31 33 | 
             
            * `update`: a database update has started or finished. If the database was modified during the update, the database event is also emitted.
         | 
| 32 34 | 
             
            * `stored_playlist`: a stored playlist has been modified, renamed, created or deleted
         | 
| 33 35 | 
             
            * `playlist`: the current playlist has been modified
         | 
| @@ -39,21 +41,19 @@ | |
| 39 41 | 
             
            * `subscription`: a client has subscribed or unsubscribed to a channel
         | 
| 40 42 | 
             
            * `message`: a message was received on a channel this client is subscribed to; this event is only emitted when the queue is empty
         | 
| 41 43 |  | 
| 42 | 
            -
             | 
| 44 | 
            +
            While a client is waiting for `idle` results, the server disables timeouts, allowing a client to wait for events as long as mpd runs. The `idle` command can be canceled by sending the command `noidle` (no other commands are allowed). MPD will then leave `idle` mode and print results immediately; might be empty at this time.
         | 
| 43 45 |  | 
| 44 | 
            -
             | 
| 46 | 
            +
            If the optional `SUBSYSTEMS` argument is used, MPD will only send notifications when something changed in one of the specified subsytems.
         | 
| 45 47 |  | 
| 46 48 | 
             
            ---
         | 
| 47 49 | 
             
            `noidle`
         | 
| 48 50 |  | 
| 49 | 
            -
            >
         | 
| 50 | 
            -
             | 
| 51 51 | 
             
            ---
         | 
| 52 52 | 
             
            `status => "fetch_object`
         | 
| 53 53 |  | 
| 54 54 | 
             
            > Reports the current status of the player and the volume level.
         | 
| 55 55 |  | 
| 56 | 
            -
             | 
| 56 | 
            +
            * `volume`: 0-100
         | 
| 57 57 | 
             
            * `repeat`: 0 or 1
         | 
| 58 58 | 
             
            * `random`: 0 or 1
         | 
| 59 59 | 
             
            * `single`: 0 or 1
         | 
| @@ -80,14 +80,14 @@ | |
| 80 80 |  | 
| 81 81 | 
             
            > Displays statistics.
         | 
| 82 82 |  | 
| 83 | 
            -
             | 
| 83 | 
            +
            * `artists`: number of artists
         | 
| 84 84 | 
             
            * `songs`: number of albums
         | 
| 85 85 | 
             
            * `uptime`: daemon uptime in seconds
         | 
| 86 86 | 
             
            * `db_playtime`: sum of all song times in the db
         | 
| 87 87 | 
             
            * `db_update`: last db update in UNIX time
         | 
| 88 88 | 
             
            * `playtime`: time length of music played
         | 
| 89 89 |  | 
| 90 | 
            -
             | 
| 90 | 
            +
            ## Playback Option Commands
         | 
| 91 91 |  | 
| 92 92 | 
             
            ---
         | 
| 93 93 | 
             
            `consume {STATE} => fetch_nothing`
         | 
| @@ -102,7 +102,7 @@ | |
| 102 102 | 
             
            ---
         | 
| 103 103 | 
             
            `mixrampdb {deciBels} => fetch_nothing`
         | 
| 104 104 |  | 
| 105 | 
            -
            > Sets the threshold at which songs will be overlapped. Like crossfading but doesn't fade the track volume, just overlaps. The songs need to have MixRamp tags added by an external tool. 0dB is the normalized maximum volume so use negative values, I prefer -17dB. In the absence of mixramp tags crossfading will be used. See  | 
| 105 | 
            +
            > Sets the threshold at which songs will be overlapped. Like crossfading but doesn't fade the track volume, just overlaps. The songs need to have MixRamp tags added by an external tool. 0dB is the normalized maximum volume so use negative values, I prefer -17dB. In the absence of mixramp tags crossfading will be used. See [mixramp](https://sourceforge.net/projects/mixramp/)
         | 
| 106 106 |  | 
| 107 107 | 
             
            ---
         | 
| 108 108 | 
             
            `mixrampdelay {SECONDS} => fetch_nothing`
         | 
| @@ -134,9 +134,9 @@ | |
| 134 134 |  | 
| 135 135 | 
             
            > Sets the replay gain mode. One of `off`, `track`, `album`, `auto`.
         | 
| 136 136 |  | 
| 137 | 
            -
             | 
| 137 | 
            +
            Changing the mode during playback may take several seconds, because the new settings does not affect the buffered data.
         | 
| 138 138 |  | 
| 139 | 
            -
             | 
| 139 | 
            +
            This command triggers the options idle event.
         | 
| 140 140 |  | 
| 141 141 | 
             
            ---
         | 
| 142 142 | 
             
            `replay_gain_status => fetch_item`
         | 
| @@ -148,7 +148,7 @@ | |
| 148 148 |  | 
| 149 149 | 
             
            > Changes volume by amount `CHANGE`.
         | 
| 150 150 |  | 
| 151 | 
            -
             | 
| 151 | 
            +
            ## Playback Control Commands
         | 
| 152 152 |  | 
| 153 153 | 
             
            ---
         | 
| 154 154 | 
             
            `next => fetch_nothing`
         | 
| @@ -196,8 +196,7 @@ | |
| 196 196 |  | 
| 197 197 | 
             
            > Stops playing.
         | 
| 198 198 |  | 
| 199 | 
            -
             | 
| 200 | 
            -
            ### Playlist Commands ###
         | 
| 199 | 
            +
            ## Playlist Commands
         | 
| 201 200 |  | 
| 202 201 | 
             
            ---
         | 
| 203 202 | 
             
            `add {URI} => fetch_nothing`
         | 
| @@ -209,7 +208,7 @@ | |
| 209 208 |  | 
| 210 209 | 
             
            > Adds a song to the playlist (non-recursive) and returns the song id.
         | 
| 211 210 |  | 
| 212 | 
            -
             | 
| 211 | 
            +
            `URI` is always a single file or URL.
         | 
| 213 212 |  | 
| 214 213 | 
             
            ---
         | 
| 215 214 | 
             
            `clear => fetch_nothing`
         | 
| @@ -240,7 +239,6 @@ | |
| 240 239 | 
             
            `playlist => fetch_playlist`
         | 
| 241 240 |  | 
| 242 241 | 
             
            > Displays the current playlist.
         | 
| 243 | 
            -
             | 
| 244 242 | 
             
            > > **Note**: Do not use this, instead use `playlistinfo`.
         | 
| 245 243 |  | 
| 246 244 | 
             
            ---
         | 
| @@ -268,21 +266,21 @@ | |
| 268 266 |  | 
| 269 267 | 
             
            > Displays changed songs currently in the playlist since `VERSION`.
         | 
| 270 268 |  | 
| 271 | 
            -
             | 
| 269 | 
            +
            To detect songs that were deleted at the end of the playlist, use `playlistlength` returned by status command.
         | 
| 272 270 |  | 
| 273 271 | 
             
            ---
         | 
| 274 272 | 
             
            `plchangesposid {VERSION} => fetch_changes`
         | 
| 275 273 |  | 
| 276 274 | 
             
            > Displays changed songs currently in the playlist since `VERSION`. This function only returns the position and the id of the changed song, not the complete metadata. This is more bandwidth efficient.
         | 
| 277 275 |  | 
| 278 | 
            -
             | 
| 276 | 
            +
            To detect songs that were deleted at the end of the playlist, use `playlistlength` returned by status command.
         | 
| 279 277 |  | 
| 280 278 | 
             
            ---
         | 
| 281 279 | 
             
            `prio {PRIORITY} {START:END...} => fetch_nothing`
         | 
| 282 280 |  | 
| 283 281 | 
             
            > Set the priority of the specified songs. A higher priority means that it will be played first when "random" mode is enabled.
         | 
| 284 282 |  | 
| 285 | 
            -
             | 
| 283 | 
            +
            A priority is an integer between 0 and 255. The default priority of new songs is 0.
         | 
| 286 284 |  | 
| 287 285 | 
             
            ---
         | 
| 288 286 | 
             
            `prioid {PRIORITY} {ID...} => fetch_nothing`
         | 
| @@ -319,7 +317,7 @@ | |
| 319 317 |  | 
| 320 318 | 
             
            > Removes `TAG` from the specified `SONGID`. If `TAG` is not specified, then all tag values will be removed. Editing song tags is only possible for remote songs.
         | 
| 321 319 |  | 
| 322 | 
            -
             | 
| 320 | 
            +
            ## Stored Playlist Commands
         | 
| 323 321 |  | 
| 324 322 | 
             
            Playlists are stored inside the configured playlist directory. They are addressed with their file name (without the directory and without the .m3u suffix).
         | 
| 325 323 |  | 
| @@ -340,7 +338,7 @@ Some of the commands described in this section can be used to run playlist plugi | |
| 340 338 |  | 
| 341 339 | 
             
            > Prints a list of the playlist directory.
         | 
| 342 340 |  | 
| 343 | 
            -
             | 
| 341 | 
            +
            After each playlist name the server sends its last modification time as attribute "Last-Modified" in ISO 8601 format. To avoid problems due to clock differences between clients and the server, clients should not compare this value with their local clock.
         | 
| 344 342 |  | 
| 345 343 | 
             
            ---
         | 
| 346 344 | 
             
            `load {NAME} [START:END] => fetch_nothing`
         | 
| @@ -352,7 +350,7 @@ Some of the commands described in this section can be used to run playlist plugi | |
| 352 350 |  | 
| 353 351 | 
             
            > Adds `URI` to the playlist `NAME.m3u`.
         | 
| 354 352 |  | 
| 355 | 
            -
             | 
| 353 | 
            +
            `NAME.m3u` will be created if it does not exist.
         | 
| 356 354 |  | 
| 357 355 | 
             
            ---
         | 
| 358 356 | 
             
            `playlistclear {NAME} => fetch_nothing`
         | 
| @@ -384,7 +382,7 @@ Some of the commands described in this section can be used to run playlist plugi | |
| 384 382 |  | 
| 385 383 | 
             
            > Saves the current playlist to `NAME.m3u` in the playlist directory.
         | 
| 386 384 |  | 
| 387 | 
            -
             | 
| 385 | 
            +
            ## Database Commands
         | 
| 388 386 |  | 
| 389 387 | 
             
            ---
         | 
| 390 388 | 
             
            `count {TAG} {NEEDLE} => fetch_object`
         | 
| @@ -406,7 +404,7 @@ Some of the commands described in this section can be used to run playlist plugi | |
| 406 404 |  | 
| 407 405 | 
             
            > Lists all tags of the specified type. `TYPE` can be any tag supported by MPD or file.
         | 
| 408 406 |  | 
| 409 | 
            -
             | 
| 407 | 
            +
            `ARTIST` is an optional parameter when type is album, this specifies to list albums by an artist.
         | 
| 410 408 |  | 
| 411 409 | 
             
            ---
         | 
| 412 410 | 
             
            `listall [URI] => fetch_database`
         | 
| @@ -423,14 +421,14 @@ Some of the commands described in this section can be used to run playlist plugi | |
| 423 421 |  | 
| 424 422 | 
             
            > Lists the contents of the directory `URI`, including files are not recognized by `MPD`. `URI` can be a path relative to the music directory or an `URI` understood by one of the storage plugins. The response contains at least one line for each directory entry with the prefix `"file: "` or  `"directory: "`, and may be followed by file attributes such as `"Last-Modified"` and `"size"`.
         | 
| 425 423 |  | 
| 426 | 
            -
             | 
| 424 | 
            +
            For example, `smb://SERVER` returns a list of all shares on the given SMB/CIFS server; `nfs://servername/path` obtains a directory listing from the NFS server.
         | 
| 427 425 |  | 
| 428 426 | 
             
            ---
         | 
| 429 427 | 
             
            `lsinfo [URI] => fetch_database`
         | 
| 430 428 |  | 
| 431 429 | 
             
            > Lists the contents of the directory `URI`.
         | 
| 432 430 |  | 
| 433 | 
            -
             | 
| 431 | 
            +
            When listing the root directory, this currently returns the list of stored playlists. This behavior is deprecated; use `listplaylists` instead.
         | 
| 434 432 |  | 
| 435 433 | 
             
            > Clients that are connected via UNIX domain socket may use this command to read the tags of an arbitrary local file (`URI` beginning with "file:///").
         | 
| 436 434 |  | 
| @@ -444,25 +442,25 @@ Some of the commands described in this section can be used to run playlist plugi | |
| 444 442 |  | 
| 445 443 | 
             
            > Searches for any song that contains `WHAT` in tag `TYPE` and adds them to current playlist.
         | 
| 446 444 |  | 
| 447 | 
            -
             | 
| 445 | 
            +
            Parameters have the same meaning as for `find`, except that search is not case sensitive.
         | 
| 448 446 |  | 
| 449 447 | 
             
            ---
         | 
| 450 448 | 
             
            `searchaddpl {NAME} {TYPE} {WHAT} [...] => fetch_nothing`
         | 
| 451 449 |  | 
| 452 450 | 
             
            > Searches for any song that contains `WHAT` in tag `TYPE` and adds them to the playlist named `NAME`.
         | 
| 453 451 |  | 
| 454 | 
            -
             | 
| 452 | 
            +
            If a playlist by that name doesn't exist it is created.
         | 
| 455 453 |  | 
| 456 | 
            -
             | 
| 454 | 
            +
            Parameters have the same meaning as for find, except that search is not case sensitive.
         | 
| 457 455 |  | 
| 458 456 | 
             
            ---
         | 
| 459 457 | 
             
            `update [URI] => fetch_item`
         | 
| 460 458 |  | 
| 461 459 | 
             
            > Updates the music database: find new files, remove deleted files, update modified files.
         | 
| 462 460 |  | 
| 463 | 
            -
             | 
| 461 | 
            +
            `URI` is a particular directory or song/file to update. If you do not specify it, everything is updated.
         | 
| 464 462 |  | 
| 465 | 
            -
             | 
| 463 | 
            +
            Prints "updating_db: JOBID" where JOBID is a positive number identifying the update job. You can read the current job id in the status response.
         | 
| 466 464 |  | 
| 467 465 | 
             
            ---
         | 
| 468 466 | 
             
            `rescan [URI] => fetch_item`
         | 
| @@ -474,11 +472,11 @@ Some of the commands described in this section can be used to run playlist plugi | |
| 474 472 |  | 
| 475 473 | 
             
            > Read "comments" (i.e. key-value pairs) from the file specified by `URI`. This `URI` can be a path relative to the music directory or a URL in the form `file:///foo/bar.ogg`.
         | 
| 476 474 |  | 
| 477 | 
            -
             | 
| 475 | 
            +
            The response consists of lines in the form "KEY: VALUE". Comments with suspicious characters (e.g. newlines) are ignored silently.
         | 
| 478 476 |  | 
| 479 | 
            -
             | 
| 477 | 
            +
            The meaning of these depends on the codec, and not all decoder plugins support it.  For example, on Ogg files, this lists the Vorbis comments.
         | 
| 480 478 |  | 
| 481 | 
            -
             | 
| 479 | 
            +
            ## Mounts and neighbors
         | 
| 482 480 |  | 
| 483 481 | 
             
            A "storage" provides access to files in the directory tree. The most basic storage plugin is a "local" storage plugin which accesses the local file system, and there are plugins to access NFS and SMB servers.
         | 
| 484 482 |  | 
| @@ -504,7 +502,7 @@ Multiple storages can be "mounted" together, similar to the `mount` command on m | |
| 504 502 |  | 
| 505 503 | 
             
            > Queries a list of "neighbors" (e.g. accessible file servers on the local net).  Items on that list may be used with the `mount` command.
         | 
| 506 504 |  | 
| 507 | 
            -
             | 
| 505 | 
            +
            ## Sticker Commands
         | 
| 508 506 |  | 
| 509 507 | 
             
            "Stickers" are pieces of information attached to existing MPD objects (e.g. song files, directories, albums). Clients can create arbitrary name/value pairs. MPD itself does not assume any special meaning in them.
         | 
| 510 508 |  | 
| @@ -539,7 +537,7 @@ Objects which may have stickers are addressed by their object type ("song" for s | |
| 539 537 |  | 
| 540 538 | 
             
            > Searches the sticker database for stickers with the specified name, below the specified directory (`URI`). For each matching song, it prints the URI and that one sticker's value.
         | 
| 541 539 |  | 
| 542 | 
            -
             | 
| 540 | 
            +
            ## Connection Commands
         | 
| 543 541 |  | 
| 544 542 | 
             
            ---
         | 
| 545 543 | 
             
            `close`
         | 
| @@ -583,20 +581,18 @@ Objects which may have stickers are addressed by their object type ("song" for s | |
| 583 581 |  | 
| 584 582 | 
             
            > Turns an output on or off, depending on the current state.
         | 
| 585 583 |  | 
| 586 | 
            -
             | 
| 587 | 
            -
            ### Reflection Commands ###
         | 
| 584 | 
            +
            ## Reflection Commands
         | 
| 588 585 |  | 
| 589 586 | 
             
            ---
         | 
| 590 587 | 
             
            `config => fetch_item`
         | 
| 591 588 |  | 
| 592 589 | 
             
            > Dumps configuration values that may be interesting for the client. This command is only permitted to "local" clients (connected via UNIX domain socket).
         | 
| 593 590 |  | 
| 594 | 
            -
             | 
| 591 | 
            +
            The following response attributes are available:
         | 
| 595 592 |  | 
| 596 | 
            -
             | 
| 597 | 
            -
            |  | 
| 598 | 
            -
            |  | 
| 599 | 
            -
            | music_directory    | The absolute path of the music directory |
         | 
| 593 | 
            +
            | Name | Description |
         | 
| 594 | 
            +
            | --- | --- |
         | 
| 595 | 
            +
            | music_directory | The absolute path of the music directory |
         | 
| 600 596 |  | 
| 601 597 | 
             
            ---
         | 
| 602 598 | 
             
            `commands => fetch_list`
         | 
| @@ -623,7 +619,7 @@ Objects which may have stickers are addressed by their object type ("song" for s | |
| 623 619 |  | 
| 624 620 | 
             
            > Print a list of decoder plugins, followed by their supported suffixes and MIME types.
         | 
| 625 621 |  | 
| 626 | 
            -
             | 
| 622 | 
            +
            ## Client to client
         | 
| 627 623 |  | 
| 628 624 | 
             
            Clients can communicate with each others over "channels". A channel is created by a client subscribing to it. More than one client can be subscribed to a channel at a time; all of them will receive the messages which get sent to it.
         | 
| 629 625 |  | 
    
        data/README.md
    CHANGED
    
    | @@ -1,4 +1,7 @@ | |
| 1 | 
            -
            #  | 
| 1 | 
            +
            # MPD::Client
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            [](https://travis-ci.org/mamantoha/mpd_client)
         | 
| 4 | 
            +
            [](https://badge.fury.io/rb/mpd_client)
         | 
| 2 5 |  | 
| 3 6 | 
             
            Yet another Music Player Daemon (MPD) client library written entirely in Ruby.
         | 
| 4 7 | 
             
            `mpd_client` is a Ruby port of the [python-mpd](https://github.com/Mic92/python-mpd2) library.
         | 
| @@ -13,24 +16,25 @@ gem 'mpd_client' | |
| 13 16 |  | 
| 14 17 | 
             
            And then execute:
         | 
| 15 18 |  | 
| 16 | 
            -
            ```
         | 
| 17 | 
            -
             | 
| 19 | 
            +
            ```console
         | 
| 20 | 
            +
            bundle
         | 
| 18 21 | 
             
            ```
         | 
| 19 22 |  | 
| 20 23 | 
             
            Or install it yourself as:
         | 
| 21 24 |  | 
| 22 | 
            -
            ```
         | 
| 23 | 
            -
             | 
| 25 | 
            +
            ```console
         | 
| 26 | 
            +
            gem install mpd_client
         | 
| 24 27 | 
             
            ```
         | 
| 25 28 |  | 
| 26 29 | 
             
            ## Usage
         | 
| 27 | 
            -
             | 
| 30 | 
            +
             | 
| 31 | 
            +
            All functionality is contained in the `MPD::Client` class. Creating an instance of this class is as simple as:
         | 
| 28 32 |  | 
| 29 33 | 
             
            ```ruby
         | 
| 30 | 
            -
            client =  | 
| 34 | 
            +
            client = MPD::Client.new
         | 
| 31 35 | 
             
            ```
         | 
| 32 36 |  | 
| 33 | 
            -
            Once you have an instance of the ` | 
| 37 | 
            +
            Once you have an instance of the `MPD::Client` class, start by connecting to the server:
         | 
| 34 38 |  | 
| 35 39 | 
             
            ```ruby
         | 
| 36 40 | 
             
            client.connect('localhost', 6600)
         | 
| @@ -78,28 +82,28 @@ client.delete([10,]) | |
| 78 82 |  | 
| 79 83 | 
             
            ### Logging
         | 
| 80 84 |  | 
| 81 | 
            -
            Default logger for all  | 
| 85 | 
            +
            Default logger for all MPD::Client instances:
         | 
| 82 86 |  | 
| 83 87 | 
             
            ```ruby
         | 
| 84 88 | 
             
            require 'logger'
         | 
| 85 89 | 
             
            require 'mpd_client'
         | 
| 86 90 |  | 
| 87 | 
            -
             | 
| 91 | 
            +
            MPD::Client.log = Logger.new($stderr)
         | 
| 88 92 |  | 
| 89 | 
            -
            client =  | 
| 93 | 
            +
            client = MPD::Client.new
         | 
| 90 94 | 
             
            ```
         | 
| 91 95 |  | 
| 92 | 
            -
            Sets the logger used by this instance of  | 
| 96 | 
            +
            Sets the logger used by this instance of MPD::Client:
         | 
| 93 97 |  | 
| 94 98 | 
             
            ```ruby
         | 
| 95 99 | 
             
            require 'logger'
         | 
| 96 100 | 
             
            require 'mpd_client'
         | 
| 97 101 |  | 
| 98 | 
            -
            client =  | 
| 102 | 
            +
            client = MPD::Client.new
         | 
| 99 103 | 
             
            client.log = Logger.new($stderr)
         | 
| 100 104 | 
             
            ```
         | 
| 101 105 |  | 
| 102 | 
            -
            For more information about logging configuration, see  | 
| 106 | 
            +
            For more information about logging configuration, see [Logger](https://ruby-doc.org/stdlib-2.5.1/libdoc/logger/rdoc/Logger.html)
         | 
| 103 107 |  | 
| 104 108 | 
             
            ## Development
         | 
| 105 109 |  | 
| @@ -117,6 +121,6 @@ To install this gem onto your local machine, run `bundle exec rake install`. To | |
| 117 121 |  | 
| 118 122 | 
             
            ## License and Author
         | 
| 119 123 |  | 
| 120 | 
            -
            Copyright (c) 2013- | 
| 124 | 
            +
            Copyright (c) 2013-2018 by Anton Maminov
         | 
| 121 125 |  | 
| 122 126 | 
             
            This library is distributed under the MIT license.  Please see the LICENSE file.
         |