restful-sharepoint 0.2.5 → 0.2.6
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/restful-sharepoint/connection.rb +6 -5
- data/lib/restful-sharepoint/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2e6bddfc8e8eb4afad9644e4fceb24043d312e04341485462de992153c49cdc
|
4
|
+
data.tar.gz: d476fd5cee073d7b86a966716898ffbd0dd510bca811997d9f93c8d46a45d53e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d51978834840b49ea49236b599393d6199a1292ea04eb32e3931a9f69c9d8c645cb50e6776306f70ed3db08297989ce0bd2426ab018f8798422d2d9f81a5674e
|
7
|
+
data.tar.gz: b668f5b57dad92a36aad569443216783d061fb34750ecafe9afe7524b306e65bbf55d7116882a14e7ae9a4c982c1876334ac146ff54636e12a4b3b08c25f1fdf
|
@@ -9,6 +9,10 @@ module RestfulSharePoint
|
|
9
9
|
@username = username
|
10
10
|
@password = password
|
11
11
|
@debug = debug
|
12
|
+
|
13
|
+
@httpclient = HTTPClient.new
|
14
|
+
@httpclient.set_auth(nil, @username, @password) if @username
|
15
|
+
@httpclient.ssl_config.set_default_paths
|
12
16
|
end
|
13
17
|
|
14
18
|
attr_reader :site_url
|
@@ -27,10 +31,7 @@ module RestfulSharePoint
|
|
27
31
|
url = URI.parse(path).is_a?(URI::HTTP) ? path : "#{@site_url}#{path}"
|
28
32
|
options_str = options.map { |k,v| "$#{k}=#{CGI.escape v.to_s}" }.join('&')
|
29
33
|
url += "?#{options_str}"
|
30
|
-
|
31
|
-
httpclient = HTTPClient.new
|
32
|
-
httpclient.set_auth(nil, @username, @password) if @username
|
33
|
-
httpclient.ssl_config.set_default_paths
|
34
|
+
|
34
35
|
headers = {'accept' => 'application/json; odata=verbose'}
|
35
36
|
if body
|
36
37
|
body = JSON.dump(body).gsub('/', '\\/') # SharePoint requires forward slashes be escaped in JSON (WTF!!!)
|
@@ -40,7 +41,7 @@ module RestfulSharePoint
|
|
40
41
|
end
|
41
42
|
|
42
43
|
LOG.info "Making HTTP request to: #{url}"
|
43
|
-
response = httpclient.request(method, url, nil, body, headers)
|
44
|
+
response = @httpclient.request(method, url, nil, body, headers)
|
44
45
|
|
45
46
|
if response.body.empty?
|
46
47
|
if response.code >= 300
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restful-sharepoint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Wardrop
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|