diff options
Diffstat (limited to 'lib/chef_zero/data_store/memory_store_v2.rb')
-rw-r--r-- | lib/chef_zero/data_store/memory_store_v2.rb | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/lib/chef_zero/data_store/memory_store_v2.rb b/lib/chef_zero/data_store/memory_store_v2.rb index c2f2d8e..b35d490 100644 --- a/lib/chef_zero/data_store/memory_store_v2.rb +++ b/lib/chef_zero/data_store/memory_store_v2.rb @@ -111,27 +111,23 @@ module ChefZero end def exists?(path, options = {}) - begin - value = _get(path) - if value.is_a?(Hash) && !options[:allow_dirs] - raise "exists? does not work with directories (#{path} = #{value.class})" - end - return true - rescue DataNotFoundError - return false + value = _get(path) + if value.is_a?(Hash) && !options[:allow_dirs] + raise "exists? does not work with directories (#{path} = #{value.class})" end + return true + rescue DataNotFoundError + return false end def exists_dir?(path) - begin - dir = _get(path) - if !dir.is_a? Hash - raise "exists_dir? only works with directories (#{path} = #{dir.class})" - end - return true - rescue DataNotFoundError - return false + dir = _get(path) + if !dir.is_a? Hash + raise "exists_dir? only works with directories (#{path} = #{dir.class})" end + return true + rescue DataNotFoundError + return false end private |