ruby-jss 2.0.0 → 2.1.0b5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,83 +1,65 @@
1
- ### Copyright 2022 Pixar
2
-
3
- ###
4
- ### Licensed under the Apache License, Version 2.0 (the "Apache License")
5
- ### with the following modification; you may not use this file except in
6
- ### compliance with the Apache License and the following modification to it:
7
- ### Section 6. Trademarks. is deleted and replaced with:
8
- ###
9
- ### 6. Trademarks. This License does not grant permission to use the trade
10
- ### names, trademarks, service marks, or product names of the Licensor
11
- ### and its affiliates, except as required to comply with Section 4(c) of
12
- ### the License and to reproduce the content of the NOTICE file.
13
- ###
14
- ### You may obtain a copy of the Apache License at
15
- ###
16
- ### http://www.apache.org/licenses/LICENSE-2.0
17
- ###
18
- ### Unless required by applicable law or agreed to in writing, software
19
- ### distributed under the Apache License with the above modification is
20
- ### distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21
- ### KIND, either express or implied. See the Apache License for the specific
22
- ### language governing permissions and limitations under the Apache License.
23
- ###
24
- ###
25
-
26
- ###
27
- module Jamf
28
-
29
- #####################################
30
- ### Module Constants
31
- #####################################
1
+ # Copyright 2022 Pixar
2
+
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "Apache License")
5
+ # with the following modification; you may not use this file except in
6
+ # compliance with the Apache License and the following modification to it:
7
+ # Section 6. Trademarks. is deleted and replaced with:
8
+ #
9
+ # 6. Trademarks. This License does not grant permission to use the trade
10
+ # names, trademarks, service marks, or product names of the Licensor
11
+ # and its affiliates, except as required to comply with Section 4(c) of
12
+ # the License and to reproduce the content of the NOTICE file.
13
+ #
14
+ # You may obtain a copy of the Apache License at
15
+ #
16
+ # http://www.apache.org/licenses/LICENSE-2.0
17
+ #
18
+ # Unless required by applicable law or agreed to in writing, software
19
+ # distributed under the Apache License with the above modification is
20
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21
+ # KIND, either express or implied. See the Apache License for the specific
22
+ # language governing permissions and limitations under the Apache License.
23
+ #
24
+ #
32
25
 
33
- #####################################
34
- ### Module Variables
35
- #####################################
36
-
37
- #####################################
38
- ### Module Methods
39
- #####################################
26
+ module Jamf
40
27
 
41
- #####################################
42
- ### Classes
28
+ # Classes
43
29
  #####################################
44
30
 
45
- ###
46
- ### A computer group in the JSS
47
- ###
48
- ### See also the parent class Jamf::Group
49
- ###
50
- ### @see Jamf::APIObject
51
- ###
52
- ### @see Jamf::Group
53
- ###
31
+
32
+ # A computer group in the JSS
33
+ #
34
+ # See also the parent class Jamf::Group
35
+ #
36
+ # @see Jamf::APIObject
37
+ #
38
+ # @see Jamf::Group
39
+ #
54
40
  class ComputerGroup < Jamf::Group
55
41
 
56
- #####################################
57
- ### Mix-Ins
42
+
43
+ # Mix-Ins
58
44
  #####################################
59
45
  include Jamf::MDM
60
46
  include Jamf::MacOSManagedUpdates
47
+ include Jamf::MacOSRedeployMgmtFramework
61
48
 
62
- #####################################
63
- ### Class Methods
64
- #####################################
65
-
66
- #####################################
67
- ### Class Constants
49
+ # Class Constants
68
50
  #####################################
69
51
 
70
- ### The base for REST resources of this class
71
- RSRC_BASE = "computergroups"
52
+ # The base for REST resources of this class
53
+ RSRC_BASE = 'computergroups'
72
54
 
