nextcloud 1.3.1 → 1.3.2

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
  SHA1:
3
- metadata.gz: ea93ad0137fdb867612e398a39d8404017ff98ec
4
- data.tar.gz: 55d7e48456006f7b73ed46b160675acc749d149d
3
+ metadata.gz: fea695a7365795a975359026a2c2a08048a4f279
4
+ data.tar.gz: f26bcf0f956ec16e56f63421058405451e60d580
5
5
  SHA512:
6
- metadata.gz: 304a696a381fcd3ceae6e9f711ce869451c00634049c8430aa91ffbee21cc7f6d2de57fd5f870f8886ebdd215f75d0e51741f16080e5f18925e44b17b4f3f427
7
- data.tar.gz: 61d3d482ace84ef5f7656f7db9a5fc8ae881495254c952abaf670d474eb1e0fedb7d28b22e80d29a7b58e037f5d478bd8e704a8b45d3799121976564e350609a
6
+ metadata.gz: c91346d5a807a05eebfad1db7e868df2123235144904eeea2648d253ff7b452a474119d68f88ecbd6183b2902ec6ba9afc28f790a43f903aaccacc62e946d657
7
+ data.tar.gz: 21d07523364dd0783d66047822480e42b5dd7bb1a6cc796a0150213973b0ec742b774c22aff9ae4cd825fd33db50d1656f1e98b450e200813811c2e8419484aa
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nextcloud (1.3.0)
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.1.4)
13
+ activesupport (5.2.0)
14
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
15
- i18n (~> 0.7)
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.9.1)
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.10.3)
37
+ minitest (5.11.3)
38
38
  net-http-report (0.1.0)
39
- nokogiri (1.8.1)
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.4)
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)
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017 Dachi Natsvlishvili
3
+ Copyright (c) 2017 David Natsvlishvili
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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 differt manner.
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::WebDav::Directory.new(url: "…", username: "…", password: "…")
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: "admin")` it can be then reset with
109
- `set`. Corressponding parameter names for other classes are `userid` and `appid`.
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 paremeters
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
- #### *WebDAV Api usage*
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
- #### File/Directory Operations
594
+ ### File/Directory Operations
595
595
 
596
- Let's assume
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 resutls:
603
+ array of results:
606
604
 
607
605
  ```
608
606
  directory.contents
609
607
  ```
610
608
 
611
- ### Query information about file
609
+ #### Query information about file
612
610
 
613
611
  ```
614
612
  file = webdav.directory.find("some_file.txt")
615
613
  ```
616
614
 
617
- ### Create a directory
615
+ #### Create a directory
618
616
 
619
617
  ```
620
618
  webdav.directory.create("some_dir/new_dir")
621
619
  ```
622
620
 
623
- ### Delete a directory
621
+ #### Delete a directory
624
622
 
625
623
  ```
626
624
  webdav.directory.destroy("some_dir")
627
625
  ```
628
626
 
629
- ### Move a directory
627
+ #### Move a directory
630
628
 
631
629
  ```
632
630
  webdav.directory.move("source_dir/", "destination_dir/")
633
631
  ```
634
632
 
635
- ### Copy a directory
633
+ #### Copy a directory
636
634
 
637
635
  ```
638
636
  webdav.directory.copy("source_dir/", "destination_dir/)
639
637
  ```
640
638
 
641
- ### Download a file
639
+ #### Download a file
642
640
 
643
641
  ```
644
642
  webdav.directory.download("some_file.txt")
645
643
  ```
646
644
 
647
- ### Upload a file
645
+ #### Upload a file
648
646
 
649
647
  ```
650
648
  webdav.directory.upload("some_dir/new_file.txt", "CONTENTS")
651
649
  ```
652
650
 
653
- ### Make a file favorite
651
+ #### Make a file favorite
654
652
 
655
653
  ```
656
654
  webdav.directory.favorite("some_file")
657
655
  ```
658
656
 
659
- ### Unfavorite a file
657
+ #### Unfavorite a file
660
658
 
661
659
  ```
662
660
  webdav.directory.unfavorite("some_file")
663
661
  ```
664
662
 
665
- ### Show favorite files in path
663
+ #### Show favorite files in path
666
664
 
667
665
  ```
668
666
  webdav.directory.favorites("/")
@@ -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"
@@ -28,7 +28,7 @@ module Nextcloud
28
28
 
29
29
  # Sets app (useful if class is initiated without OcsApi.app)
30
30
  #
31
- # @param userid [String] User identifier
31
+ # @param appid [String] App identifier
32
32
  # @return [Obeject] self
33
33
  def set(appid)
34
34
  @appid = appid
@@ -9,7 +9,7 @@ module Nextcloud
9
9
  class FileSharingApi < OcsApi
10
10
  include Helpers
11
11
 
12
- attr_accessor :meta, :shareid
12
+ attr_accessor :meta
13
13
 
14
14
  # Initializes API with user credentials
15
15
  #
@@ -28,7 +28,7 @@ module Nextcloud
28
28
 
29
29
  # Sets group (useful if class is initiated without OcsApi.group)
30
30
  #
31
- # @param userid [String] User identifier
31
+ # @param groupid [String] Group identifier
32
32
  # @return [Obeject] self
33
33
  def set(groupid)
34
34
  @groupid = groupid
@@ -1,5 +1,5 @@
1
1
  module Nextcloud
2
2
  module Version
3
- VERSION = "1.3.1".freeze
3
+ VERSION = "1.3.2".freeze
4
4
  end
5
5
  end
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.1
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: 2017-11-25 00:00:00.000000000 Z
11
+ date: 2018-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport