ruby-fiix-cmms-client 0.1.0 → 0.1.1
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/ruby/fiix/cmms/client/api_client.rb +12 -6
- data/lib/ruby/fiix/cmms/client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 85d93105c64e8d17809da0de80ba5113b108fa85db720633ab0c47570d463be5
|
|
4
|
+
data.tar.gz: b93b7c6cd2b7cb56f680d08e270427515afc0e7ac0bb6d31529ddc858693cd7a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 34e93a0578c2059165477ac8a61c0e6b7307a6661380d2090f51dc680654b34e372594499a5365dc6a4311f32a2ff84a37138194b31415847ea98afa9edc88ac
|
|
7
|
+
data.tar.gz: 04f2f8b3a0c94945a229bbac2da2f0bd5f06d5d8d5aad376e810d4d8a3123f0d13af4a1f1b5b7fd7e0d8c8a6c8c9ed0bfb670d4ce7b9c176224cc801c429b93c
|
|
@@ -47,7 +47,13 @@ module Ruby
|
|
|
47
47
|
def upload_file(context)
|
|
48
48
|
normalized = normalize_context(context)
|
|
49
49
|
file = normalized.delete("file")
|
|
50
|
-
|
|
50
|
+
|
|
51
|
+
# Build the JSON payload with _maCn and clientVersion, same as regular requests
|
|
52
|
+
payload = { "_maCn" => "AddRequest" }
|
|
53
|
+
.merge(DEFAULT_CLIENT_VERSION)
|
|
54
|
+
.merge(normalized)
|
|
55
|
+
|
|
56
|
+
multipart_request(payload, file)
|
|
51
57
|
end
|
|
52
58
|
|
|
53
59
|
private
|
|
@@ -101,11 +107,11 @@ module Ruby
|
|
|
101
107
|
def build_multipart_body(params, file, boundary)
|
|
102
108
|
parts = []
|
|
103
109
|
|
|
104
|
-
params
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
# Send all params as a single JSON field named "data"
|
|
111
|
+
parts << "--#{boundary}\r\n" \
|
|
112
|
+
"Content-Disposition: form-data; name=\"data\"\r\n" \
|
|
113
|
+
"Content-Type: text/plain;charset=utf-8\r\n\r\n" \
|
|
114
|
+
"#{JSON.generate(params)}\r\n"
|
|
109
115
|
|
|
110
116
|
if file
|
|
111
117
|
filename = file.respond_to?(:path) ? File.basename(file.path) : "upload"
|