73
- ### the hash key used for the JSON list output of all objects in the JSS
55
+ # the hash key used for the JSON list output of all objects in the JSS
74
56
  RSRC_LIST_KEY = :computer_groups
75
57
 
76
- ### The hash key used for the JSON object output.
77
- ### It's also used in various error messages
58
+ # The hash key used for the JSON object output.
59
+ # It's also used in various error messages
78
60
  RSRC_OBJECT_KEY = :computer_group
79
61
 
80
- ### this allows the parent Group class to do things right
62
+ # this allows the parent Group class to do things right
81
63
  MEMBER_CLASS = Jamf::Computer
82
64
 
83
65
  # the XML element for immediate member additions via PUT
@@ -94,45 +76,27 @@ module Jamf
94
76
  # what kind of devices are these WRT MDM
95
77
  MDM_COMMAND_TARGET = :computergroups
96
78
 
97
- #####################################
98
- ### Class Variables
99
- #####################################
100
-
101
- #####################################
102
- ### Class Methods
103
- #####################################
104
-
105
- #####################################
106
- ### Attributes
79
+ # Public Instance Methods
107
80
  #####################################
108
81
 
109
- #####################################
110
- ### Public Instance Methods
111
- #####################################
112
-
113
-
114
- ###
115
- ### The serial numbers of members in this group
116
- ###
117
- ### @return [Array<String>] the member serial numbers
118
- ###
82
+ #
83
+ # The serial numbers of members in this group
84
+ #
85
+ # @return [Array<String>] the member serial numbers
86
+ #
119
87
  def member_serial_numbers
120
- @members.map{|m| m[:serial_number]}
88
+ @members.map { |m| m[:serial_number] }
121
89
  end
122
90
 
123
- ###
124
- ### Return an array of the mac_addrs of members in this group
125
- ###
126
- ### @return [Array<String>] the member mac addresses
127
- ###
91
+ #
92
+ # Return an array of the mac_addrs of members in this group
93
+ #
94
+ # @return [Array<String>] the member mac addresses
95
+ #
128
96
  def member_mac_addresses
129
- @members.map{|m| m[:mac_address]} + @members.map{|m| m[:alt_mac_address]}
97
+ @members.map { |m| m[:mac_address] } + @members.map { |m| m[:alt_mac_address] }
130
98
  end
131
99
 
132
- #####################################
133
- ### Private Instance Methods
134
- #####################################
135
-
136
100
  end # class ComputerGroup
137
101
 
138
102
  end # module
@@ -194,7 +194,7 @@ module Jamf
194
194
  #
195
195
  # See Jamf::APIObject#initialize
196
196
  #
197
- def initialize(args)
197
+ def initialize(**args)
198
198
  super
199
199
  general = @init_data[:general]
200
200
  @display_name = general[:display_name]
@@ -39,7 +39,7 @@ module Jamf
39
39
  # @param cnx [Jamf::Connection] The connection to use, default: Jamf.cnx
40
40
  #
41
41
  # TODO: fix this return value, no more ErrorInfo
42
- # @return [Array<Jamf::Connection::APIError::ErrorInfo] Info about any ids
42
+ # @return [Array<Jamf::Connection::JamfProAPIError::ErrorInfo] Info about any ids
43
43
  # that failed to be deleted.
44
44
  #
45
45
  def bulk_delete(ids, cnx: Jamf.cnx)
@@ -49,7 +49,7 @@ module Jamf
49
49
  begin
50
50
  cnx.post "#{rsrc_path}/#{DELETE_MULTIPLE_ENDPOINT}", request_body
51
51
  []
52
- rescue Jamf::Connection::APIError => e
52
+ rescue Jamf::Connection::JamfProAPIError => e
53
53
  raise e unless e.httpStatus == 400
54
54
 
55
55
  e.errors
@@ -101,12 +101,10 @@ module Jamf
101
101
  #
102
102
  # Classes including CollectionResource really need to define GET_PATH if it
