lib/openwfe/storage/yamlfilestorage.rb in openwferu-0.9.16 vs lib/openwfe/storage/yamlfilestorage.rb in openwferu-0.9.17
- old
+ new
@@ -1,8 +1,8 @@
#
#--
-# Copyright (c) 2006-2007, Nicolas Modryzk and John Mettraux, OpenWFE.org
+# Copyright (c) 2006-2008, Nicolas Modryzk and John Mettraux, OpenWFE.org
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
@@ -45,11 +45,11 @@
require 'openwfe/utils'
require 'openwfe/service'
require 'openwfe/expressions/flowexpression'
-require 'openwfe/expressions/raw_xml'
+#require 'openwfe/expressions/raw_xml'
#--
# making sure classes in those files are loaded
# before their yaml persistence is tuned
# (else the reopening of the class is interpreted as
# a definition of the class...)
@@ -123,13 +123,13 @@
def delete (fei)
synchronize do
fei_path = compute_file_path(fei)
- #ldebug do
- # "delete()\n for #{fei.to_debug_s}\n at #{fei_path}"
- #end
+ ldebug do
+ "delete()\n for #{fei.to_debug_s}\n at #{fei_path}"
+ end
File.delete(fei_path)
end
end
@@ -193,22 +193,22 @@
end
#
# Passes each object path to the given block
#
- def each_object_path (&block)
+ def each_object_path (path=@basepath, &block)
#return unless block
synchronize do
- Find.find(@basepath) do |path|
+ Find.find(path) do |p|
- next unless File.exist? path
- next if File.stat(path).directory?
- next unless OpenWFE::ends_with(path, ".yaml")
+ next unless File.exist?(p)
+ next if File.stat(p).directory?
+ next unless OpenWFE::ends_with(p, ".yaml")
- ldebug { "each_object_path() considering #{path}" }
- block.call path
+ ldebug { "each_object_path() considering #{p}" }
+ block.call p
end
end
end
#