discourse_plugin_statistics 0.1.0.pre3 → 0.1.0.pre4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ecea4649c6e62e7a516377d370b3c3eb46880c8732b1c8d03e5f3b2c05e1de4
|
4
|
+
data.tar.gz: c81cd9627a8935c9b9fbbff145e49171f20465776c736c32bfb0d11770000c87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9e5edc1aa1add98a8348b42e3c532832814ee6b96ea327de04abfa770f8ca95b4f83323e6be3f61e64e361ea1ca2e6415301eb717a84c2156742d00be6b72f6
|
7
|
+
data.tar.gz: '079f5357ab3e37b2b6923fa6b122ad2d77e20cae5e5a08a551bc526009754f0c90b4e6c10e55027331ded6ed4345503342a30b724887bc5722c66a13df26c131'
|
@@ -9,19 +9,32 @@ module DiscoursePluginStatistics
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def update
|
12
|
+
body = {
|
13
|
+
discourse: discourse,
|
14
|
+
plugins: plugins
|
15
|
+
}.to_json
|
16
|
+
|
17
|
+
response = request(body)
|
18
|
+
|
19
|
+
if response && [301, 302, 303].include?(response[:status])
|
20
|
+
location = response[:headers]["Location"]
|
21
|
+
response = request(body, location) if location
|
22
|
+
end
|
23
|
+
|
24
|
+
response
|
25
|
+
end
|
26
|
+
|
27
|
+
protected
|
28
|
+
|
29
|
+
def request(body, url = nil)
|
12
30
|
::Excon.post(
|
13
|
-
DiscoursePluginStatistics.server_url,
|
31
|
+
url || DiscoursePluginStatistics.server_url,
|
14
32
|
headers: { "Content-Type" => "application/json" },
|
15
|
-
body:
|
16
|
-
discourse: discourse,
|
17
|
-
plugins: plugins
|
18
|
-
}.to_json
|
33
|
+
body: body
|
19
34
|
)
|
20
35
|
rescue Excon::Error
|
21
36
|
end
|
22
37
|
|
23
|
-
protected
|
24
|
-
|
25
38
|
def discourse
|
26
39
|
@discourse ||= DiscoursePluginStatistics::Discourse.new.json
|
27
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: discourse_plugin_statistics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.pre4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Angus McLeod
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|