discourse_theme 0.3.1 → 0.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffb98d3753bcab52a2596dfa6923d790aa30ed28a20a7c6a8cd9f5b0bbf20507
4
- data.tar.gz: 8e38ee9da80ea2a4ed63a9b4d9e57b48a20d85af3e196275026b94da7a8d308a
3
+ metadata.gz: 1ef711d0d73bc44d77980d883fd0ae32ce4cf14a71aa28f8e1d81ec0ec6f077b
4
+ data.tar.gz: b63d4ce664f8c5243fc413d3eba9222502b52565d5f183b8154f747955ee1ded
5
5
  SHA512:
6
- metadata.gz: 3bb47c55cd4b039c6393428f099e79e1862aed8727edf1441506fd9d07028210f081b0e33fa3c3b7b987519aebc4dd34b646eb02586dcf1b305d0a967f11dbe8
7
- data.tar.gz: 54f88f3057aa2e1935a07cfac8641defa0d77e6abfc446f5793e46450d853169b01c022624605f9db4d41eec7f85412a6419746d7da807403fbc6345dba1ed61
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?api_key=#{@api_key}"
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?api_key=#{@api_key}"
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}?api_key=#{@api_key}"
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?api_key=#{@api_key}"
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
 
@@ -1,3 +1,3 @@
1
1
  module DiscourseTheme
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
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.1
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-10-04 00:00:00.000000000 Z
11
+ date: 2019-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler