README.md in qnap-download_station-0.0.3 vs README.md in qnap-download_station-0.0.4

- old
+ new

@@ -3,10 +3,14 @@ This gem provides an interface to the Download Station app that comes installed by default on many QNAP NAS. It provides access to all available endpoints, but only a few have been documented. +If you can help document the endpoints, and provide example use cases, please feel free to send pull requests. + +This software is an unofficial client for the QNAP api, and is not endorsed by QNAP. Future updates to your QNAP could possibly break the functionality of this library without warning. + Installation ------- `gem install qnap-download_station` @@ -15,11 +19,11 @@ ```ruby # Download a Linux ISO from the web require 'qnap/download_station' -ubuntu_iso = "http://de.releases.ubuntu.com/16.04/ubuntu-16.04.1-desktop-amd64.iso" +ubuntu_iso = "http://de.releases.ubuntu.com/18.04/ubuntu-18.04-desktop-amd64.iso" ds = Qnap::DownloadStation.new '192.168.1.100', 'username', 'password' ds.task_add_url temp: 'Download', move: 'Multimedia/New', url: ubuntu_iso active_downloads = ds.task_query ds.logout @@ -34,9 +38,24 @@ ds.task_add_url temp: 'Download', move: 'Multimedia/New', url: magnet_link pp ds.task_query # logout is automatically called, even if there was an exception end +``` + +Alternatively, if the username and password are not provided, Qnap::DownloadStation will attempt to read them from environment variables. +```ruby +# ENV['QNAP_USERNAME'] +# ENV['QNAP_PASSWORD'] + +ds = Qnap::DownloadStation.new '192.168.1.100' +# ... +ds.logout + +# or... +Qnap::DownloadStation.session('192.168.1.100') do |ds| + # ... +end ``` Available methods -------