DELETE /news/1
 DELETE /news/1.json
764920
def destroy
      @news = News.find(params[:id])
      category = @news.category
      @news.destroy
  
      respond_to do |format|
        format.html { redirect_to category_news_index_path(category), notice: 'News was successfully deleted.' }
        format.json { head :no_content }
      end
    end
867853
public function destroy(NewsRequest $request, News $news)
    {
        try {

            $news->delete();
            return $this->response->message(trans('messages.success.deleted', ['Module' => trans('news::news.name')]))
                ->code(202)
                ->status('success')
                ->url(guard_url('news/news/0'))
                ->redirect();

        } catch (Exception $e) {

            return $this->response->message($e->getMessage())
                ->code(400)
                ->status('error')
                ->url(guard_url('news/news/' . $news->getRouteKey()))
                ->redirect();
        }

    }
637466
function __delPath(jsonSchema, path) {
  var jss = findPath(jsonSchema, path);
  delete jss.baseCont[jss.prop];
  if (jss.parent.required && jss.parent.required.length) {
    jss.parent.required = jss.parent.required.filter(f => f != jss.prop)
  }
  if (Object.keys(jss.baseCont).length === 0) {
    __delPath(jsonSchema, path.split('.').slice(0, -1).join('.'));
  }
}
133047
function (done) {
      var p = clone(pkg);
      delete p.devDependencies;
      var content = JSON.stringify(p, null, 2);
      write_if_not_exists('package.json', content, done);
    }
1368273
def destroy
      @image.destroy
  
      respond_to do |format|
        format.html { redirect_to images_url }
        format.json { head :ok }
      end
    end
1020734
function removePostsContent( posts, options ) {

	var _sortPosts = options && typeof options.sortPosts === 'function' ?
				options.sortPosts : sortPosts,
			i = 0,
			len = 0;

	// Posts should be objects separated by commas but not wrapped in []
	posts = JSON.parse( '[' + posts.contents.toString() + ']' );

	len = posts.length;

	for ( i; i < len; i++ ) {

		delete posts[i].content;
	}

	// Sort posts by newest
	posts.sort( _sortPosts );

	return JSON.stringify( posts );
}
610885
def delete(path, options={}, raw=false, unformatted=true)
      request(:delete, path, options, raw, unformatted)
    end
334562
def delete(nsc, site_id)
      uri = "/api/2.1/site_configurations/#{site_id}/alerts/#{id}"
      AJAX.delete(nsc, uri, AJAX::CONTENT_TYPE::JSON)
    end
792896
function(paths, callback){
        //Remove original.
        var p = new _(paths.root + '/.gna');
        var path = p.toString();

        //Remove folers.
        fs.exists(path, function(exists){
            //delete when exists.
            if (exists) {
                //console.log("yeah about to delete main folder: ", p.toString());
                //Delete ans die here..
                p.rm(function(err, path){
                    //console.log("receives ", err, path);
                    if (err) {
                        //logger.error('gina', 'UTILS:CONFIG:ERR:8', err, __stack);
                        console.error(err.stack||err.message);
                        callback(err)
                    } else {
                        //logger.info('gina', 'UTILS:CONFIG:INFO:1', path +': deleted with success !');
                        console.info( path +': deleted with success !');
                        callback(false)
                    }
                })
            }
        })
    }
272761
def delete(path, options = {}, headers = {}, raw = false)
      request(:delete, path, options, headers, raw)
    end
78107
def destroy
      @announcement = Announcement.find(params[:id])
      @announcement.destroy
  
      respond_to do |format|
        format.html { redirect_to announcements_url }
        format.json { head :no_content }
      end
    end
513854
function remove(path) {
	let files = [];
	if( fs.existsSync(path) ) {
		if(fs.statSync(path).isFile()){
			fs.unlinkSync(path);
			return;
		}

		files = fs.readdirSync(path);
		files.forEach(function(file, index){
			let curPath = path + "/" + file;
			if(fs.statSync(curPath).isDirectory()) {
				remove(curPath)
			} else {
				fs.unlinkSync(curPath);
			}
		});
		fs.rmdirSync(path, err=>console.error(err));
	}
}
455947
def delete(self) :
        """"""
        r = self.connection.session.delete(self.URL)
        data = r.json()
        if not r.status_code == 200 or data["error"] :
            raise DeletionError(data["errorMessage"], data)
938183
def delete_asset(self):
        
        headers, data = self._requester.requestJsonAndCheck(
            "DELETE",
            self.url
        )
        return True
340398
def destroy
      if current_command == "addons:remove"
        deprecate("`heroku #{current_command}` has been deprecated. Please use `heroku addons:destroy` instead.")
      end

      raise CommandFailed.new("Missing add-on name") if args.empty?

      requires_preauth
      confirmed_apps = []

      while addon_name = args.shift
        addon = resolve_addon!(addon_name)
        app   = addon['app']

        unless confirmed_apps.include?(app['name'])
          return unless confirm_command(app['name'])
          confirmed_apps << app['name']
        end

        addon_attachments = get_attachments(:resource => addon['id'])

        action("Destroying #{addon['name']} on #{app['name']}") do
          addon = api.request(
            :body     => json_encode({
              "force" => options[:force] || ENV['HEROKU_FORCE'] == '1',
            }),
            :expects  => 200..300,
            :headers  => {
              "Accept" => "application/vnd.heroku+json; version=3",
              "Accept-Expansion" => "plan"
            },
            :method   => :delete,
            :path     => "/apps/#{app['id']}/addons/#{addon['id']}"
          ).body
          @status = "(#{format_price addon['plan']['price']})" if addon['plan'].has_key?('price')
        end

        if addon['config_vars'].any? # litmus test for whether the add-on's attachments have vars
          # For each app that had an attachment, output a message indicating that
          # the app has been restarted any any associated vars have been removed.
          addon_attachments.group_by { |att| att['app']['name'] }.each do |app, attachments|
            names = attachments.map { |att| att['name'] }.join(', ')
            action("Removing vars for #{names} from #{app} and restarting") {
              @status = api.get_release(app, 'current').body['name']
            }
          end
        end
      end
    end
1186186
def destroy
      @error_message.destroy

      respond_to do |format|
        format.html { redirect_to error_messages_url }
        format.json { head :no_content }
      end
    end
1210071
function() {
        var items = _utils.getArgArray(arguments);
        if (items.length === 0) {
            throw new Error('no files specified to clean up');
        }
        items.forEach(function(item) {
            try {
                var path = (typeof item === 'string') ? item : item.path;
                _fs.unlinkSync(path);
            } catch (e) {
                // Eat the exception.
            }
        });
    }