toadhopper 0.4 → 0.5

Sign up to get free protection for your applications and to get access to all the features.
data/Readme.md CHANGED
@@ -1,12 +1,7 @@
1
1
  A base library for [Hoptoad](http://www.hoptoadapp.com/) error reporting.
2
2
 
3
- Toadhopper can be used to report plain old Ruby exceptions or to build a library specific gem, such as the yet-to-be-built toadhopper-sinatra and toadhopper-rack gems (they're next on my list).
3
+ Toadhopper can be used to report plain old Ruby exceptions, or to build a framework-specific gem such as [toadhopper-sinatra](http://github.com/toolmantim/toadhopper-sinatra).
4
4
 
5
- ## Example
6
-
7
- require 'rubygems'
8
-
9
- gem 'toadhopper'
10
5
  require 'toadhopper'
11
6
 
12
7
  Toadhopper.api_key = "YOURAPIKEY"
@@ -14,3 +9,7 @@ Toadhopper can be used to report plain old Ruby exceptions or to build a library
14
9
  error = begin; raise "Kaboom!"; rescue => e; e; end
15
10
 
16
11
  puts Toadhopper.post!(error)
12
+
13
+ You can install it via rubygems:
14
+
15
+ gem install toadhopper
data/lib/toadhopper.rb CHANGED
@@ -5,21 +5,21 @@ module Toadhopper
5
5
  class << self
6
6
  # Set the API key
7
7
  def api_key=(key)
8
- @@api_key = key
8
+ @api_key = key
9
9
  end
10
10
  # Returns the key set by Toadhopper.api_key=
11
11
  def api_key
12
- @@api_key
12
+ @api_key
13
13
  end
14
14
  # Sets patterns to [FILTER] out sensitive data such as passwords, emails and credit card numbers.
15
15
  #
16
16
  # Toadhopper.filters = /password/, /email/, /credit_card_number/
17
17
  def filters=(*filters)
18
- @@filters = filters.flatten
18
+ @filters = filters.flatten
19
19
  end
20
20
  # Returns the filters set by Toadhopper.filters=
21
21
  def filters
22
- [@@filters].flatten.compact
22
+ [@filters].flatten.compact
23
23
  end
24
24
  # Replaces the values of the keys matching Toadhopper.filters with [FILTERED]. Typically used on the params and environment hashes.
25
25
  def filter(hash)
data/test/test_test.rb CHANGED
@@ -3,10 +3,10 @@ require File.dirname(__FILE__) + "/../lib/toadhopper/test"
3
3
  require 'test/unit'
4
4
 
5
5
  class Toadhopper::TestTest < Test::Unit::TestCase
6
+ include Toadhopper::Test::Methods
6
7
  def test_stub_toadhopper_post!
7
- # TODO:
8
- end
9
- def test_last_toadhopper_post_params
10
- # TODO:
8
+ stub_toadhopper_post!
9
+ Toadhopper.post!(:error, :options, :header_options)
10
+ assert_equal [:error, :options, :header_options], last_toadhopper_post_arguments
11
11
  end
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toadhopper
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.4"
4
+ version: "0.5"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Lucas
@@ -9,11 +9,11 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-16 00:00:00 +10:00
12
+ date: 2009-09-17 00:00:00 +10:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
16
- description: Library for posting Hoptoad notifications
16
+ description: Post error notifications to Hoptoad
17
17
  email: t.lucas@toolmantim.com
18
18
  executables: []
19
19
 
@@ -56,6 +56,6 @@ rubyforge_project: toadhopper
56
56
  rubygems_version: 1.3.1
57
57
  signing_key:
58
58
  specification_version: 2
59
- summary: Library for posting Hoptoad notifications
59
+ summary: Post error notifications to Hoptoad
60
60
  test_files: []
61
61