toadhopper 1.1 → 1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Gemfile.lock +1 -1
  2. data/lib/notice.erb +1 -1
  3. data/lib/toadhopper.rb +8 -5
  4. metadata +6 -15
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- toadhopper (1.1)
4
+ toadhopper (1.2)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="utf-8" ?>
2
- <notice version="2.0.18">
2
+ <notice version="2.0">
3
3
  <api-key><%=h api_key %></api-key>
4
4
  <notifier>
5
5
  <name><%=h notifier_name %></name>
@@ -4,7 +4,7 @@ require 'ostruct'
4
4
 
5
5
  # Posts errors to the Hoptoad API
6
6
  class Toadhopper
7
- VERSION = "1.1"
7
+ VERSION = "1.2"
8
8
  FILTER_REPLACEMENT = "[FILTERED]"
9
9
 
10
10
  # Hoptoad API response
@@ -12,8 +12,11 @@ class Toadhopper
12
12
 
13
13
  attr_reader :api_key
14
14
 
15
- def initialize(api_key)
16
- @api_key = api_key
15
+ def initialize(api_key, params = {})
16
+ @api_key = api_key
17
+ @notify_host = params.delete(:notify_host) || "http://hoptoadapp.com"
18
+ @error_url = params.delete(:error_url) || "#{@notify_host}/notifier_api/v2/notices"
19
+ @deploy_url = params.delete(:deploy_url) || "#{@notify_host}/deploys.txt"
17
20
  end
18
21
 
19
22
  # Sets patterns to +[FILTER]+ out sensitive data such as +/password/+, +/email/+ and +/credit_card_number/+
@@ -68,7 +71,7 @@ class Toadhopper
68
71
  params['deploy[local_username]'] = options[:username] || %x(whoami).strip
69
72
  params['deploy[scm_repository]'] = options[:scm_repository]
70
73
  params['deploy[scm_revision]'] = options[:scm_revision]
71
- response = Net::HTTP.post_form(URI.parse('http://hoptoadapp.com/deploys.txt'), params)
74
+ response = Net::HTTP.post_form(URI.parse(@deploy_url), params)
72
75
  parse_response(response)
73
76
  end
74
77
 
@@ -104,7 +107,7 @@ class Toadhopper
104
107
  end
105
108
 
106
109
  def post_document(document, headers={})
107
- uri = URI.parse("http://hoptoadapp.com:80/notifier_api/v2/notices")
110
+ uri = URI.parse(@error_url)
108
111
  Net::HTTP.start(uri.host, uri.port) do |http|
109
112
  http.read_timeout = 5 # seconds
110
113
  http.open_timeout = 2 # seconds
metadata CHANGED
@@ -1,11 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toadhopper
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 1
8
- version: "1.1"
4
+ prerelease:
5
+ version: "1.2"
9
6
  platform: ruby
10
7
  authors:
11
8
  - Tim Lucas
@@ -17,7 +14,7 @@ autorequire:
17
14
  bindir: bin
18
15
  cert_chain: []
19
16
 
20
- date: 2011-01-31 00:00:00 +11:00
17
+ date: 2011-04-22 00:00:00 +10:00
21
18
  default_executable:
22
19
  dependencies:
23
20
  - !ruby/object:Gem::Dependency
@@ -27,8 +24,6 @@ dependencies:
27
24
  requirements:
28
25
  - - ">="
29
26
  - !ruby/object:Gem::Version
30
- segments:
31
- - 0
32
27
  version: "0"
33
28
  type: :development
34
29
  prerelease: false
@@ -40,8 +35,6 @@ dependencies:
40
35
  requirements:
41
36
  - - ">="
42
37
  - !ruby/object:Gem::Version
43
- segments:
44
- - 0
45
38
  version: "0"
46
39
  type: :development
47
40
  prerelease: false
@@ -53,8 +46,6 @@ dependencies:
53
46
  requirements:
54
47
  - - ">="
55
48
  - !ruby/object:Gem::Version
56
- segments:
57
- - 0
58
49
  version: "0"
59
50
  type: :development
60
51
  prerelease: false
@@ -100,7 +91,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
100
91
  requirements:
101
92
  - - ">="
102
93
  - !ruby/object:Gem::Version
103
- hash: 3677881866856613108
94
+ hash: 2161208689996690489
104
95
  segments:
105
96
  - 0
106
97
  version: "0"
@@ -109,14 +100,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
100
  requirements:
110
101
  - - ">="
111
102
  - !ruby/object:Gem::Version
112
- hash: 3677881866856613108
103
+ hash: 2161208689996690489
113
104
  segments:
114
105
  - 0
115
106
  version: "0"
116
107
  requirements: []
117
108
 
118
109
  rubyforge_project: toadhopper
119
- rubygems_version: 1.3.7
110
+ rubygems_version: 1.5.0
120
111
  signing_key:
121
112
  specification_version: 3
122
113
  summary: Post error notifications to Hoptoad