    # File lib/chef/couchdb.rb, line 82
        def create_design_document(name, data)
          to_update = true
          begin
            old_doc = @rest.get_rest("#{couchdb_database}/_design/#{name}")
            if data["version"] != old_doc["version"]
              data["_rev"] = old_doc["_rev"]
              Chef::Log.debug("Updating #{name} views")
            else
              to_update = false
            end
          rescue
            Chef::Log.debug("Creating #{name} views for the first time because: #{$!}")
          end
          if to_update
            @rest.put_rest("#{couchdb_database}/_design%2F#{name}", data)
          end
          true
        end