toadhopper 0.9.8 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -6,7 +6,7 @@ Toadhopper can be used to report plain old Ruby exceptions, or to build a framew
6
6
  raise "Kaboom!"
7
7
  rescue => e
8
8
  require 'toadhopper'
9
- ToadHopper("YOURAPIKEY").post!(e)
9
+ Toadhopper("YOURAPIKEY").post!(e)
10
10
  end
11
11
 
12
12
  You can install it via rubygems:
data/Rakefile CHANGED
@@ -19,7 +19,7 @@ Jeweler::Tasks.new do |s|
19
19
  s.executables = nil # stops jeweler automatically adding bin/*
20
20
 
21
21
  require File.join(File.dirname(__FILE__), 'lib', 'toadhopper')
22
- s.version = ToadHopper::VERSION
22
+ s.version = Toadhopper::VERSION
23
23
 
24
24
  require 'bundler'
25
25
  bundle = Bundler::Definition.from_gemfile("Gemfile")
data/lib/toadhopper.rb CHANGED
@@ -3,8 +3,8 @@ require 'erb'
3
3
  require 'ostruct'
4
4
 
5
5
  # Posts errors to the Hoptoad API
6
- class ToadHopper
7
- VERSION = "0.9.8"
6
+ class Toadhopper
7
+ VERSION = "1.0.0"
8
8
 
9
9
  # Hoptoad API response
10
10
  class Response < Struct.new(:status, :body, :errors); end
@@ -34,7 +34,7 @@ class ToadHopper
34
34
  # @option options [String] component Normally this is your Controller name in an MVC framework
35
35
  # @option options [String] action Normally the action for your request in an MVC framework
36
36
  # @option options [Hash] params A hash of the request's parameters
37
- # @option options [String] notifier_name Say you're a different notifier than ToadHopper
37
+ # @option options [String] notifier_name Say you're a different notifier than Toadhopper
38
38
  # @option options [String] notifier_version Specify the version of your custom notifier
39
39
  # @option options [String] notifier_url Specify the project URL of your custom notifier
40
40
  # @option options [Hash] session A hash of the user session in a web request
@@ -46,13 +46,13 @@ class ToadHopper
46
46
  # @param [Hash] http_headers extra HTTP headers to be sent in the post to the API
47
47
  #
48
48
  # @example
49
- # ToadHopper('apikey').post! error,
49
+ # Toadhopper('apikey').post! error,
50
50
  # {:action => 'show', :controller => 'Users'},
51
51
  # {'X-Hoptoad-Client-Name' => 'My Awesome Notifier'}
52
52
  #
53
53
  # @return [Response]
54
54
  def post!(error, options={}, http_headers={})
55
- options[:notifier_name] ||= 'ToadHopper'
55
+ options[:notifier_name] ||= 'Toadhopper'
56
56
  post_document(document_for(error, options), {'X-Hoptoad-Client-Name' => options[:notifier_name]})
57
57
  end
58
58
 
@@ -140,9 +140,9 @@ class ToadHopper
140
140
  end
141
141
  end
142
142
 
143
- # Convenience method for creating ToadHoppers
143
+ # Convenience method for creating Toadhoppers
144
144
  #
145
- # @return [ToadHopper]
146
- def ToadHopper(api_key)
147
- ToadHopper.new(api_key)
145
+ # @return [Toadhopper]
146
+ def Toadhopper(api_key)
147
+ Toadhopper.new(api_key)
148
148
  end
data/test/helper.rb CHANGED
@@ -4,7 +4,7 @@ Bundler.require(:test)
4
4
  require File.expand_path("../../lib/toadhopper", __FILE__)
5
5
 
6
6
  def toadhopper
7
- @toadhopper ||= ToadHopper.new(ENV['HOPTOAD_API_KEY'] || "test api key")
7
+ @toadhopper ||= Toadhopper.new(ENV['HOPTOAD_API_KEY'] || "test api key")
8
8
  end
9
9
 
10
10
  def error
data/test/test_filters.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
2
2
 
3
- class ToadHopper::TestFilters < Test::Unit::TestCase
3
+ class Toadhopper::TestFilters < Test::Unit::TestCase
4
4
  def test_no_filters
5
5
  assert_equal( {:id => "myid", :password => "mypassword"},
6
6
  toadhopper.clean(:id => "myid", :password => "mypassword"))
@@ -1,6 +1,6 @@
1
1
  require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
2
2
 
3
- class ToadHopper::TestNoticeDocument < Test::Unit::TestCase
3
+ class Toadhopper::TestNoticeDocument < Test::Unit::TestCase
4
4
  def test_filtering
5
5
  toadhopper.filters = "password"
6
6
  sensitive_options = {
data/test/test_posting.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
2
2
 
3
- class ToadHopper::TestPosting < Test::Unit::TestCase
3
+ class Toadhopper::TestPosting < Test::Unit::TestCase
4
4
  def test_posting
5
- response = ToadHopper('bogus key').post!(error)
5
+ response = Toadhopper('bogus key').post!(error)
6
6
  assert_equal 422, response.status
7
7
  assert_equal ['No project exists with the given API key.'], response.errors
8
8
  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.9.8
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Lucas