nextcloud 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +7 -7
- data/LICENSE.txt +1 -1
- data/README.md +20 -22
- data/lib/nextcloud/api.rb +1 -3
- data/lib/nextcloud/ocs/app.rb +1 -1
- data/lib/nextcloud/ocs/file_sharing_api.rb +1 -1
- data/lib/nextcloud/ocs/group.rb +1 -1
- data/lib/nextcloud/version/nextcloud.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fea695a7365795a975359026a2c2a08048a4f279
|
4
|
+
data.tar.gz: f26bcf0f956ec16e56f63421058405451e60d580
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c91346d5a807a05eebfad1db7e868df2123235144904eeea2648d253ff7b452a474119d68f88ecbd6183b2902ec6ba9afc28f790a43f903aaccacc62e946d657
|
7
|
+
data.tar.gz: 21d07523364dd0783d66047822480e42b5dd7bb1a6cc796a0150213973b0ec742b774c22aff9ae4cd825fd33db50d1656f1e98b450e200813811c2e8419484aa
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
nextcloud (1.3.
|
4
|
+
nextcloud (1.3.2)
|
5
5
|
activesupport (~> 5.1)
|
6
6
|
json (~> 2.1)
|
7
7
|
net-http-report (~> 0.1)
|
@@ -10,9 +10,9 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
activesupport (5.
|
13
|
+
activesupport (5.2.0)
|
14
14
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
15
|
-
i18n (
|
15
|
+
i18n (>= 0.7, < 2)
|
16
16
|
minitest (~> 5.1)
|
17
17
|
tzinfo (~> 1.1)
|
18
18
|
addressable (2.5.2)
|
@@ -30,13 +30,13 @@ GEM
|
|
30
30
|
diff-lcs (1.3)
|
31
31
|
docile (1.1.5)
|
32
32
|
hashdiff (0.3.7)
|
33
|
-
i18n (0.
|
33
|
+
i18n (1.0.1)
|
34
34
|
concurrent-ruby (~> 1.0)
|
35
35
|
json (2.1.0)
|
36
36
|
mini_portile2 (2.3.0)
|
37
|
-
minitest (5.
|
37
|
+
minitest (5.11.3)
|
38
38
|
net-http-report (0.1.0)
|
39
|
-
nokogiri (1.8.
|
39
|
+
nokogiri (1.8.2)
|
40
40
|
mini_portile2 (~> 2.3.0)
|
41
41
|
parallel (1.12.0)
|
42
42
|
parser (2.4.0.2)
|
@@ -78,7 +78,7 @@ GEM
|
|
78
78
|
thor (0.19.4)
|
79
79
|
thread_safe (0.3.6)
|
80
80
|
tins (1.15.1)
|
81
|
-
tzinfo (1.2.
|
81
|
+
tzinfo (1.2.5)
|
82
82
|
thread_safe (~> 0.1)
|
83
83
|
unicode-display_width (1.3.0)
|
84
84
|
vcr (3.0.3)
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -69,7 +69,7 @@ webdav = nextcloud.webdav
|
|
69
69
|
|
70
70
|
#### Initialize specific APIs
|
71
71
|
|
72
|
-
Previously described method is recommended, however you can initialize in a
|
72
|
+
Previously described method is recommended, however you can initialize in a different manner.
|
73
73
|
|
74
74
|
Initialize OCS Users API:
|
75
75
|
|
@@ -98,15 +98,15 @@ file_sharing = Nextcloud::Ocs::FileSharingApi.new(url: "…", username: "…", p
|
|
98
98
|
Initialize WebDAV Directory API:
|
99
99
|
|
100
100
|
```
|
101
|
-
directory = Nextcloud::
|
101
|
+
directory = Nextcloud::Webdav::Directory.new(url: "…", username: "…", password: "…")
|
102
102
|
```
|
103
103
|
|
104
104
|
> When initializing this way, to work with certain objects some circumstances might force you use `set` method.
|
105
105
|
> For example if you wish to list members of group admin, using first way you could simply write
|
106
106
|
`ocs.group('admin').members`, in this case you will need to use `group.set('admin').members`. There is another way to
|
107
107
|
set object of intereset by putting it into initialize arguments, like so
|
108
|
-
`Nextcloud::Ocs::Group.new({…credentials}, groupid
|
109
|
-
`set`.
|
108
|
+
`Nextcloud::Ocs::Group.new({…credentials}, groupid="admin")` it can be then reset with
|
109
|
+
`set`. Corresponding parameter names for other classes are `userid` and `appid`.
|
110
110
|
|
111
111
|
### *OCS Api usage*
|
112
112
|
|
@@ -449,7 +449,7 @@ meta = share.meta
|
|
449
449
|
|
450
450
|
#### Retrive shares from specific file or folder
|
451
451
|
|
452
|
-
Can be called with two optional
|
452
|
+
Can be called with two optional parameters
|
453
453
|
* reshares - boolean - shows all shares for a given file
|
454
454
|
* subfiles - boolean - shows all shares for subfiles in a directory
|
455
455
|
|
@@ -560,7 +560,7 @@ meta = pending.meta
|
|
560
560
|
|
561
561
|
```
|
562
562
|
federated_share = ocs_fs.federated.find(12)
|
563
|
-
# => {"id"=>"12", "remote"=>"https://…", …}
|
563
|
+
# => {"id"=>"12", "remote"=>"https://…", …}s
|
564
564
|
meta = federated_share.meta
|
565
565
|
# => {"status"=>"ok", "statuscode"=>"200", "message"=>"OK"}
|
566
566
|
```
|
@@ -586,83 +586,81 @@ meta = ocs_fs.federated.decline(13)
|
|
586
586
|
# => {"status"=>"ok", "statuscode"=>"200", "message"=>"OK"}
|
587
587
|
```
|
588
588
|
|
589
|
-
|
589
|
+
### *WebDAV Api usage*
|
590
590
|
|
591
591
|
In these examples `webdav` variable is assumed to be a valid instance of
|
592
592
|
`Nextcloud.webdav` or `Nextcloud::Webdav::{CLASS_NAME}.new`
|
593
593
|
|
594
|
-
|
594
|
+
### File/Directory Operations
|
595
595
|
|
596
|
-
|
597
|
-
|
598
|
-
### Find files/directories in given path
|
596
|
+
#### Find files/directories in given path
|
599
597
|
|
600
598
|
```
|
601
599
|
directory = webdav.directory.find("dir1/")
|
602
600
|
```
|
603
601
|
|
604
602
|
Will return instance of `Directory` model with information about current directory, it's method `contents` will contain
|
605
|
-
array of
|
603
|
+
array of results:
|
606
604
|
|
607
605
|
```
|
608
606
|
directory.contents
|
609
607
|
```
|
610
608
|
|
611
|
-
|
609
|
+
#### Query information about file
|
612
610
|
|
613
611
|
```
|
614
612
|
file = webdav.directory.find("some_file.txt")
|
615
613
|
```
|
616
614
|
|
617
|
-
|
615
|
+
#### Create a directory
|
618
616
|
|
619
617
|
```
|
620
618
|
webdav.directory.create("some_dir/new_dir")
|
621
619
|
```
|
622
620
|
|
623
|
-
|
621
|
+
#### Delete a directory
|
624
622
|
|
625
623
|
```
|
626
624
|
webdav.directory.destroy("some_dir")
|
627
625
|
```
|
628
626
|
|
629
|
-
|
627
|
+
#### Move a directory
|
630
628
|
|
631
629
|
```
|
632
630
|
webdav.directory.move("source_dir/", "destination_dir/")
|
633
631
|
```
|
634
632
|
|
635
|
-
|
633
|
+
#### Copy a directory
|
636
634
|
|
637
635
|
```
|
638
636
|
webdav.directory.copy("source_dir/", "destination_dir/)
|
639
637
|
```
|
640
638
|
|
641
|
-
|
639
|
+
#### Download a file
|
642
640
|
|
643
641
|
```
|
644
642
|
webdav.directory.download("some_file.txt")
|
645
643
|
```
|
646
644
|
|
647
|
-
|
645
|
+
#### Upload a file
|
648
646
|
|
649
647
|
```
|
650
648
|
webdav.directory.upload("some_dir/new_file.txt", "CONTENTS")
|
651
649
|
```
|
652
650
|
|
653
|
-
|
651
|
+
#### Make a file favorite
|
654
652
|
|
655
653
|
```
|
656
654
|
webdav.directory.favorite("some_file")
|
657
655
|
```
|
658
656
|
|
659
|
-
|
657
|
+
#### Unfavorite a file
|
660
658
|
|
661
659
|
```
|
662
660
|
webdav.directory.unfavorite("some_file")
|
663
661
|
```
|
664
662
|
|
665
|
-
|
663
|
+
#### Show favorite files in path
|
666
664
|
|
667
665
|
```
|
668
666
|
webdav.directory.favorites("/")
|
data/lib/nextcloud/api.rb
CHANGED
@@ -26,9 +26,7 @@ module Nextcloud
|
|
26
26
|
def request(method, path, params = nil, body = nil, depth = nil, destination = nil, raw = false)
|
27
27
|
response = Net::HTTP.start(@url.host, @url.port,
|
28
28
|
use_ssl: @url.scheme == "https") do |http|
|
29
|
-
req = Kernel.const_get("Net::HTTP::#{method.capitalize}").new(
|
30
|
-
@url.to_s + path, 'Content-Type': "application/x-www-form-urlencoded"
|
31
|
-
)
|
29
|
+
req = Kernel.const_get("Net::HTTP::#{method.capitalize}").new(@url.request_uri + path)
|
32
30
|
req["OCS-APIRequest"] = true
|
33
31
|
req.basic_auth @username, @password
|
34
32
|
req["Content-Type"] = "application/x-www-form-urlencoded"
|
data/lib/nextcloud/ocs/app.rb
CHANGED
data/lib/nextcloud/ocs/group.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nextcloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dachi Natsvlishvili
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|