honeybadger 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. data/Appraisals +20 -0
  2. data/Gemfile +1 -13
  3. data/Gemfile.lock +39 -64
  4. data/MIT-LICENSE +5 -0
  5. data/README.md +102 -3
  6. data/Rakefile +9 -134
  7. data/features/metal.feature +6 -4
  8. data/features/rack.feature +3 -4
  9. data/features/rails.feature +106 -99
  10. data/features/rake.feature +0 -2
  11. data/features/sinatra.feature +1 -3
  12. data/features/step_definitions/metal_steps.rb +2 -1
  13. data/features/step_definitions/rack_steps.rb +2 -2
  14. data/features/step_definitions/rails_steps.rb +238 -0
  15. data/features/step_definitions/rake_steps.rb +1 -1
  16. data/features/support/env.rb +7 -7
  17. data/features/support/rails.rb +41 -58
  18. data/gemfiles/rails2.3.gemfile +9 -0
  19. data/gemfiles/rails2.3.gemfile.lock +102 -0
  20. data/gemfiles/rails3.0.gemfile +8 -0
  21. data/gemfiles/rails3.0.gemfile.lock +146 -0
  22. data/gemfiles/rails3.1.gemfile +8 -0
  23. data/gemfiles/rails3.1.gemfile.lock +161 -0
  24. data/gemfiles/rails3.2.gemfile +8 -0
  25. data/gemfiles/rails3.2.gemfile.lock +160 -0
  26. data/honeybadger.gemspec +30 -24
  27. data/lib/honeybadger.rb +117 -113
  28. data/lib/honeybadger/backtrace.rb +9 -3
  29. data/lib/honeybadger/configuration.rb +22 -0
  30. data/lib/honeybadger/notice.rb +9 -0
  31. data/lib/honeybadger/rack.rb +5 -4
  32. data/lib/honeybadger/rails3_tasks.rb +20 -23
  33. data/lib/honeybadger/sender.rb +10 -4
  34. data/lib/honeybadger/shared_tasks.rb +12 -1
  35. data/lib/honeybadger/tasks.rb +6 -1
  36. data/test/test_helper.rb +71 -71
  37. data/test/unit/backtrace_test.rb +26 -23
  38. data/test/unit/capistrano_test.rb +1 -1
  39. data/test/unit/configuration_test.rb +19 -3
  40. data/test/unit/honeybadger_tasks_test.rb +1 -1
  41. data/test/unit/logger_test.rb +1 -1
  42. data/test/unit/notice_test.rb +71 -16
  43. data/test/unit/notifier_test.rb +25 -5
  44. data/test/unit/rack_test.rb +21 -1
  45. data/test/unit/rails/action_controller_catcher_test.rb +1 -1
  46. data/test/unit/rails_test.rb +1 -1
  47. data/test/unit/sender_test.rb +1 -1
  48. metadata +69 -45
  49. data/SUPPORTED_RAILS_VERSIONS +0 -37
  50. data/TESTING.md +0 -33
  51. data/features/step_definitions/file_steps.rb +0 -10
  52. data/features/step_definitions/rails_application_steps.rb +0 -394
  53. 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