Stop hurting your users!
Tripwire captures validation errors from your Ruby on Rails application to help you identify and fix user experience issues. The TripwireNotifier gem makes it easy to hook up your app to the Tripwire web service.
If you haven’t already signed up for a Tripwire account, visit tripwireapp.com.
-
Add the following line to Gemfile:
gem 'tripwire_notifier'
-
Install the gem:
bundle install
-
Add the following line to config/environment.rb:
config.gem 'tripwire_notifier'
-
Install the gem:
[sudo] rake gems:install GEM=tripwire_notifier
In your Rails app, create config/initializers/tripwire_notifier.rb and add the following line with the API key for your Tripwire project:
TripwireNotifier.configure do |config| config.api_key = "<YOUR API KEY>" end
Validation errors will now be submitted to the Tripwire service on your create and update actions in production mode.
TripwireNotifier 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_tripwire, :only => [:create, :update, :my_custom_action]
TripwireNotifier 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 Tripwire initializer:
config.monitored_environments << ‘staging’
TripwireNotifier does not use SSL by default, but you can enable it easily:
config.secure = true
TripwireNotifier 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, TripwireNotifier respects the built-in Rails parameter filtering that you enable with filter_parameter_logging in your ApplicationController. For example:
# Scrub sensitive parameters from your log filter_parameter_logging :password, :secret
Per Rails convention, those params will show up as “[FILTERED]” in the data submitted to Tripwire.
-
Twitter: @tripwireapp
-
Email: jeremy@tripwireapp.com, jeff@tripwireapp.com
-
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 © 2010 Jeffrey Chupp and Jeremy Weiskotten. See LICENSE for details.