103
103
  # is not the same as the LIST_PATH.
104
- # rubocop:disable Naming/AccessorMethodName
105
104
  ######################################
106
105
  def get_path
107
106
  @get_path ||= defined?(self::GET_PATH) ? self::GET_PATH : self::LIST_PATH
108
107
  end
109
- # rubocop:enable Naming/AccessorMethodName
110
108
 
111
109
  # The path for PUTting (replacing) a single object. The desired object id will
112
110
  # be appended to the end, e.g. if this value is 'v1/buildings' and you want
@@ -570,7 +568,7 @@ module Jamf
570
568
  # @param cnx [Jamf::Connection] The connection to use, default: Jamf.cnx
571
569
  #
572
570
  #
573
- # @return [Array<Jamf::Connection::APIError::ErrorInfo] Info about any ids
571
+ # @return [Array<Jamf::Connection::JamfProAPIError::ErrorInfo] Info about any ids
574
572
  # that failed to be deleted.
575
573
  #
576
574
  ######################################
@@ -156,7 +156,7 @@ module Jamf
156
156
  #
157
157
  # @see MacOSManagedUpdates.send_managed_os_update
158
158
  #
159
- def send_managed_os_update(updateAction:, maxDeferrals: nil, version: nil, skipVersionVerification: false, applyMajorUpdate: false, forceRestart: false, cnx: Jamf.cnx)
159
+ def send_managed_os_update(updateAction:, maxDeferrals: nil, version: nil, skipVersionVerification: false, applyMajorUpdate: false, forceRestart: false)
160
160
  deviceIds = is_a?(Jamf::Computer) ? @id : nil
161
161
  groupId = is_a?(Jamf::Computer) ? nil : @id
162
162
 
