gitlab_support_readiness 1.0.14 → 1.0.16

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: 040cceb4e53838dc33cb011e6d0163e7d513c01ae5f23d960fda05b3834b6f80
4
- data.tar.gz: 48b1fbc4f2cdd9b4df38b830c56caec822217f13f99fe15afef007382ed000d3
3
+ metadata.gz: e4bdb4e9a13ea79e33f2ec07cd451c6159c45356fcdeaba423b173e670207fd9
4
+ data.tar.gz: 2a9bdcfb6843924a044e63e6bf222051d75c7e4d0f54937cb0c44f3bf8239c67
5
5
  SHA512:
6
- metadata.gz: 4537f6217a3ed63769dc1a169645149f953b50e1b89cb738c8c840637d7de97d239d189eb0ec55575a8bd8e03d8e5edc11f5a75b9cc1cf7f3232c004de886012
7
- data.tar.gz: 73d03554d595711e854bd6c2666f9f275acc657b5713347c3f88be08c1319e67d097d67589a89d8aa50e0b86e22e8ecd2ab683d2d350b1ab4b537a9c6883ef37
6
+ metadata.gz: 59eb6f95cd01d36c54e0fafcb81cffc19d03d4fd464402b9b9c06db9b977b4389c915c6b17ff63da1a67cbc4bdbe8887cc86859ee58e943edd0821b2747a86a4
7
+ data.tar.gz: 3ee424e0a89f9269cbcac9b0a60a5e7fda16c4001ebc66810451c772e9d32648cebf12a2328fc9b4cc636169f25dba597dd736adfe00f821f3f5f992d190f58d
@@ -174,12 +174,28 @@ module Readiness
174
174
  # @param object [Hash]
175
175
  # @return [String]
176
176
  def self.markdown_to_html(object)
177
- markdown = File.readlines("#{@location}/managed_content/pages/#{object['content_path']}")
177
+ markdown = File.readlines(path_from_instance(object))
178
178
  body = replace_internal_links(markdown, object)
179
179
  html = Readiness::GitLab::Markdown.convert(@gl_client, body, true, 'gitlab-com/support/support-pages' )
180
180
  data_object_dom(object) + html
181
181
  end
182
182
 
183
+ ##
184
+ # Determines the path based off the instance and object information
185
+ #
186
+ # @author Jason Colyer
187
+ # @since 1.0.15
188
+ # @param object [Hash]
189
+ # @return [String]
190
+ def self.path_from_instance(object)
191
+ return "#{@location}/managed_content/support-pages/#{object['content_path']}" if @instance == 'Global' && object['section_id'] == 360004459140
192
+ return "#{@location}/managed_content/knowledge-base/#{object['content_path']}" if @instance == 'Global' && object['section_id'] == 15215649512604
193
+ return "#{@location}/managed_content/support-pages/#{object['content_path']}" if @instance == 'US Government' && object['section_id'] == 10593044624020
194
+ return "#{@location}/managed_content/knowledge-base/#{object['content_path']}" if @instance == 'US Government' && object['section_id'] == 29015014994068
195
+
196
+ ''
197
+ end
198
+
183
199
  ##
184
200
  # Returns the data_object_dom String
185
201
  #
@@ -189,7 +205,7 @@ module Readiness
189
205
  # @return [String]
190
206
  def self.data_object_dom(object)
191
207
  <<~STRING
192
- <p id="data_object_dom" style="display: none;" data-path="pages/#{object['content_path']}">&nbsp;</p>
208
+ <p id="data_object_dom" style="display: none;" data-path="#{path_from_instance(object)}">&nbsp;</p>
193
209
  STRING
194
210
  end
195
211
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_support_readiness
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.14
4
+ version: 1.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Colyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-15 00:00:00.000000000 Z
11
+ date: 2024-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport