qnap-download_station 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dcdc245bca1fae8f44283dba4fc26564ce6921e6f0112f7c7fd94bc0a27223ff
4
- data.tar.gz: cab67c4ffa8a79d4e51ff6985132a0376f9324fc68ceda22bb6617ab7d606f06
3
+ metadata.gz: ad64c8282f650f10680ed39cabcd28440d96f74e3ca5c8b42b7bc2eca41bd6c9
4
+ data.tar.gz: 2cc322c1b70e35d30c14ebf5c75b677cdcfb97f0503564a57228805ad3d3063b
5
5
  SHA512:
6
- metadata.gz: cdda47bbbe735953249dfb97a7d817c92988bf099c11425c26ed7ebf1004c1931bf5229f166ae13161bc284a4b088dc6555d081ff8e0b7691d9ef8fde8fd1205
7
- data.tar.gz: f718054f516cc19c3886db5537619bfac4b799b46de605602286f28903cf45c028bd84a3d48653173d329e8e27f6402a25b9d71cd84a7363cc1b98d266ee3a2b
6
+ metadata.gz: 7133bc9ee815355b62b13894bf8c2bf788c51d36dbc40039ecd92aa8171eba661b210626759c390e6e6ee9b81e5245885cf40141f17cc9a874368b224dcbc5dc
7
+ data.tar.gz: 3c400fab410bed77d284860c8d16d635c70d2ba245dddad8add5f5f4a243aa2d2ae58bd0d9ccf2991ab84df7c56a8b44d33848849ca2888de5b90bd1a4ba26df
data/README.md CHANGED
@@ -5,6 +5,10 @@ This gem provides an interface to the Download Station app that comes installed
5
5
 
6
6
  It provides access to all available endpoints, but only a few have been documented.
7
7
 
8
+ If you can help document the endpoints, and provide example use cases, please feel free to send pull requests.
9
+
10
+ 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.
11
+
8
12
  Installation
9
13
  -------
10
14
 
@@ -17,7 +21,7 @@ Usage
17
21
  # Download a Linux ISO from the web
18
22
  require 'qnap/download_station'
19
23
 
20
- ubuntu_iso = "http://de.releases.ubuntu.com/16.04/ubuntu-16.04.1-desktop-amd64.iso"
24
+ ubuntu_iso = "http://de.releases.ubuntu.com/18.04/ubuntu-18.04-desktop-amd64.iso"
21
25
 
22
26
  ds = Qnap::DownloadStation.new '192.168.1.100', 'username', 'password'
23
27
  ds.task_add_url temp: 'Download', move: 'Multimedia/New', url: ubuntu_iso
@@ -38,6 +42,21 @@ end
38
42
 
39
43
  ```
40
44
 
45
+ Alternatively, if the username and password are not provided, Qnap::DownloadStation will attempt to read them from environment variables.
46
+ ```ruby
47
+ # ENV['QNAP_USERNAME']
48
+ # ENV['QNAP_PASSWORD']
49
+
50
+ ds = Qnap::DownloadStation.new '192.168.1.100'
51
+ # ...
52
+ ds.logout
53
+
54
+ # or...
55
+ Qnap::DownloadStation.session('192.168.1.100') do |ds|
56
+ # ...
57
+ end
58
+ ```
59
+
41
60
  Available methods
42
61
  -------
43
62
 
@@ -60,7 +60,11 @@ module Qnap
60
60
  @sid ||= misc_login(user: @username, pass: Base64.encode64(@password))[:sid]
61
61
  end
62
62
 
63
- def initialize(host, username, password)
63
+ def initialize(host, username = ENV['QNAP_USERNAME'], password = ENV['QNAP_PASSWORD'])
64
+
65
+ raise ArgumentError.new("No username defined") if username.nil?
66
+ raise ArgumentError.new("No password defined") if password.nil?
67
+
64
68
  @host = host
65
69
  @username = username
66
70
  @password = password
@@ -1,7 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "qnap-download_station"
3
- s.version = "0.0.3"
4
- s.date = "2016-09-21"
3
+ s.version = "0.0.4"
5
4
  s.summary = "Interface to the Download Station API"
6
5
  s.description = "Manage your downloads in Download Station"
7
6
  s.authors = "cyclotron3k"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qnap-download_station
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - cyclotron3k
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-21 00:00:00.000000000 Z
11
+ date: 2019-06-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Manage your downloads in Download Station
14
14
  email:
@@ -41,7 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
41
41
  version: '0'
42
42
  requirements: []
43
43
  rubyforge_project:
44
- rubygems_version: 2.7.6
44
+ rubygems_version: 2.7.6.2
45
45
  signing_key:
46
46
  specification_version: 4
47
47
  summary: Interface to the Download Station API