lib/d3/basename.rb in depot3-3.0.11 vs lib/d3/basename.rb in depot3-3.0.13
- old
+ new
@@ -110,14 +110,14 @@
attr_reader :status
# @return [Symbol] Is this package a .dmg or .pkg?
attr_reader :package_type
- ### @return [String] a string for matching to the output lines
+ ### @return [Array<String>] an array of Strings for matching to the output lines
### of '/bin/ps -A -c -o comm'. If there's a match, this pkg won't be
- ### installed or uninstalled
- attr_reader :prohibiting_process
+ ### installed or uninstalled without a graceful quit
+ attr_reader :prohibiting_processes
# @return [Integer] the days of disuse before an expirable edition expires. 0=never
attr_reader :expiration
# @return [String] the path to the executable that needs come to the foreground to prevent expiration
@@ -199,23 +199,10 @@
###
def deleted?
@status == :deleted
end
- private
-
- ### set the status
- ###
- ### @param new_status[Symnol] one of the valid STATUSES
- ###
- ### @return [Symbol] the new status
- ###
- def status= (new_status)
- raise JSS::InvalidDataError, "status must be one of :#{STATUSES.join(', :')}" unless STATUSES.include? new_status
- @status = new_status
- end
-
### Does a given array of pathnames have the same elements as
### @expiration_paths regardless of order?
###
### This is generally used to compare two @expiration_paths
### arrays for "equality"
@@ -223,11 +210,24 @@
### @param other_exp_paths[Array] An array if Pathnames to compare to @expiration_paths
###
### @return [Boolean] Are they the same aside from order?
###
def expiration_paths_match?(other_exp_paths)
- return false unless @expiration_paths.length == other_exp_paths.length
+ return false unless @expiration_paths and @expiration_paths.length == other_exp_paths.length
(@expiration_paths - other_exp_paths).empty?
+ end
+
+ private
+
+ ### set the status
+ ###
+ ### @param new_status[Symbol] one of the valid STATUSES
+ ###
+ ### @return [Symbol] the new status
+ ###
+ def status= (new_status)
+ raise JSS::InvalidDataError, "status must be one of :#{STATUSES.join(', :')}" unless STATUSES.include? new_status
+ @status = new_status
end
end # module Basename
end # module PixD3