gitlab_support_readiness 1.0.13 → 1.0.15

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: 8ea6f1d80c924ce2c4c9f4cb929873f6244376d783f507b71f42c2abc39a4943
4
- data.tar.gz: 1f1902a265ada7bac8aad9b3183f068fb80cf7e0f841e92b9ef408ccc7cdef30
3
+ metadata.gz: cf9c83725418f6c7404ca2fe4ec2422cf73be0ada3076d4e2d8ea0f876f4a128
4
+ data.tar.gz: 6df0cda8a6614f87dfffc7e11e574ec53394eaff5ef675c07edffe526378027a
5
5
  SHA512:
6
- metadata.gz: 6d8e2f831f94c90507f758dd744c4e8e84f4a7eb0041a763059b7a212d8a2e5a892a5f62ff692312a710c17b018ddc811be533dbdfb1c9a147779210e9327aac
7
- data.tar.gz: 893eab1474c5eecdfcf18aa18cf6c6426e05e43e0ed8781f6dcf9107fecbc301277547f7b4aafe2f00bb02fa673135f72e0df0cdcd0df4c6ff03337236ab626d
6
+ metadata.gz: c9b8bc33f8fdff1a47dc87f678428c8376e5adf8c21696a36aa757e2d690957d90e89b8e92ad2ee94ce7eeb73182c52df5458d114b07ed833f63a18d71087dfa
7
+ data.tar.gz: 2cac360672478f0dba339d7593efd777bbaab738921049ac4bce8c7e80d9882062bd76a416863ad66d6897efeb39e7c8156370396ac24cc1e6c23538c207a5e0
@@ -79,7 +79,7 @@ module Readiness
79
79
  # jobs = Readiness::GitLab::Jobs.list_project(client, project, 2)
80
80
  # puts jobs.count
81
81
  # # => 200
82
- def list_project(client, project, limit = 0, filters = [])
82
+ def self.list_project(client, project, limit = 0, filters = [])
83
83
  array = []
84
84
  page = 1
85
85
  loop do
@@ -117,7 +117,7 @@ module Readiness
117
117
  # jobs = Readiness::GitLab::Jobs.list_pipeline(client, pipeline, 1)
118
118
  # puts jobs.count
119
119
  # # => 100
120
- def list_pipeline(client, pipeline, limit = 0, filters = [])
120
+ def self.list_pipeline(client, pipeline, limit = 0, filters = [])
121
121
  array = []
122
122
  page = 1
123
123
  loop do
@@ -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
  #
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.13
4
+ version: 1.0.15
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