discourse_theme 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/discourse_theme/client.rb +7 -11
- data/lib/discourse_theme/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: 1ef711d0d73bc44d77980d883fd0ae32ce4cf14a71aa28f8e1d81ec0ec6f077b
|
4
|
+
data.tar.gz: b63d4ce664f8c5243fc413d3eba9222502b52565d5f183b8154f747955ee1ded
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c5af4afa4206257a58e3957533c47c5205454e465def3377e193fd46bb672882b5e761285e16394c0253ba873802c39072c213fabaeab4d658ad777f8b805ee
|
7
|
+
data.tar.gz: 4e1872e14d330163a2bd23316d66593f5786e00e99689546ef3196513b066638d94ccec1519117e99e097e1b9f6534932da2f291837ebe105476765f738b2007
|
@@ -44,7 +44,7 @@ module DiscourseTheme
|
|
44
44
|
if @is_theme_creator
|
45
45
|
"/user_themes.json"
|
46
46
|
else
|
47
|
-
"/admin/customize/themes.json
|
47
|
+
"/admin/customize/themes.json"
|
48
48
|
end
|
49
49
|
|
50
50
|
response = request(Net::HTTP::Get.new(endpoint), never_404: true)
|
@@ -57,7 +57,7 @@ module DiscourseTheme
|
|
57
57
|
if @is_theme_creator
|
58
58
|
"/user_themes/#{id}/export"
|
59
59
|
else
|
60
|
-
"/admin/customize/themes/#{id}/export
|
60
|
+
"/admin/customize/themes/#{id}/export"
|
61
61
|
end
|
62
62
|
|
63
63
|
response = request(Net::HTTP::Get.new endpoint)
|
@@ -71,7 +71,7 @@ module DiscourseTheme
|
|
71
71
|
if @is_theme_creator
|
72
72
|
"/user_themes/#{id}"
|
73
73
|
else
|
74
|
-
"/admin/themes/#{id}
|
74
|
+
"/admin/themes/#{id}"
|
75
75
|
end
|
76
76
|
|
77
77
|
put = Net::HTTP::Put.new(endpoint, 'Content-Type' => 'application/json')
|
@@ -84,7 +84,7 @@ module DiscourseTheme
|
|
84
84
|
if @is_theme_creator
|
85
85
|
"/user_themes/import.json"
|
86
86
|
else
|
87
|
-
"/admin/themes/import.json
|
87
|
+
"/admin/themes/import.json"
|
88
88
|
end
|
89
89
|
|
90
90
|
post = Net::HTTP::Post::Multipart.new(
|
@@ -96,13 +96,7 @@ module DiscourseTheme
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def discourse_version
|
99
|
-
endpoint = root
|
100
|
-
if @is_theme_creator
|
101
|
-
"/about.json"
|
102
|
-
else
|
103
|
-
"/about.json?api_key=#{@api_key}"
|
104
|
-
end
|
105
|
-
|
99
|
+
endpoint = "#{root}/about.json"
|
106
100
|
response = request(Net::HTTP::Get.new(endpoint), never_404: true)
|
107
101
|
json = JSON.parse(response.body)
|
108
102
|
json["about"]["version"]
|
@@ -134,6 +128,8 @@ module DiscourseTheme
|
|
134
128
|
def add_headers(request)
|
135
129
|
if @is_theme_creator
|
136
130
|
request["User-Api-Key"] = @api_key
|
131
|
+
else
|
132
|
+
request["Api-Key"] = @api_key
|
137
133
|
end
|
138
134
|
end
|
139
135
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: discourse_theme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|