honeybadger 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Appraisals +20 -0
- data/Gemfile +1 -13
- data/Gemfile.lock +39 -64
- data/MIT-LICENSE +5 -0
- data/README.md +102 -3
- data/Rakefile +9 -134
- data/features/metal.feature +6 -4
- data/features/rack.feature +3 -4
- data/features/rails.feature +106 -99
- data/features/rake.feature +0 -2
- data/features/sinatra.feature +1 -3
- data/features/step_definitions/metal_steps.rb +2 -1
- data/features/step_definitions/rack_steps.rb +2 -2
- data/features/step_definitions/rails_steps.rb +238 -0
- data/features/step_definitions/rake_steps.rb +1 -1
- data/features/support/env.rb +7 -7
- data/features/support/rails.rb +41 -58
- data/gemfiles/rails2.3.gemfile +9 -0
- data/gemfiles/rails2.3.gemfile.lock +102 -0
- data/gemfiles/rails3.0.gemfile +8 -0
- data/gemfiles/rails3.0.gemfile.lock +146 -0
- data/gemfiles/rails3.1.gemfile +8 -0
- data/gemfiles/rails3.1.gemfile.lock +161 -0
- data/gemfiles/rails3.2.gemfile +8 -0
- data/gemfiles/rails3.2.gemfile.lock +160 -0
- data/honeybadger.gemspec +30 -24
- data/lib/honeybadger.rb +117 -113
- data/lib/honeybadger/backtrace.rb +9 -3
- data/lib/honeybadger/configuration.rb +22 -0
- data/lib/honeybadger/notice.rb +9 -0
- data/lib/honeybadger/rack.rb +5 -4
- data/lib/honeybadger/rails3_tasks.rb +20 -23
- data/lib/honeybadger/sender.rb +10 -4
- data/lib/honeybadger/shared_tasks.rb +12 -1
- data/lib/honeybadger/tasks.rb +6 -1
- data/test/test_helper.rb +71 -71
- data/test/unit/backtrace_test.rb +26 -23
- data/test/unit/capistrano_test.rb +1 -1
- data/test/unit/configuration_test.rb +19 -3
- data/test/unit/honeybadger_tasks_test.rb +1 -1
- data/test/unit/logger_test.rb +1 -1
- data/test/unit/notice_test.rb +71 -16
- data/test/unit/notifier_test.rb +25 -5
- data/test/unit/rack_test.rb +21 -1
- data/test/unit/rails/action_controller_catcher_test.rb +1 -1
- data/test/unit/rails_test.rb +1 -1
- data/test/unit/sender_test.rb +1 -1
- metadata +69 -45
- data/SUPPORTED_RAILS_VERSIONS +0 -37
- data/TESTING.md +0 -33
- data/features/step_definitions/file_steps.rb +0 -10
- data/features/step_definitions/rails_application_steps.rb +0 -394
- data/features/support/terminal.rb +0 -107
@@ -1,107 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
|
3
|
-
Before do
|
4
|
-
@terminal = Terminal.new
|
5
|
-
end
|
6
|
-
|
7
|
-
After do |story|
|
8
|
-
if story.failed?
|
9
|
-
# puts @terminal.output
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
class Terminal
|
14
|
-
attr_reader :output, :status
|
15
|
-
attr_accessor :environment_variables, :invoke_heroku_rake_tasks_locally
|
16
|
-
|
17
|
-
def initialize
|
18
|
-
@cwd = FileUtils.pwd
|
19
|
-
@output = ""
|
20
|
-
@status = 0
|
21
|
-
@logger = Logger.new(File.join(TEMP_DIR, 'terminal.log'))
|
22
|
-
|
23
|
-
@invoke_heroku_rake_tasks_locally = false
|
24
|
-
|
25
|
-
@environment_variables = {
|
26
|
-
"GEM_HOME" => LOCAL_GEM_ROOT,
|
27
|
-
"GEM_PATH" => "#{LOCAL_GEM_ROOT}:#{BUILT_GEM_ROOT}",
|
28
|
-
"PATH" => "#{gem_bin_path}:#{ENV['PATH']}"
|
29
|
-
}
|
30
|
-
end
|
31
|
-
|
32
|
-
def cd(directory)
|
33
|
-
@cwd = directory
|
34
|
-
end
|
35
|
-
|
36
|
-
def run(command)
|
37
|
-
command = optionally_invoke_heroku_rake_tasks_locally(command)
|
38
|
-
|
39
|
-
output << "#{command}\n"
|
40
|
-
FileUtils.cd(@cwd) do
|
41
|
-
# The ; forces ruby to shell out so the env settings work right
|
42
|
-
cmdline = "#{environment_settings} #{command} 2>&1 ; "
|
43
|
-
logger.debug(cmdline)
|
44
|
-
result = `#{cmdline}`
|
45
|
-
logger.debug(result)
|
46
|
-
output << result
|
47
|
-
end
|
48
|
-
@status = $?
|
49
|
-
end
|
50
|
-
|
51
|
-
def optionally_invoke_heroku_rake_tasks_locally(command)
|
52
|
-
if invoke_heroku_rake_tasks_locally
|
53
|
-
command.sub(/^heroku /, '')
|
54
|
-
else
|
55
|
-
command
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
def echo(string)
|
60
|
-
logger.debug(string)
|
61
|
-
end
|
62
|
-
|
63
|
-
def flush!
|
64
|
-
@output = ""
|
65
|
-
end
|
66
|
-
|
67
|
-
def build_and_install_gem(gemspec)
|
68
|
-
pkg_dir = File.join(TEMP_DIR, 'pkg')
|
69
|
-
FileUtils.mkdir_p(pkg_dir)
|
70
|
-
output = `gem build #{gemspec} 2>&1`
|
71
|
-
gem_file = Dir.glob("*.gem").first
|
72
|
-
unless gem_file
|
73
|
-
raise "Gem didn't build:\n#{output}"
|
74
|
-
end
|
75
|
-
target = File.join(pkg_dir, gem_file)
|
76
|
-
FileUtils.mv(gem_file, target)
|
77
|
-
install_gem_to(LOCAL_GEM_ROOT, target)
|
78
|
-
end
|
79
|
-
|
80
|
-
def install_gem(gem)
|
81
|
-
install_gem_to(LOCAL_GEM_ROOT, gem)
|
82
|
-
end
|
83
|
-
|
84
|
-
def uninstall_gem(gem)
|
85
|
-
`gem uninstall -i #{LOCAL_GEM_ROOT} #{gem}`
|
86
|
-
end
|
87
|
-
|
88
|
-
def prepend_path(path)
|
89
|
-
@environment_variables['PATH'] = path + ":" + @environment_variables['PATH']
|
90
|
-
end
|
91
|
-
|
92
|
-
private
|
93
|
-
|
94
|
-
def install_gem_to(root, gem)
|
95
|
-
`gem install -i #{root} --no-ri --no-rdoc #{gem}`
|
96
|
-
end
|
97
|
-
|
98
|
-
def environment_settings
|
99
|
-
@environment_variables.map { |key, value| "#{key}=#{value}" }.join(' ')
|
100
|
-
end
|
101
|
-
|
102
|
-
def gem_bin_path
|
103
|
-
File.join(LOCAL_GEM_ROOT, "bin")
|
104
|
-
end
|
105
|
-
|
106
|
-
attr_reader :logger
|
107
|
-
end
|