sfrest 0.0.46 → 0.0.48
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 +4 -4
- data/lib/sfrest/group.rb +1 -2
- data/lib/sfrest/stage.rb +2 -2
- data/lib/sfrest/task.rb +11 -1
- data/lib/sfrest/theme.rb +2 -0
- data/lib/sfrest/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d38168ced43804e889671f1c50c6c70cf55d21963f86a756651afd1c8436108c
|
4
|
+
data.tar.gz: 5bc2f1e86adf416232eeeea83e33b21eb451c782790a7cb3691a113ab47d322a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2382ca986e5667d3c33f28aa57826807d6e41f94bb5bcccc627e47e2039ae182312ffe7af8a6c16d242d3e532d3729c744484c12574c9b2c4c5ffed8454bb45c
|
7
|
+
data.tar.gz: 671f3259df03c914f183fef09b22de7546668dff2df521586ba1b7ee8d5c5f062bf98d679755f2ef3c7c1f2eabf47546b35e066880420f723d5c4e7bce863ae0
|
data/lib/sfrest/group.rb
CHANGED
@@ -143,8 +143,7 @@ module SFRest
|
|
143
143
|
# @return [Integer] the id of groupname
|
144
144
|
def get_group_id(groupname)
|
145
145
|
res = group_list
|
146
|
-
|
147
|
-
return id if id
|
146
|
+
group_data_from_results(res, groupname, 'group_id')
|
148
147
|
end
|
149
148
|
|
150
149
|
# Extract the group data for 'key' based on the site result object
|
data/lib/sfrest/stage.rb
CHANGED
@@ -15,7 +15,7 @@ module SFRest
|
|
15
15
|
# @param [Boolean] skip_gardener skip staging the gardener and only stage the sites
|
16
16
|
#
|
17
17
|
# @return [Integer] Id of the staging task created.
|
18
|
-
# rubocop: disable Style/OptionalBooleanParameter
|
18
|
+
# rubocop: disable Style/OptionalBooleanParameter, Metrics/ParameterLists
|
19
19
|
def stage(to_env = 'test', sites = nil, email_site_status = false, skip_gardener = false)
|
20
20
|
raise InvalidApiVersion, staging_versions unless staging_versions.include? 1
|
21
21
|
|
@@ -24,7 +24,7 @@ module SFRest
|
|
24
24
|
'skip_gardener' => skip_gardener }.to_json
|
25
25
|
@conn.post('/api/v1/stage', payload)
|
26
26
|
end
|
27
|
-
# rubocop: enable Style/OptionalBooleanParameter
|
27
|
+
# rubocop: enable Style/OptionalBooleanParameter, Metrics/ParameterLists
|
28
28
|
|
29
29
|
# Stage a site using the new method
|
30
30
|
# @param [String] to_env the name of of target env. defaults to test
|
data/lib/sfrest/task.rb
CHANGED
@@ -147,7 +147,9 @@ module SFRest
|
|
147
147
|
# @param [Integer] status Integerish the status of the task
|
148
148
|
# see SFRest::Task::STATUS_*
|
149
149
|
# @return [Array[Integer]]
|
150
|
+
# rubocop:disable Metrics/ParameterLists
|
150
151
|
def find_task_ids(limit = nil, page = nil, group = nil, klass = nil, status = nil)
|
152
|
+
# rubocop:enable Metrics/ParameterLists
|
151
153
|
res = find_tasks limit: limit, page: page, group: group, klass: klass, status: status
|
152
154
|
task_ids = []
|
153
155
|
i = 0
|
@@ -172,6 +174,14 @@ module SFRest
|
|
172
174
|
@conn.get URI.parse(pb.build_url_query(current_path, datum)).to_s
|
173
175
|
end
|
174
176
|
|
177
|
+
# Retrieve a specific task by ID.
|
178
|
+
# @param [Integer] task_id The ID of the task to retrieve.
|
179
|
+
# @return [Hash] The task information.
|
180
|
+
def find_task(task_id)
|
181
|
+
current_path = "/api/v1/tasks/#{task_id}"
|
182
|
+
@conn.get(current_path)
|
183
|
+
end
|
184
|
+
|
175
185
|
# Looks for a task with a specific name
|
176
186
|
# @param [String] name display name of the task
|
177
187
|
# @param [String] group task group filter
|
@@ -295,7 +305,7 @@ module SFRest
|
|
295
305
|
def wait_until_state(task_id, state, max_nap)
|
296
306
|
blink_time = 5 # wake up and scan
|
297
307
|
nap_start = Time.now
|
298
|
-
state_method = method("task_#{state}?"
|
308
|
+
state_method = method(:"task_#{state}?")
|
299
309
|
loop do
|
300
310
|
break if state_method.call(task_id)
|
301
311
|
raise TaskNotDoneError, "Task: #{task_id} has taken too long to complete!" if Time.new > (nap_start + max_nap)
|
data/lib/sfrest/theme.rb
CHANGED
@@ -9,7 +9,9 @@ module SFRest
|
|
9
9
|
end
|
10
10
|
|
11
11
|
# Sends a theme notification.
|
12
|
+
# rubocop:disable Metrics/ParameterLists
|
12
13
|
def send_theme_notification(scope = 'site', event = 'modify', nid = 0, theme = '')
|
14
|
+
# rubocop:enable Metrics/ParameterLists
|
13
15
|
current_path = '/api/v1/theme/notification'
|
14
16
|
payload = { 'scope' => scope, 'event' => event, 'nid' => nid, 'theme' => theme }.to_json
|
15
17
|
@conn.post(current_path, payload)
|
data/lib/sfrest/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sfrest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.48
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ACSF Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '0'
|
151
151
|
requirements: []
|
152
|
-
rubygems_version: 3.3.
|
152
|
+
rubygems_version: 3.0.3.1
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: Acquia Site Factory Rest API.
|