qnap-file_station 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +18 -3
- data/lib/qnap/file_station.rb +6 -2
- data/qnap-file_station.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 51d0d62f125fe53487b2f41105b2d7be9de64d714d3e73dc2e552fdd77e649f9
|
4
|
+
data.tar.gz: 1004c7e7cf5d3ab18f43e35cc6e823405187e3b176825744db980dbe9c4b47cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 400e3bdd7f6778cfbbc9ded4c4a318de1bfbfc9220e2e616e494bed74f4eac171f371c170931f5b2450c13c49703be746f49594aa84693234e3237552fd66c9b
|
7
|
+
data.tar.gz: d062efdbc681e3e9a4ada5052a0f6815a0dbe7b3754fd8e39888407188b9c8df1a59ec7414b97458ef13626574fa257fec8eee79d890702feadc7729ae1a9b4f
|
data/README.md
CHANGED
@@ -39,6 +39,21 @@ end
|
|
39
39
|
|
40
40
|
```
|
41
41
|
|
42
|
+
Alternatively, if the username and password are not provided, Qnap::FileStation will attempt to read them from environment variables.
|
43
|
+
```ruby
|
44
|
+
# ENV['QNAP_USERNAME']
|
45
|
+
# ENV['QNAP_PASSWORD']
|
46
|
+
|
47
|
+
fs = Qnap::FileStation.new '192.168.1.100'
|
48
|
+
# ...
|
49
|
+
fs.logout
|
50
|
+
|
51
|
+
# or...
|
52
|
+
Qnap::FileStation.session('192.168.1.100') do |fs|
|
53
|
+
# ...
|
54
|
+
end
|
55
|
+
```
|
56
|
+
|
42
57
|
Constants
|
43
58
|
-------
|
44
59
|
`Qnap::FileStation::DEBUG`, default: `false`. Print extensive debugging information to `$stdout` if `true`
|
@@ -290,7 +305,7 @@ path | Folder path.
|
|
290
305
|
file_total | Total number of folder/file(s).
|
291
306
|
file_name | Folder/file name.
|
292
307
|
|
293
|
-
### stat
|
308
|
+
### stat
|
294
309
|
Set folder(s)/file(s) modification time.
|
295
310
|
|
296
311
|
#### Parameters
|
@@ -316,7 +331,7 @@ limit | Number of response data
|
|
316
331
|
sort | Sort field (filename/filesize/filetype/mt/privilege/owner/group)
|
317
332
|
start | Response data start index
|
318
333
|
|
319
|
-
###
|
334
|
+
###
|
320
335
|
Download a shared file by an unique ID (ssid).
|
321
336
|
|
322
337
|
#### Parameters
|
@@ -463,7 +478,7 @@ Show available network players (AirPlay, Chromecast, DLNA players, etc.) May not
|
|
463
478
|
#### Parameters
|
464
479
|
Key | Description
|
465
480
|
--- | ---
|
466
|
-
op | 1:
|
481
|
+
op | 1:
|
467
482
|
|
468
483
|
### video_ml_queue
|
469
484
|
Retrieve the status of media library transcoding queue.
|
data/lib/qnap/file_station.rb
CHANGED
@@ -103,7 +103,11 @@ module Qnap
|
|
103
103
|
@sid ||= login(user: @username, pwd: Base64.encode64(@password).strip)[:sid]
|
104
104
|
end
|
105
105
|
|
106
|
-
def initialize(host, username, password)
|
106
|
+
def initialize(host, username = ENV['QNAP_USERNAME'], password = ENV['QNAP_PASSWORD'])
|
107
|
+
|
108
|
+
raise ArgumentError.new("No username defined") if username.nil?
|
109
|
+
raise ArgumentError.new("No password defined") if password.nil?
|
110
|
+
|
107
111
|
@host = host
|
108
112
|
@username = username
|
109
113
|
@password = password
|
@@ -111,7 +115,7 @@ module Qnap
|
|
111
115
|
@base_uri = URI "#{PROTOCOL}://#{@host}"
|
112
116
|
@path = "/cgi-bin/filemanager/utilRequest.cgi"
|
113
117
|
@agent = Net::HTTP.new @base_uri.host, @base_uri.port
|
114
|
-
|
118
|
+
|
115
119
|
@agent.use_ssl = PROTOCOL == 'https',
|
116
120
|
@agent.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
117
121
|
@agent.keep_alive_timeout = 10
|
data/qnap-file_station.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qnap-file_station
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cyclotron3k
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Manage your files and folders in File Station
|
14
14
|
email:
|
@@ -42,7 +42,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
42
42
|
version: '0'
|
43
43
|
requirements: []
|
44
44
|
rubyforge_project:
|
45
|
-
rubygems_version: 2.
|
45
|
+
rubygems_version: 2.7.6.2
|
46
46
|
signing_key:
|
47
47
|
specification_version: 4
|
48
48
|
summary: Interface to the File Station API
|