Socket
Book a DemoInstallSign in
Socket

spaghetti_squash

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spaghetti_squash

0.0.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

SpaghettiSquash

SpagettiSquash is the story of me making better an app with page after page of interlinked ActiveRecord callbacks triggering them.

Installation

Add this line to your application's Gemfile:

gem 'spaghetti_squash', group: :development

And then execute:

$ bundle

Or install it yourself as:

$ gem install spaghetti_squash

Usage

Right now, all it does it log the beginning and end of all they callbacks, so you can see what's going on.

For example

% rails c                                                                                                                                                                           ✹
Loading development environment (Rails 4.1.4)
(development on MarketMaker) irb(main):001:0> User.last.save
  User Load (18.0ms)  SELECT  "users".* FROM "users"   ORDER BY "users"."id" DESC LIMIT 1
   (0.8ms)  BEGIN
  User Exists (14.5ms)  SELECT  1 AS one FROM "users"  WHERE ("users"."email" = 'example@example.com' AND "users"."id" != 1) LIMIT 1
starting callback: save [:standardize_for_search] {}
finishing callback
   (0.3ms)  COMMIT
=> true
(development on MarketMaker) irb(main):002:0>

It should only log callbacks that originate from your code, but this might break if you vendor gems or your Rails.root is somewhere strange.

It probably slows down your app a lot.

Requirements

I'm developing this against Rails 4.1, but I'd accept bugs against any Rails 4 version.

In the future

Printing out a tree structure, and counting call backs per-request (or save, or something).

Some tools to help you pull callbacks into seperate objects that can, one hopes, be refactored away.

Who knows.

Contributing

  • Fork it ( https://github.com/[my-github-username]/spaghetti_squash/fork )
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create a new Pull Request

FAQs

Package last updated on 27 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.