ocman 1.2.1 → 1.2.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 +4 -4
- data/lib/ocman/share.rb +13 -16
- data/lib/ocman/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 53a9d30769538c25b17259be0269c4ffb5c8cb7c
|
|
4
|
+
data.tar.gz: dc01e94e3b3dd0a6768473bc24cc9e693443d4c0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: df4565708d6efba8eca698eb60ea641b1f8d1c213ff92c0c7be6f289b7f376a6d20525c5048e32d700623149b43aca8c0c194e7c362d811f0009976d56276887
|
|
7
|
+
data.tar.gz: 7cc0944dbc96facafa345c0c5aa042aac1b33b6886dd32a8a6fb5363ae67db72c120367f1628d0bc572f2ccbc74740be6479cfa299d24fa04b46debd393b4df7
|
data/lib/ocman/share.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require '
|
|
1
|
+
require 'multi_json'
|
|
2
2
|
require 'restclient'
|
|
3
3
|
require 'hashie'
|
|
4
4
|
|
|
@@ -24,8 +24,7 @@ module Ocman
|
|
|
24
24
|
|
|
25
25
|
def delete_share(user)
|
|
26
26
|
share = find_share(user)
|
|
27
|
-
|
|
28
|
-
request = RestClient::Request.new( request_parameter )
|
|
27
|
+
request = RestClient::Request.new( connection_params('delete', id: share.id) )
|
|
29
28
|
parse_result( request.execute )
|
|
30
29
|
end
|
|
31
30
|
|
|
@@ -42,32 +41,30 @@ module Ocman
|
|
|
42
41
|
end
|
|
43
42
|
|
|
44
43
|
def share_info
|
|
45
|
-
|
|
46
|
-
headers: {
|
|
47
|
-
params: {
|
|
48
|
-
path: @path
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
}.merge connection_params('get')
|
|
52
|
-
|
|
53
|
-
request = RestClient::Request.new( request_parameter )
|
|
44
|
+
request = RestClient::Request.new( connection_params('get', path: @path) )
|
|
54
45
|
parse_result( request.execute )
|
|
55
46
|
end
|
|
56
47
|
|
|
57
48
|
private
|
|
58
49
|
def parse_result(response)
|
|
59
|
-
Hashie::Mash.new(
|
|
50
|
+
Hashie::Mash.new( MultiJson.load(response)['ocs'] )
|
|
60
51
|
end
|
|
61
52
|
|
|
62
|
-
def connection_params(http_method,
|
|
63
|
-
|
|
53
|
+
def connection_params(http_method, attributes={})
|
|
54
|
+
id = attributes[:id]
|
|
55
|
+
url = Ocman.configuration.base_url + "/ocs/v1.php/apps/files_sharing/api/v1/shares" + "#{'/' + id.to_s if id}"
|
|
56
|
+
|
|
64
57
|
{
|
|
65
58
|
url: url,
|
|
66
59
|
method: http_method,
|
|
67
60
|
user: Ocman.configuration.user_name,
|
|
68
61
|
password: Ocman.configuration.password,
|
|
69
62
|
headers: {
|
|
70
|
-
'OCS-APIRequest'
|
|
63
|
+
'OCS-APIRequest' => true,
|
|
64
|
+
params: {
|
|
65
|
+
path: attributes[:path],
|
|
66
|
+
format: 'json'
|
|
67
|
+
}.reject {| key, value | value.nil? }
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
70
|
end
|
data/lib/ocman/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ocman
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Waldemar Gribele
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2016-12-
|
|
12
|
+
date: 2016-12-30 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: net_dav
|
|
@@ -54,19 +54,19 @@ dependencies:
|
|
|
54
54
|
- !ruby/object:Gem::Version
|
|
55
55
|
version: '2.0'
|
|
56
56
|
- !ruby/object:Gem::Dependency
|
|
57
|
-
name:
|
|
57
|
+
name: multi_json
|
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
|
59
59
|
requirements:
|
|
60
60
|
- - "~>"
|
|
61
61
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: '
|
|
62
|
+
version: '1.0'
|
|
63
63
|
type: :runtime
|
|
64
64
|
prerelease: false
|
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
|
66
66
|
requirements:
|
|
67
67
|
- - "~>"
|
|
68
68
|
- !ruby/object:Gem::Version
|
|
69
|
-
version: '
|
|
69
|
+
version: '1.0'
|
|
70
70
|
- !ruby/object:Gem::Dependency
|
|
71
71
|
name: rspec
|
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -81,7 +81,7 @@ dependencies:
|
|
|
81
81
|
- - "~>"
|
|
82
82
|
- !ruby/object:Gem::Version
|
|
83
83
|
version: '3.5'
|
|
84
|
-
description: Ruby gem for file managment and sharing in owncloud
|
|
84
|
+
description: Ruby gem for file managment and sharing in nextcloud/owncloud
|
|
85
85
|
email: laboratories@toptranslation.com
|
|
86
86
|
executables: []
|
|
87
87
|
extensions: []
|
|
@@ -117,5 +117,5 @@ rubyforge_project:
|
|
|
117
117
|
rubygems_version: 2.5.1
|
|
118
118
|
signing_key:
|
|
119
119
|
specification_version: 4
|
|
120
|
-
summary: Ocman - Manages files and shares in owncloud
|
|
120
|
+
summary: Ocman - Manages files and shares in nextcloud/owncloud
|
|
121
121
|
test_files: []
|