@@ -0,0 +1,113 @@
1
+ # Copyright 2022 Pixar
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "Apache License")
4
+ # with the following modification; you may not use this file except in
5
+ # compliance with the Apache License and the following modification to it:
6
+ # Section 6. Trademarks. is deleted and replaced with:
7
+ #
8
+ # 6. Trademarks. This License does not grant permission to use the trade
9
+ # names, trademarks, service marks, or product names of the Licensor
10
+ # and its affiliates, except as required to comply with Section 4(c) of
11
+ # the License and to reproduce the content of the NOTICE file.
12
+ #
13
+ # You may obtain a copy of the Apache License at
14
+ #
15
+ # http://www.apache.org/licenses/LICENSE-2.0
16
+ #
17
+ # Unless required by applicable law or agreed to in writing, software
18
+ # distributed under the Apache License with the above modification is
19
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20
+ # KIND, either express or implied. See the Apache License for the specific
21
+ # language governing permissions and limitations under the Apache License.
22
+ #
23
+ #
24
+
25
+ module Jamf
26
+
27
+ # This module should be mixed in to Jamf::Computer and Jamf::ComputerGroup
28
+ #
29
+ # It provides access to the macos-managed-software-updates JPAPI resource for
30
+ # managed OS update commands to managed macs running Big Sur or higher.
31
+ #
32
+ module MacOSRedeployMgmtFramework
33
+
34
+ # when this module is included, also extend our Class Methods
35
+ def self.included(includer)
36
+ Jamf.load_msg "--> #{includer} is including #{self}"
37
+ includer.extend(ClassMethods)
38
+ end
39
+
40
+ # The JP API resource for redeploying the management framework
41
+ # to a computer. The id will be appended when used.
42
+ REDEPLOY_RSRC = 'v1/jamf-management-framework/redeploy'
43
+
44
+ # Class Methods
45
+ #####################################
46
+ module ClassMethods
47
+
48
+ # when this module is included, also extend our Class Methods
49
+ def self.extended(extender)
50
+ Jamf.load_msg "--> #{extender} is extending #{self}"
51
+ end
52
+
53
+ # Redeploy the Jamf Management framework to target Computers or members of ComputerGroups
54
+ #
55
+ # IMPORTANT: This only re-deploys the Jamf binary and related framework. The MDM system
56
+ # must be functioning. The target computer(s) will not re-install the framework if they
57
+ # never recieve the MDM command.
58
+ #
59
+ # @param target_ids [String, Integer, Array<String, Integer>] Jamf IDs for the
60
+ # Computer or ComputerGroup targets.
61
+ #
62
+ # @param cnx [Jamf::Connection] The API connection to use. Defaults to Jamf.cnx
63
+ #
64
+ # @return [Hash{Integer => String}] The result for each computer, either the
65
+ # uuid of the sent MDM command, or an error message.
66
+ ########################
67
+ def redeploy_mgmt_framework(target_ids, cnx: Jamf.cnx)
68
+ target_ids = target_ids.is_a?(Array) ? target_ids : [target_ids]
69
+ target_comp_ids =
70
+ if self == Jamf::Computer
71
+ target_ids
72
+
73
+ elsif self == Jamf::ComputerGroup
74
+ group_ids = target_ids.is_a?(Array) ? target_ids : [target_ids]
75
+ comp_ids = []
76
+ group_ids.each { |gid| comp_ids += JSS::ComputerGroup.fetch(id: gid).member_ids }
77
+ comp_ids
78
+
79
+ else
80
+ raise Jamf::UnsupportedError, 'This method is only available for Jamf::Computer and Jamf::ComputerGroup'
81
+ end
82
+
83
+ results = {}
84
+
85
+ target_comp_ids.uniq.compact.each do |comp_id|
86
+ result = cnx.jp_post "#{REDEPLOY_RSRC}/#{comp_id}", Jamf::BLANK
87
+
88
+ result = Jamf::OAPISchemas::RedeployJamfManagementFrameworkResponse.new result
89
+ results[comp_id] = result.commandUuid
90
+ rescue Jamf::Connection::JamfProAPIError => e
91
+ results[comp_id] = "ERROR: #{e}"
92
+ end
93
+
94
+ results
95
+ end
96
+
97
+ end # module ClassMethods
98
+
99
+ # Instance Methods
100
+ ######################################
101
+
102
+ # Send a managed update command to an instance of Computer or ComputerGroup.
103
+ # This just calls the class method of the same name.
104
+ #
105
+ # @see MacOSRedeployMgmtFramework.redeploy_mgmt_framework
106
+ #
107
+ def redeploy_mgmt_framework
108
+ self.class.redeploy_mgmt_framework @id, cnx: @cnx
109
+ end
110
+
111
+ end # module MacOSRedeployMgmtFramework
112
+
113
+ end # module Jamf
@@ -79,6 +79,7 @@ module Jamf
79
79
  ### {APIConnection#connect}, or by custom means.
80
80
  ###
81
81
  class Configuration
82
+
82
83
  include Singleton
83
84
 
84
85
  #####################################
@@ -89,31 +90,31 @@ module Jamf
89
90
  ### The first matching file is used - the array provides
90
91
  ### backward compatibility with earlier versions.
91
92
  ### Saving will always happen to the first filename
92
- CONF_FILES = [ "ruby-jss.conf", "jss_gem.conf"]
93
+ CONF_FILES = ['ruby-jss.conf', 'jss_gem.conf']
93
94
 
94
95
  ### The Pathname to the machine-wide preferences plist
95
- GLOBAL_CONFS = CONF_FILES.map{|cf| Pathname.new "/etc/#{cf}"}
96
+ GLOBAL_CONFS = CONF_FILES.map { |cf| Pathname.new "/etc/#{cf}" }
96
97
 
97
98
  ### The Pathname to the user-specific preferences plist
98
- USER_CONFS = CONF_FILES.map{|cf| ENV["HOME"] ? Pathname.new("~/.#{cf}").expand_path : nil }.compact
99
+ USER_CONFS = CONF_FILES.map { |cf| ENV['HOME'] ? Pathname.new("~/.#{cf}").expand_path : nil }.compact
99
100
 
