Skip to content

Commit

Permalink
convert textile docs to markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
flyerhzm committed Mar 23, 2013
1 parent 9f16f35 commit b39ec49
Show file tree
Hide file tree
Showing 2 changed files with 146 additions and 146 deletions.
15 changes: 10 additions & 5 deletions Hacking.textile → Hacking.md
@@ -1,8 +1,10 @@
h1. Bullet Overview for Developers
# Bullet Overview for Developers

This file aims to give developers a quick tour of the bullet internals, making
it (hopefully) easier to extend or enhance the Bullet gem.

h2. General Control Flow aka. 10000 Meter View
## General Control Flow aka. 10000 Meter View

When Rails is initialized, Bullet will extend ActiveRecord (and if you're using
Rails 2.x ActiveController too) with the relevant modules and methods found
in lib/bullet/active_recordX.rb and lib/bullet/action_controller2.rb. If you're
Expand Down Expand Up @@ -36,7 +38,8 @@ So the flow of a request goes like this:
8. Bullet calls end_request for each detector.
9. Goto 1.

h2. Adding Notification Types
## Adding Notification Types

If you want to add more kinds of things that Bullet can detect, a little more
work is needed than if you were just adding a Presenter, but the concepts are
similar.
Expand All @@ -55,15 +58,17 @@ Since the detection of pathological associations is a bit hairy, I'd recommend
having a look at the counter cache detector and associated notification to get
a feel for what is needed to get off the ground.

h3. Detectors
### Detectors

The only things you'll need to consider when building your Detector class is
that it will need to supply the .start_request, .end_request and .clear class
methods.

Simple implementations are provided by Bullet::Detector::Base for start_request
and end_request, you will have to supply your own clear method.

h3. Notifications
### Notifications

For notifications you will want to supply a #title and #body instance method,
and check to see if the #initialize and #full_notice methods in the
Bullet::Notification::Base class fit your needs.

0 comments on commit b39ec49

Please sign in to comment.