bullhorn 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -19,3 +19,4 @@ rdoc
19
19
  pkg
20
20
 
21
21
  ## PROJECT::SPECIFIC
22
+ .rvmrc
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -0,0 +1,140 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{bullhorn}
8
+ s.version = "0.0.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Cyril David"]
12
+ s.date = %q{2010-05-16}
13
+ s.description = %q{drop in rack middleware for bullhorn.it}
14
+ s.email = %q{cyx.ucron@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "bullhorn.gemspec",
27
+ "examples/foobar/README",
28
+ "examples/foobar/Rakefile",
29
+ "examples/foobar/app/controllers/application_controller.rb",
30
+ "examples/foobar/app/controllers/raiser_controller.rb",
31
+ "examples/foobar/app/helpers/application_helper.rb",
32
+ "examples/foobar/app/helpers/raiser_helper.rb",
33
+ "examples/foobar/config/boot.rb",
34
+ "examples/foobar/config/database.yml",
35
+ "examples/foobar/config/environment.rb",
36
+ "examples/foobar/config/environments/development.rb",
37
+ "examples/foobar/config/environments/production.rb",
38
+ "examples/foobar/config/environments/test.rb",
39
+ "examples/foobar/config/initializers/backtrace_silencers.rb",
40
+ "examples/foobar/config/initializers/bullhorn.rb",
41
+ "examples/foobar/config/initializers/inflections.rb",
42
+ "examples/foobar/config/initializers/mime_types.rb",
43
+ "examples/foobar/config/initializers/new_rails_defaults.rb",
44
+ "examples/foobar/config/initializers/session_store.rb",
45
+ "examples/foobar/config/locales/en.yml",
46
+ "examples/foobar/config/routes.rb",
47
+ "examples/foobar/db/seeds.rb",
48
+ "examples/foobar/doc/README_FOR_APP",
49
+ "examples/foobar/log/development.log",
50
+ "examples/foobar/log/production.log",
51
+ "examples/foobar/log/server.log",
52
+ "examples/foobar/log/test.log",
53
+ "examples/foobar/public/404.html",
54
+ "examples/foobar/public/422.html",
55
+ "examples/foobar/public/500.html",
56
+ "examples/foobar/public/favicon.ico",
57
+ "examples/foobar/public/images/rails.png",
58
+ "examples/foobar/public/index.html",
59
+ "examples/foobar/public/javascripts/application.js",
60
+ "examples/foobar/public/javascripts/controls.js",
61
+ "examples/foobar/public/javascripts/dragdrop.js",
62
+ "examples/foobar/public/javascripts/effects.js",
63
+ "examples/foobar/public/javascripts/prototype.js",
64
+ "examples/foobar/public/robots.txt",
65
+ "examples/foobar/script/about",
66
+ "examples/foobar/script/console",
67
+ "examples/foobar/script/dbconsole",
68
+ "examples/foobar/script/destroy",
69
+ "examples/foobar/script/generate",
70
+ "examples/foobar/script/performance/benchmarker",
71
+ "examples/foobar/script/performance/profiler",
72
+ "examples/foobar/script/plugin",
73
+ "examples/foobar/script/runner",
74
+ "examples/foobar/script/server",
75
+ "examples/foobar/test/functional/raiser_controller_test.rb",
76
+ "examples/foobar/test/performance/browsing_test.rb",
77
+ "examples/foobar/test/test_helper.rb",
78
+ "examples/foobar/test/unit/helpers/raiser_helper_test.rb",
79
+ "lib/bullhorn.rb",
80
+ "lib/bullhorn/plugin.rb",
81
+ "lib/bullhorn/sender.rb",
82
+ "test/helper.rb",
83
+ "test/test_bullhorn.rb",
84
+ "test/test_bullhorn_plugin.rb"
85
+ ]
86
+ s.homepage = %q{http://github.com/sinefunc/bullhorn}
87
+ s.rdoc_options = ["--charset=UTF-8"]
88
+ s.require_paths = ["lib"]
89
+ s.rubygems_version = %q{1.3.6}
90
+ s.summary = %q{rack middleware client for bullhorn.it}
91
+ s.test_files = [
92
+ "test/helper.rb",
93
+ "test/test_bullhorn.rb",
94
+ "test/test_bullhorn_plugin.rb",
95
+ "examples/foobar/app/controllers/application_controller.rb",
96
+ "examples/foobar/app/controllers/raiser_controller.rb",
97
+ "examples/foobar/app/helpers/application_helper.rb",
98
+ "examples/foobar/app/helpers/raiser_helper.rb",
99
+ "examples/foobar/config/boot.rb",
100
+ "examples/foobar/config/environment.rb",
101
+ "examples/foobar/config/environments/development.rb",
102
+ "examples/foobar/config/environments/production.rb",
103
+ "examples/foobar/config/environments/test.rb",
104
+ "examples/foobar/config/initializers/backtrace_silencers.rb",
105
+ "examples/foobar/config/initializers/bullhorn.rb",
106
+ "examples/foobar/config/initializers/inflections.rb",
107
+ "examples/foobar/config/initializers/mime_types.rb",
108
+ "examples/foobar/config/initializers/new_rails_defaults.rb",
109
+ "examples/foobar/config/initializers/session_store.rb",
110
+ "examples/foobar/config/routes.rb",
111
+ "examples/foobar/db/seeds.rb",
112
+ "examples/foobar/test/functional/raiser_controller_test.rb",
113
+ "examples/foobar/test/performance/browsing_test.rb",
114
+ "examples/foobar/test/test_helper.rb",
115
+ "examples/foobar/test/unit/helpers/raiser_helper_test.rb"
116
+ ]
117
+
118
+ if s.respond_to? :specification_version then
119
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
120
+ s.specification_version = 3
121
+
122
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
123
+ s.add_development_dependency(%q<contest>, [">= 0"])
124
+ s.add_development_dependency(%q<mocha>, [">= 0"])
125
+ s.add_development_dependency(%q<rack-test>, [">= 0"])
126
+ s.add_development_dependency(%q<fakeweb>, [">= 0"])
127
+ else
128
+ s.add_dependency(%q<contest>, [">= 0"])
129
+ s.add_dependency(%q<mocha>, [">= 0"])
130
+ s.add_dependency(%q<rack-test>, [">= 0"])
131
+ s.add_dependency(%q<fakeweb>, [">= 0"])
132
+ end
133
+ else
134
+ s.add_dependency(%q<contest>, [">= 0"])
135
+ s.add_dependency(%q<mocha>, [">= 0"])
136
+ s.add_dependency(%q<rack-test>, [">= 0"])
137
+ s.add_dependency(%q<fakeweb>, [">= 0"])
138
+ end
139
+ end
140
+
@@ -3,12 +3,13 @@ require 'uri'
3
3
  require 'base64'
4
4
  require 'json'
5
5
  require 'cgi'
6
+ require 'digest/sha1'
6
7
 
7
8
  class Bullhorn
8
9
  autoload :Plugin, "bullhorn/plugin"
9
10
  autoload :Sender, "bullhorn/sender"
10
11
 
11
- VERSION = "0.0.1"
12
+ VERSION = "0.0.2"
12
13
 
13
14
  URL = "http://bullhorn.it/api/v1/exception"
14
15
 
@@ -38,4 +39,4 @@ class Bullhorn
38
39
 
39
40
  [status, headers, body]
40
41
  end
41
- end
42
+ end
@@ -3,7 +3,7 @@ class Bullhorn
3
3
  extend self
4
4
 
5
5
  def serialize(str)
6
- str # CGI.escape(Base64.encode64(str.to_json).strip)
6
+ CGI.escape(Base64.encode64(str.to_json).strip)
7
7
  end
8
8
 
9
9
  def notify(exception, env)
@@ -12,7 +12,8 @@ class Bullhorn
12
12
  :message => exception.message,
13
13
  :backtrace => serialize(exception.backtrace),
14
14
  :env => serialize(whitelist(env)),
15
- :request_body => serialize(whitelist(request_body(env)))
15
+ :request_body => serialize(whitelist(request_body(env))),
16
+ :sha1 => sha1(exception)
16
17
  })
