BlameScope

Track events per user

Build Status Code Climate Test Coverage

Client mode

Rails setup

# config/application.rb
config.middleware.use Blamescope::Middleware, rabbit: 'amqp://user:pass@host:port/vhost'

Rack setup

# config.ru
use Blamescope::Middleware, rabbit: 'amqp://user:pass@host:port/vhost'

Usage

class User < ActiveRecord::Base
  include Blamescope

  blame_activerecord # Tracks create, update and delete action
  def custom_action
    # Some action
  end
  blame_method :custom_action
end

At the current time it adds such methods:

  • blame_activerecord - track create, update, delete of ActiveRecord model
  • blame_method - track specific method
  • blame_methods - track multiple methods

You can also track static methods and Devise is the only authorization it supports.

Server mode

blamescope -d postgres://user:password@host/database -r amqp://user:pass@host:port/vhost

Installation

Add this line to your application's Gemfile:

gem 'blamescope'

And then execute:

$ bundle

Or install it yourself as:

$ gem install blamescope

Usage

TODO: Write usage instructions here

Contributing

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