100
101
  ### The attribute keys we maintain, and the type they should be stored as
101
102
  CONF_KEYS = {
102
- :api_server_name => :to_s,
103
- :api_server_port => :to_i,
104
- :api_ssl_version => :to_s,
105
- :api_verify_cert => :jss_to_bool,
106
- :api_username => :to_s,
107
- :api_timeout_open => :to_i,
108
- :api_timeout => :to_i,
109
- :db_server_name => :to_s,
110
- :db_server_port => :to_i,
111
- :db_server_socket => :to_s,
112
- :db_username => :to_s,
113
- :db_name => :to_s,
114
- :db_connect_timeout => :to_i,
115
- :db_read_timeout => :to_i,
116
- :db_write_timeout => :to_i
103
+ api_server_name: :to_s,
104
+ api_server_port: :to_i,
105
+ api_ssl_version: :to_s,
106
+ api_verify_cert: :jss_to_bool,
107
+ api_username: :to_s,
108
+ api_timeout_open: :to_i,
109
+ api_timeout: :to_i,
110
+ db_server_name: :to_s,
111
+ db_server_port: :to_i,
112
+ db_server_socket: :to_s,
113
+ db_username: :to_s,
114
+ db_name: :to_s,
115
+ db_connect_timeout: :to_i,
116
+ db_read_timeout: :to_i,
117
+ db_write_timeout: :to_i
117
118
  }
118
119
 
119
120
  #####################################
@@ -129,8 +130,7 @@ module Jamf
129
130
  #####################################
130
131
 
131
132
  # automatically create accessors for all the CONF_KEYS
132
- CONF_KEYS.keys.each {|k| attr_accessor k}
133
-
133
+ CONF_KEYS.keys.each { |k| attr_accessor k }
134
134
 
135
135
  #####################################
136
136
  ### Constructor
@@ -140,10 +140,8 @@ module Jamf
140
140
  ### Initialize!
141
141
  ###
142
142
  def initialize
143
-
144
143
  read_global
145
144
  read_user
146
-
147
145
  end
148
146
 
149
147
  #####################################
@@ -156,7 +154,7 @@ module Jamf
156
154
  ### @return [void]
157
155
  ###
158
156
  def clear_all
159
- CONF_KEYS.keys.each {|k| self.send "#{k}=".to_sym, nil}
157
+ CONF_KEYS.keys.each { |k| send "#{k}=".to_sym, nil }
160
158
  end
161
159
 
162
160
  ###
@@ -165,12 +163,12 @@ module Jamf
165
163
  ### @return [void]
166
164
  ###
167
165
  def read_global
168
- GLOBAL_CONFS.each { |gcf|
166
+ GLOBAL_CONFS.each do |gcf|
169
167
  if gcf.file? and gcf.readable?
170
168
  read gcf
171
169
  return
172
170
  end
173
- }
171
+ end
174
172
  end
175
173
 
176
174
  ###
@@ -179,15 +177,14 @@ module Jamf
179
177
  ### @return [void]
180
178
  ###
181
179
  def read_user
182
- USER_CONFS.each { |ucf|
180
+ USER_CONFS.each do |ucf|
183
181
  if ucf.file? and ucf.readable?
184
182
  read ucf
185
183
  return
186
184
  end
187
- }
185
+ end
188
186
  end
189
187
 
190
-
191
188
  ###
192
189
  ### Clear the settings and reload the prefs files, or another file if provided
193
190
  ###
@@ -203,10 +200,9 @@ module Jamf
203
200
  end
204
201
  read_global
205
202
  read_user
206
- return true
203
+ true
207
204
  end
208
205
 
209
-
210
206
  ###
211
207
  ### Save the prefs into a file
212
208
  ###
@@ -216,10 +212,10 @@ module Jamf
216
212
  ###
