platform_simulation_specs/common/ohai_plugin_common.rb
# delete all files and folders in path except those that match
# the specified regex
delete all files and folders in path except those that match
the specified regex
delete all files and folders in path except those that match the specified regex
def clean_path( path, regex )
    Dir.glob( File.join( path, "*" )).
      reject { | e | e =~ regex }.
      each { | e | Mixlib::ShellOut.new( "rm -rf #{ e }" ).run_command }
  end
def clean_path ( path , regex ) Dir . glob ( File . join ( path , "*" ) ) . reject { | e | e =~ regex } . each { | e | Mixlib :: ShellOut . new ( "rm -rf #{ e }" ) . run_command } end
delete all files and folders in path except those that match
the specified regex
delete all files and folders in path except those that match the specified regex
path
regex