ruby-office365 0.1.7 → 0.1.8
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/Gemfile.lock +1 -1
- data/lib/office365/rest/concerns/base.rb +1 -1
- data/lib/office365/rest/request.rb +1 -1
- data/lib/office365/rest/token.rb +1 -1
- data/lib/office365/utils/hash.rb +14 -0
- data/lib/office365/utils.rb +1 -1
- data/lib/office365/version.rb +1 -1
- metadata +3 -3
- data/lib/office365/utils/to_query.rb +0 -89
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d51b843c237dae5d0af62db257a4ae5889d03e00b62fdce26f679717139a9fe6
|
4
|
+
data.tar.gz: 1cdb8e3c0229f929acd5354fcea731253c7535e57fbe355cc2ee816ef54597a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b970531fc4df3e763a6b15a997e3bf0557e3e0b08772eb1d5fe4b37d17bdde9c78d95f8bd3729b2764f0a8378aa4ccd9baa56ce7abae5f35d5e21a4259fcf1c5
|
7
|
+
data.tar.gz: 9ad0c123acddf7965596ccd0be7ff1a0ffb710f1f665cbda60c52a6f6d4ef94641818d0404e9bd6a9b33bb1d5d15a0e43d7c36f5c7418b2a074db01d93d43fab
|
data/Gemfile.lock
CHANGED
@@ -48,7 +48,7 @@ module Office365
|
|
48
48
|
args[:orderby] = order_by if order_by
|
49
49
|
|
50
50
|
request_uri = ["/", Office365::API_VERSION, base_uri].join
|
51
|
-
request_uri += ["?", args.
|
51
|
+
request_uri += ["?", args.ms_hash_to_query].join if args.any?
|
52
52
|
request_uri
|
53
53
|
end
|
54
54
|
end
|
@@ -34,7 +34,7 @@ module Office365
|
|
34
34
|
faraday.adapter Faraday.default_adapter
|
35
35
|
faraday.response :json
|
36
36
|
faraday.response :logger, ::Logger.new($stdout), bodies: true if dev_developement?
|
37
|
-
end.post(req_url.request_uri, args.
|
37
|
+
end.post(req_url.request_uri, args.ms_hash_to_query)
|
38
38
|
|
39
39
|
parse_respond(response)
|
40
40
|
end
|
data/lib/office365/rest/token.rb
CHANGED
data/lib/office365/utils.rb
CHANGED
data/lib/office365/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-office365
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Encore Shao
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -135,8 +135,8 @@ files:
|
|
135
135
|
- lib/office365/rest/token.rb
|
136
136
|
- lib/office365/rest/user.rb
|
137
137
|
- lib/office365/utils.rb
|
138
|
+
- lib/office365/utils/hash.rb
|
138
139
|
- lib/office365/utils/string.rb
|
139
|
-
- lib/office365/utils/to_query.rb
|
140
140
|
- lib/office365/version.rb
|
141
141
|
- ruby-office365.gemspec
|
142
142
|
- sig/office365.rbs
|
@@ -1,89 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "cgi"
|
4
|
-
|
5
|
-
class Object
|
6
|
-
# Alias of <tt>to_s</tt>.
|
7
|
-
def to_param
|
8
|
-
to_s
|
9
|
-
end
|
10
|
-
|
11
|
-
# Converts an object into a string suitable for use as a URL query string,
|
12
|
-
# using the given <tt>key</tt> as the param name.
|
13
|
-
def to_query(key)
|
14
|
-
"$#{CGI.escape(key.to_param)}=#{CGI.escape(to_param.to_s)}"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
class NilClass
|
19
|
-
# Returns +self+.
|
20
|
-
def to_param
|
21
|
-
self
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
class TrueClass
|
26
|
-
# Returns +self+.
|
27
|
-
def to_param
|
28
|
-
self
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
class FalseClass
|
33
|
-
# Returns +self+.
|
34
|
-
def to_param
|
35
|
-
self
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
class Array
|
40
|
-
# Calls <tt>to_param</tt> on all its elements and joins the result with
|
41
|
-
# slashes. This is used by <tt>url_for</tt> in Action Pack.
|
42
|
-
def to_param
|
43
|
-
collect(&:to_param).join "/"
|
44
|
-
end
|
45
|
-
|
46
|
-
# Converts an array into a string suitable for use as a URL query string,
|
47
|
-
# using the given +key+ as the param name.
|
48
|
-
#
|
49
|
-
# ['Rails', 'coding'].to_query('hobbies') # => "hobbies%5B%5D=Rails&hobbies%5B%5D=coding"
|
50
|
-
def to_query(key)
|
51
|
-
prefix = "#{key}[]"
|
52
|
-
|
53
|
-
if empty?
|
54
|
-
nil.to_query(prefix)
|
55
|
-
else
|
56
|
-
collect { |value| value.to_query(prefix) }.join "&"
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
class Hash
|
62
|
-
# Returns a string representation of the receiver suitable for use as a URL
|
63
|
-
# query string:
|
64
|
-
#
|
65
|
-
# {name: 'David', nationality: 'Danish'}.to_query
|
66
|
-
# # => "name=David&nationality=Danish"
|
67
|
-
#
|
68
|
-
# An optional namespace can be passed to enclose key names:
|
69
|
-
#
|
70
|
-
# {name: 'David', nationality: 'Danish'}.to_query('user')
|
71
|
-
# # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish"
|
72
|
-
#
|
73
|
-
# The string pairs "key=value" that conform the query string
|
74
|
-
# are sorted lexicographically in ascending order.
|
75
|
-
#
|
76
|
-
# This method is also aliased as +to_param+.
|
77
|
-
def to_query(namespace = nil)
|
78
|
-
query = collect do |key, value|
|
79
|
-
unless (value.is_a?(Hash) || value.is_a?(Array)) && value.empty?
|
80
|
-
value.to_query(namespace ? "#{namespace}[#{key}]" : key)
|
81
|
-
end
|
82
|
-
end.compact
|
83
|
-
|
84
|
-
query.sort! unless namespace.to_s.include?("[]")
|
85
|
-
query.join("&")
|
86
|
-
end
|
87
|
-
|
88
|
-
alias to_param to_query
|
89
|
-
end
|