217
213
  def save(file)
218
214
  path = case file
219
- when :global then GLOBAL_CONFS.first
220
- when :user then USER_CONFS.first
221
- else Pathname.new(file)
222
- end
215
+ when :global then GLOBAL_CONFS.first
216
+ when :user then USER_CONFS.first
217
+ else Pathname.new(file)
218
+ end
223
219
 
224
220
  raise Jamf::MissingDataError, "No HOME environment variable, can't write to user conf file." if path.nil?
225
221
 
@@ -229,21 +225,20 @@ module Jamf
229
225
 
230
226
  # go thru the known attributes/keys
231
227
  CONF_KEYS.keys.sort.each do |k|
232
-
233
228
  # if the key exists, update it.
234
229
  if data =~ /^#{k}:/
235
- data.sub!(/^#{k}:.*$/, "#{k}: #{self.send k}")
230
+ data.sub!(/^#{k}:.*$/, "#{k}: #{send k}")
236
231
 
237
232
  # if not, add it to the end unless it's nil
238
233
  else
239
- data += "\n#{k}: #{self.send k}" unless self.send(k).nil?
234
+ data += "\n#{k}: #{send k}" unless send(k).nil?
240
235
  end # if data =~ /^#{k}:/
241
- end #each do |k|
236
+ end # each do |k|
242
237
 
243
238
  else # not readable, make a new file
244
- data = ""
239
+ data = ''
245
240
  CONF_KEYS.keys.sort.each do |k|
246
- data << "#{k}: #{self.send k}\n" unless self.send(k).nil?
241
+ data << "#{k}: #{send k}\n" unless send(k).nil?
247
242
  end
248
243
  end # if path readable
249
244
 
@@ -252,14 +247,13 @@ module Jamf
252
247
  path.jss_save data
253
248
  end # read file
254
249
 
255
-
256
250
  ###
257
251
  ### Print out the current settings to stdout
258
252
  ###
259
253
  ### @return [void]
260
254
  ###
261
255
  def print
262
- CONF_KEYS.keys.sort.each{|k| puts "#{k}: #{self.send k}"}
256
+ CONF_KEYS.keys.sort.each { |k| puts "#{k}: #{send k}" }
263
257
  end
264
258
 
265
259
  #####################################
@@ -275,28 +269,29 @@ module Jamf
275
269
  ### @return [void]
276
270
  ###
277
271
  def read(file)
278
-
279
272
  Pathname.new(file).read.each_line do |line|
280
- # skip blank lines and those starting with #
281
- next if line =~ /^\s*(#|$)/
282
-
283
- line.strip =~ /^(\w+?):\s*(\S.*)$/
284
- next unless $1
285
- attr = $1.to_sym
286
- setter = "#{attr}=".to_sym
287
- value = $2.strip
288
-
289
- if CONF_KEYS.keys.include? attr
290
- if value
291
- # convert the value to the correct class
292
- value = value.send(CONF_KEYS[attr])
293
- end
294
- self.send(setter, value)
295
- end # if
296
- end # do line
273
+ # skip blank lines and those starting with #
274
+ next if line =~ /^\s*(#|$)/
275
+
276
+ line.strip =~ /^(\w+?):\s*(\S.*)$/
277
+ next unless Regexp.last_match(1)
297
278
 
279
+ attr = Regexp.last_match(1).to_sym
280
+ setter = "#{attr}=".to_sym
281
+ value = Regexp.last_match(2).strip
282
+
283
+ next unless CONF_KEYS.keys.include? attr
284
+
285
+ if value
286
+ # convert the value to the correct class
287
+ value = value.send(CONF_KEYS[attr])
288
+ end
289
+ send(setter, value)
290
+ # if
291
+ end # do line
298
292
  end # read file
299
293
 
300
294
  end # class Preferences
301
295
 
296
+
302
297
  end # module
@@ -0,0 +1,28 @@
1
+ ### Copyright 2022 Pixar
2
+
3
+ ###
4
+ ### Licensed under the Apache License, Version 2.0 (the "Apache License")
5
+ ### with the following modification; you may not use this file except in
6
+ ### compliance with the Apache License and the following modification to it:
7
+ ### Section 6. Trademarks. is deleted and replaced with:
8
+ ###
9
+ ### 6. Trademarks. This License does not grant permission to use the trade
10
+ ### names, trademarks, service marks, or product names of the Licensor
11
+ ### and its affiliates, except as required to comply with Section 4(c) of
12
+ ### the License and to reproduce the content of the NOTICE file.
13
+ ###
14
+ ### You may obtain a copy of the Apache License at
15
+ ###
16
+ ### http://www.apache.org/licenses/LICENSE-2.0
17
+ ###
18
+ ### Unless required by applicable law or agreed to in writing, software
19
+ ### distributed under the Apache License with the above modification is
20
+ ### distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21
+ ### KIND, either express or implied. See the Apache License for the specific
22
+ ### language governing permissions and limitations under the Apache License.
23
+ ###
24
+ ###
25
+
26
+ require 'jamf/deprecations/deprecated_api_connection_class'
27
+ require 'jamf/deprecations/deprecated_api_constant'
28
+ require 'jamf/deprecations/deprecated_config_constant'
data/lib/jamf/version.rb CHANGED
@@ -27,6 +27,6 @@
27
27
  module Jamf
28
28
 
29
29
  ### The version of ruby-jss
30
- VERSION = '2.0.0'.freeze
30
+ VERSION = '2.1.0b5'.freeze
31
31
 
32
32
  end # module
@@ -89,8 +89,6 @@ module JamfZeitwerkConfig
89
89
  loader.collapse("#{__dir__}/api/jamf_pro/base_classes")
90
90
  loader.collapse("#{__dir__}/api/jamf_pro/other_classes")
91
91
 
92
- loader.collapse("#{__dir__}/deprecations")
93
-
94
92
  ##### Inflected Paths
95
93
 
96
94
  # filenames => Constants, which don't adhere to zeitwerk's parsing standards.
@@ -130,6 +128,7 @@ module JamfZeitwerkConfig
130
128
  loader.inflector.inflect 'md_prestage_names' => 'MobileDevicePrestageNames'
131
129
  loader.inflector.inflect 'md_prestage_skip_setup_items' => 'MobileDevicePrestageSkipSetupItems'
132
130
  loader.inflector.inflect 'macos_managed_updates' => 'MacOSManagedUpdates'
131
+ loader.inflector.inflect 'macos_redeploy_mgmt_framework' => 'MacOSRedeployMgmtFramework'
133
132
 
134
133
  # deprecations, separated so they load only when used.
135
134
  # When its time to get rid of them, delete the files from the
@@ -147,6 +146,8 @@ module JamfZeitwerkConfig
147
146
  loader.ignore "#{__dir__}/ruby_extensions.rb"
148
147
  loader.ignore "#{__dir__}/ruby_extensions"
149
148
  loader.ignore "#{__dir__}/exceptions.rb"
149
+ loader.ignore "#{__dir__}/deprecations"
150
+ loader.ignore "#{__dir__}/deprecations.rb"
150
151
 
151
152
  lib_dir = Pathname.new(__dir__).parent.to_s
152
153
  loader.ignore "#{lib_dir}/ruby-jss.rb"
data/lib/jamf.rb CHANGED
@@ -89,3 +89,7 @@ JSS = Jamf
89
89
 
90
90
  # testing zeitwerk loading, the the desired file is present
91
91
  JamfZeitwerkConfig.eager_load_for_testing
92
+
93
+ # Load more non-autoloaded stuff, but this stuff needs
94
+ # to happen after zeitwerk loading is active.
95
+ require 'jamf/deprecations'