17
18
  end
18
19
 
@@ -53,5 +54,9 @@ class Bullhorn
53
54
  end
54
55
  end
55
56
  end
57
+
58
+ def sha1(exception)
59
+ Digest::SHA1.hexdigest(exception.message + exception.backtrace.inspect)
60
+ end
56
61
  end
57
- end
62
+ end
@@ -50,7 +50,8 @@ class TestBullhorn < Test::Unit::TestCase
50
50
  :message => 'Fail!!!',
51
51
  :backtrace => Bullhorn::Sender.serialize(['line1', 'line2']),
52
52
  :env => Bullhorn::Sender.serialize("params" => "a&b", "rack.input" => io.inspect),
53
- :request_body => Bullhorn::Sender.serialize("FooBar")
53
+ :request_body => Bullhorn::Sender.serialize("FooBar"),
54
+ :sha1 => Digest::SHA1.hexdigest("Fail!!!" + ['line1', 'line2'].inspect)
54
55
  }
55
56
 
56
57
  Net::HTTP.expects(:post_form).with() { |u, hash|
@@ -87,7 +88,8 @@ class TestBullhorn < Test::Unit::TestCase
87
88
  :backtrace => Bullhorn::Sender.serialize(['line1', 'line2']),
88
89
  :env => Bullhorn::Sender.serialize("params" => "password=[FILTERED]&user[password]=[FILTERED]",
89
90
  "rack.input" => io.inspect),
90
- :request_body => Bullhorn::Sender.serialize("password=[FILTERED]&user[password]=[FILTERED]")
91
+ :request_body => Bullhorn::Sender.serialize("password=[FILTERED]&user[password]=[FILTERED]"),
92
+ :sha1 => Digest::SHA1.hexdigest("Fail!!!" + ['line1', 'line2'].inspect)
91
93
  }
92
94
 
93
95
  Net::HTTP.expects(:post_form).with() { |u, hash|
@@ -101,4 +103,4 @@ class TestBullhorn < Test::Unit::TestCase
101
103
  end
102
104
  end
103
105
  end
104
- end
106
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Cyril David
@@ -81,6 +81,7 @@ files:
81
81
  - README.rdoc
82
82
  - Rakefile
83
83
  - VERSION
84
+ - bullhorn.gemspec
84
85
  - examples/foobar/README
85
86
  - examples/foobar/Rakefile
86
87
  - examples/foobar/app/controllers/application_controller.rb