Coder Social home page Coder Social logo

terriblelabs / guardrail_notifier Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 2.0 171 KB

Guardrail captures validation errors from your Ruby on Rails application to help you identify and fix user experience issues. The GuardrailNotifier gem makes it easy to hook up your Rails app to the Guardrail web service.

Home Page: http://www.guardrailapp.com

License: MIT License

Ruby 100.00%

guardrail_notifier's Introduction

GuardrailNotifier

<img src=“https://travis-ci.org/terriblelabs/guardrail_notifier.png” />

Stop hurting your users!

Guardrail captures validation errors from your Ruby on Rails application to help you identify and fix user experience issues. The GuardrailNotifier gem makes it easy to hook up your app to the Guardrail web service.

If you haven’t already signed up for a Guardrail account, visit guardrailapp.com.

Installation

Rails 3

  • Add the following line to Gemfile:

    gem 'guardrail_notifier'
    
  • Install the gem:

    bundle install
    

Rails 2.3

  • Add the following line to config/environment.rb:

    config.gem 'guardrail_notifier'
    
  • Install the gem:

    [sudo] rake gems:install GEM=guardrail_notifier

Configuration

In your Rails app, create config/initializers/guardrail_notifier.rb and add the following line with the API key for your Guardrail project:

GuardrailNotifier.configure do |config|
  config.api_key = "<YOUR API KEY>"
end

Or, if you prefer to keep API keys and the like out of your code, set the GUARDRAIL_API_KEY environment variable and GuardrailNotifier will find it automatically.

Validation errors will now be submitted to the Guardrail service on your create and update actions in production mode.

Advanced Usage

Tracking custom actions

GuardrailNotifier assumes your app is RESTful, so it only monitors the create and update actions by default. If you’re creating or updating records in non-RESTful actions, you can use an after_filter to make sure any validation failures in those actions are caught as well:

after_filter :log_validation_failures_to_guardrail, :only => [:create, :update, :my_custom_action]

Running in other environments

GuardrailNotifier is only enabled in the production environment by default. If you want to enable it in additional environments, such as staging, you’ll need to add the following line to your Guardrail initializer:

GuardrailNotifier.configure do |config|
  config.monitored_environments << 'staging'
end

SSL

GuardrailNotifier uses a secure connection over SSL by default, but you can easily disable it if you prefer:

GuardrailNotifier.configure do |config|
  config.secure = false
end

Filtering params

GuardrailNotifier records the parameters submitted in actions that cause validation errors. Because your app may handle sensitive data, like passwords, credit card numbers, and nuclear launch codes, GuardrailNotifier respects the parameter filtering that you configure in Rails in config/application.rb (Rails 3) or ApplicationController (Rails 2.3). For example in Rails 3:

config.filter_parameters += [:password, :secret, :cvv]

Per Rails convention, those params will show up as “[FILTERED]” in the data submitted to Guardrail.

Contact information

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with Rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2012 Terrible Labs, Inc. See LICENSE for details.

guardrail_notifier's People

Contributors

marius avatar semanticart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

marius oriolgual

guardrail_notifier's Issues

Problem installing gem

Error message:

~ >: sudo gem install tripwire_notifier
ERROR:  Error installing tripwire_notifier:
    tripwire_notifier requires tripwire_notifier (>= 0, runtime)

How can Tripwire require itself?! ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.