# File lib/chef/shef/ext.rb, line 317
      def edit(object)
        unless Shef.editor
          puts "Please set your editor with Shef.editor = \"vim|emacs|mate|ed\""
          return :failburger
        end

        filename = "shef-edit-#{object.class.name}-"
        if object.respond_to?(:name)
          filename += object.name
        elsif object.respond_to?(:id)
          filename += object.id
        end

        edited_data = Tempfile.open([filename, ".js"]) do |tempfile|
          tempfile.sync = true
          tempfile.puts object.to_json
          system("#{Shef.editor.to_s} #{tempfile.path}")
          tempfile.rewind
          tempfile.read
        end

        JSON.parse(edited_data)
      end