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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7c3089a14ab003da825c324f48c4e5566e1aed291697620497356a73dd1570d
4
- data.tar.gz: 1435a6839f32c63347f98c7b7a0e287d9505242cd5b7a9b0aefdfa7bae4c5c9b
3
+ metadata.gz: d38168ced43804e889671f1c50c6c70cf55d21963f86a756651afd1c8436108c
4
+ data.tar.gz: 5bc2f1e86adf416232eeeea83e33b21eb451c782790a7cb3691a113ab47d322a
5
5
  SHA512:
6
- metadata.gz: 840a9efdf45a6e4fd89c7961a58200d3af33a4e8dac09cb6ba3189f5a963cc33ee96979146a7702880034d98a448f4d1a9fc578f656c908ac0d0a34f7e8ce184
7
- data.tar.gz: ac0f053e2777687b0580b972ef10d83e8bbc3dbb7988b3915043111701773c70e8df5189f958bc8813ac078bb2d7689b38e6d8563f3afd84331091b08abfc669
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
- id = group_data_from_results(res, groupname, 'group_id')
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}?".to_sym)
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)
@@ -2,5 +2,5 @@
2
2
 
3
3
  module SFRest
4
4
  # Just tracks the version of sfrest.
5
- VERSION = '0.0.46'
5
+ VERSION = '0.0.48'
6
6
  end
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.46
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: 2023-02-27 00:00:00.000000000 Z
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.12
152
+ rubygems_version: 3.0.3.1
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: Acquia Site Factory Rest API.