lib/d3/database.rb in depot3-3.0.11 vs lib/d3/database.rb in depot3-3.0.13

- old
+ new

@@ -40,11 +40,11 @@ # the minimum JSS schema version allower MIN_SCHEMA_VERSION = "9.4" # the minimum JSS schema version allower - MAX_SCHEMA_VERSION = "9.93" + MAX_SCHEMA_VERSION = "9.97" ### these Proc objects allow us to encapsulate and pass around various ### blocks of code more easily for converting data between their mysql ### representation and the Ruby classses we use internally. @@ -57,14 +57,14 @@ ### Integers come from the database as strings, but empty ones should be nil, not zero, as #to_i would do STRING_TO_INT = Proc.new{|v| (v.nil? or v.to_s.empty?) ? nil : v.to_i} ### Some values are stored as comma-separated strings, but used as Arrays COMMA_STRING_TO_ARRAY = Proc.new{|v| JSS.to_s_and_a(v)[:arrayform] } - + ### Some values are stored as comma-separated strings, but used as Arrays of Pathnames COMMA_STRING_TO_ARRAY_OF_PATHNAMES = Proc.new{|v| JSS.to_s_and_a(v)[:arrayform].map{|p| Pathname.new(p)} } - ARRAY_OF_PATHNAMES_TO_COMMA_STRING = Proc.new{|v| v.join(", ")} + ARRAY_OF_PATHNAMES_TO_COMMA_STRING = Proc.new{|v| v.is_a?(Array) ? v.join(", ") : "" } ### Some values are used as Arrays but stored as comma-separated strings ARRAY_TO_COMMA_STRING = Proc.new{|v| JSS.to_s_and_a(v)[:stringform] } ### Some values are stored in the DB as YAML dumps @@ -155,11 +155,11 @@ ### package is not available without force ### ### - :triggers_swu [Boolean] when installed, will this package trigger a GUI software update check, ### either immediately if there's a console user, or at the next console login? ### - ### - :prohibiting_process [String] a string for matching to the output lines + ### - :prohibiting_processes [Array<String>] An array of strings for matching to the output lines ### of '/bin/ps -A -c -o comm'. If there's a matching line, this pkg won't be installed ### ### - :remove_first [Boolean] should any currently installed versions of this basename ### be uninstalled (if possible) before installing this package? ### @@ -271,16 +271,16 @@ :index => nil, :to_sql => ARRAY_TO_COMMA_STRING, :to_ruby => COMMA_STRING_TO_ARRAY }, - :prohibiting_process => { + :prohibiting_processes => { :field_name => "prohibiting_process", :sql_type => 'varchar(100)', :index => nil, - :to_sql => nil, - :to_ruby => nil + :to_sql => ARRAY_TO_COMMA_STRING, + :to_ruby => COMMA_STRING_TO_ARRAY }, :remove_first => { :field_name => "remove_first", :sql_type => "tinyint(1) DEFAULT '0'", @@ -488,7 +488,5 @@ d3_tables end end # module Database end # module D3 - -