summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/chef_fs/data_handler/data_handler_base.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/chef/chef_fs/data_handler/data_handler_base.rb b/lib/chef/chef_fs/data_handler/data_handler_base.rb
index 83f56ed16d..62b35d69d4 100644
--- a/lib/chef/chef_fs/data_handler/data_handler_base.rb
+++ b/lib/chef/chef_fs/data_handler/data_handler_base.rb
@@ -28,10 +28,7 @@ class Chef
# Takes a name like blah.json and removes the .json from it.
#
def remove_dot_json(name)
- if name.length < 5 || name[-5, 5] != ".json"
- raise "Invalid name #{path}: must end in .json"
- end
- name[0, name.length - 5]
+ File.basename(name, ".json")
end
#