hoptoad_notifier 2.3.10 → 2.3.11
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +5 -0
- data/Rakefile +2 -2
- data/generators/hoptoad/hoptoad_generator.rb +21 -0
- data/lib/hoptoad_notifier/version.rb +1 -1
- data/lib/rails/generators/hoptoad/hoptoad_generator.rb +21 -0
- data/test/helper.rb +2 -1
- metadata +24 -5
data/README.rdoc
CHANGED
@@ -235,6 +235,11 @@ When Hoptoad is installed as a gem, you need to add
|
|
235
235
|
|
236
236
|
to your deploy.rb
|
237
237
|
|
238
|
+
If you don't use Capistrano, then you can use the following rake task from your
|
239
|
+
deployment process to notify Hoptoad:
|
240
|
+
|
241
|
+
rake hoptoad:deploy TO=#{rails_env} REVISION=#{current_revision} REPO=#{repository} USER=#{local_user}
|
242
|
+
|
238
243
|
== Going beyond exceptions
|
239
244
|
|
240
245
|
You can also pass a hash to notify_hoptoad method and store whatever you want,
|
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ require 'rake/gempackagetask'
|
|
5
5
|
require 'cucumber/rake/task'
|
6
6
|
|
7
7
|
desc 'Default: run unit tests.'
|
8
|
-
task :default => [:test, :
|
8
|
+
task :default => [:test, "cucumber:rails:all"]
|
9
9
|
|
10
10
|
desc 'Test the hoptoad_notifier gem.'
|
11
11
|
Rake::TestTask.new(:test) do |t|
|
@@ -131,7 +131,7 @@ gemspec = Gem::Specification.new do |s|
|
|
131
131
|
s.add_runtime_dependency("activesupport")
|
132
132
|
s.add_development_dependency("activerecord")
|
133
133
|
s.add_development_dependency("actionpack")
|
134
|
-
s.add_development_dependency("
|
134
|
+
s.add_development_dependency("bourne")
|
135
135
|
s.add_development_dependency("nokogiri")
|
136
136
|
s.add_development_dependency("shoulda")
|
137
137
|
|
@@ -32,6 +32,7 @@ class HoptoadGenerator < Rails::Generator::Base
|
|
32
32
|
m.append_to 'config/environment.rb', "require 'config/hoptoad'"
|
33
33
|
end
|
34
34
|
end
|
35
|
+
determine_api_key if heroku?
|
35
36
|
m.rake "hoptoad:test --trace", :generate_only => true
|
36
37
|
end
|
37
38
|
end
|
@@ -44,6 +45,26 @@ class HoptoadGenerator < Rails::Generator::Base
|
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
48
|
+
def determine_api_key
|
49
|
+
puts "Attempting to determine your API Key from Heroku..."
|
50
|
+
ENV['HOPTOAD_API_KEY'] = `heroku console 'puts ENV[%{HOPTOAD_API_KEY}]'`.split("\n").first
|
51
|
+
if ENV['HOPTOAD_API_KEY'].blank?
|
52
|
+
puts "... Failed."
|
53
|
+
puts "WARNING: We were unable to detect the Hoptoad API Key from your Heroku environment."
|
54
|
+
puts "Your Heroku application environment may not be configured correctly."
|
55
|
+
exit 1
|
56
|
+
else
|
57
|
+
puts "... Done."
|
58
|
+
puts "Heroku's Hoptoad API Key is '#{ENV['HOPTOAD_API_KEY']}'"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def heroku?
|
63
|
+
options[:heroku] ||
|
64
|
+
system("grep HOPTOAD_API_KEY config/initializers/hoptoad.rb") ||
|
65
|
+
system("grep HOPTOAD_API_KEY config/environment.rb")
|
66
|
+
end
|
67
|
+
|
47
68
|
def use_initializer?
|
48
69
|
Rails::VERSION::MAJOR > 1
|
49
70
|
end
|
@@ -14,6 +14,7 @@ class HoptoadGenerator < Rails::Generators::Base
|
|
14
14
|
ensure_plugin_is_not_present
|
15
15
|
append_capistrano_hook
|
16
16
|
generate_initializer unless api_key_configured?
|
17
|
+
determine_api_key if heroku?
|
17
18
|
test_hoptoad
|
18
19
|
end
|
19
20
|
|
@@ -55,6 +56,26 @@ class HoptoadGenerator < Rails::Generators::Base
|
|
55
56
|
template 'initializer.rb', 'config/initializers/hoptoad.rb'
|
56
57
|
end
|
57
58
|
|
59
|
+
def determine_api_key
|
60
|
+
puts "Attempting to determine your API Key from Heroku..."
|
61
|
+
ENV['HOPTOAD_API_KEY'] = `heroku console 'puts ENV[%{HOPTOAD_API_KEY}]'`.split("\n").first
|
62
|
+
if ENV['HOPTOAD_API_KEY'].blank?
|
63
|
+
puts "... Failed."
|
64
|
+
puts "WARNING: We were unable to detect the Hoptoad API Key from your Heroku environment."
|
65
|
+
puts "Your Heroku application environment may not be configured correctly."
|
66
|
+
exit 1
|
67
|
+
else
|
68
|
+
puts "... Done."
|
69
|
+
puts "Heroku's Hoptoad API Key is '#{ENV['HOPTOAD_API_KEY']}'"
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def heroku?
|
74
|
+
options[:heroku] ||
|
75
|
+
system("grep HOPTOAD_API_KEY config/initializers/hoptoad.rb") ||
|
76
|
+
system("grep HOPTOAD_API_KEY config/environment.rb")
|
77
|
+
end
|
78
|
+
|
58
79
|
def api_key_configured?
|
59
80
|
File.exists?('config/initializers/hoptoad.rb')
|
60
81
|
end
|
data/test/helper.rb
CHANGED
@@ -6,7 +6,7 @@ gem "activerecord", "= 2.3.8"
|
|
6
6
|
gem "actionpack", "= 2.3.8"
|
7
7
|
gem "nokogiri", "= 1.4.3.1"
|
8
8
|
gem "shoulda", "= 2.11.3"
|
9
|
-
gem '
|
9
|
+
gem 'bourne', '>= 1.0'
|
10
10
|
|
11
11
|
$LOAD_PATH << File.join(File.dirname(__FILE__), *%w[.. vendor ginger lib])
|
12
12
|
$LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), "..", "lib"))
|
@@ -24,6 +24,7 @@ require 'active_record/base'
|
|
24
24
|
require 'active_support'
|
25
25
|
require 'nokogiri'
|
26
26
|
require 'rack'
|
27
|
+
require 'bourne'
|
27
28
|
|
28
29
|
require "hoptoad_notifier"
|
29
30
|
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hoptoad_notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 2
|
7
8
|
- 3
|
8
|
-
-
|
9
|
-
version: 2.3.
|
9
|
+
- 11
|
10
|
+
version: 2.3.11
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- thoughtbot, inc
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-10-
|
18
|
+
date: 2010-10-25 00:00:00 -04:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: builder
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
27
30
|
segments:
|
28
31
|
- 0
|
29
32
|
version: "0"
|
@@ -33,9 +36,11 @@ dependencies:
|
|
33
36
|
name: activesupport
|
34
37
|
prerelease: false
|
35
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
36
40
|
requirements:
|
37
41
|
- - ">="
|
38
42
|
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
39
44
|
segments:
|
40
45
|
- 0
|
41
46
|
version: "0"
|
@@ -45,9 +50,11 @@ dependencies:
|
|
45
50
|
name: activerecord
|
46
51
|
prerelease: false
|
47
52
|
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
48
54
|
requirements:
|
49
55
|
- - ">="
|
50
56
|
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
51
58
|
segments:
|
52
59
|
- 0
|
53
60
|
version: "0"
|
@@ -57,21 +64,25 @@ dependencies:
|
|
57
64
|
name: actionpack
|
58
65
|
prerelease: false
|
59
66
|
requirement: &id004 !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
60
68
|
requirements:
|
61
69
|
- - ">="
|
62
70
|
- !ruby/object:Gem::Version
|
71
|
+
hash: 3
|
63
72
|
segments:
|
64
73
|
- 0
|
65
74
|
version: "0"
|
66
75
|
type: :development
|
67
76
|
version_requirements: *id004
|
68
77
|
- !ruby/object:Gem::Dependency
|
69
|
-
name:
|
78
|
+
name: bourne
|
70
79
|
prerelease: false
|
71
80
|
requirement: &id005 !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
72
82
|
requirements:
|
73
83
|
- - ">="
|
74
84
|
- !ruby/object:Gem::Version
|
85
|
+
hash: 3
|
75
86
|
segments:
|
76
87
|
- 0
|
77
88
|
version: "0"
|
@@ -81,9 +92,11 @@ dependencies:
|
|
81
92
|
name: nokogiri
|
82
93
|
prerelease: false
|
83
94
|
requirement: &id006 !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
84
96
|
requirements:
|
85
97
|
- - ">="
|
86
98
|
- !ruby/object:Gem::Version
|
99
|
+
hash: 3
|
87
100
|
segments:
|
88
101
|
- 0
|
89
102
|
version: "0"
|
@@ -93,9 +106,11 @@ dependencies:
|
|
93
106
|
name: shoulda
|
94
107
|
prerelease: false
|
95
108
|
requirement: &id007 !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
96
110
|
requirements:
|
97
111
|
- - ">="
|
98
112
|
- !ruby/object:Gem::Version
|
113
|
+
hash: 3
|
99
114
|
segments:
|
100
115
|
- 0
|
101
116
|
version: "0"
|
@@ -169,23 +184,27 @@ rdoc_options:
|
|
169
184
|
require_paths:
|
170
185
|
- lib
|
171
186
|
required_ruby_version: !ruby/object:Gem::Requirement
|
187
|
+
none: false
|
172
188
|
requirements:
|
173
189
|
- - ">="
|
174
190
|
- !ruby/object:Gem::Version
|
191
|
+
hash: 3
|
175
192
|
segments:
|
176
193
|
- 0
|
177
194
|
version: "0"
|
178
195
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
|
+
none: false
|
179
197
|
requirements:
|
180
198
|
- - ">="
|
181
199
|
- !ruby/object:Gem::Version
|
200
|
+
hash: 3
|
182
201
|
segments:
|
183
202
|
- 0
|
184
203
|
version: "0"
|
185
204
|
requirements: []
|
186
205
|
|
187
206
|
rubyforge_project:
|
188
|
-
rubygems_version: 1.3.
|
207
|
+
rubygems_version: 1.3.7
|
189
208
|
signing_key:
|
190
209
|
specification_version: 3
|
191
210
|
summary: Send your application errors to our hosted service and reclaim your inbox.
|