debugged-ruby 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/debugged-ruby.gemspec +0 -1
- data/lib/debugged-ruby/rack.rb +18 -0
- data/lib/debugged-ruby/version.rb +1 -1
- data/lib/debugged-ruby.rb +6 -7
- metadata +3 -3
- data/lib/debugged-ruby/rack-debugged.rb +0 -0
data/debugged-ruby.gemspec
CHANGED
@@ -9,7 +9,6 @@ Gem::Specification.new do |g|
|
|
9
9
|
g.files = Dir['lib/**/*'] + Dir['spec/**/*'] + Dir['spec/**/*'] + Dir['rails/**/*'] + Dir['tasks/**/*'] + Dir['*.rb'] + ["debugged-ruby.gemspec"]
|
10
10
|
g.homepage = 'http://www.debugged.io'
|
11
11
|
g.require_paths = ["lib"]
|
12
|
-
#gem.rubyforge_project = ''
|
13
12
|
g.requirements << "json_pure, json-jruby or json gem required"
|
14
13
|
g.requirements << "digest/sha1"
|
15
14
|
g.requirements << "httpclient"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rack'
|
3
|
+
|
4
|
+
module Rack
|
5
|
+
class Debugged
|
6
|
+
def initialize(app)
|
7
|
+
puts 'fuck'
|
8
|
+
@app = app
|
9
|
+
end
|
10
|
+
|
11
|
+
def call(env)
|
12
|
+
@app.call(env)
|
13
|
+
rescue Exception => e
|
14
|
+
::Debugged.report(e,nil)
|
15
|
+
raise(e)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/debugged-ruby.rb
CHANGED
@@ -8,12 +8,14 @@ require 'net/http'
|
|
8
8
|
require 'rubygems'
|
9
9
|
require 'eventmachine'
|
10
10
|
require 'em-http-request'
|
11
|
+
require 'rack'
|
11
12
|
|
12
13
|
module Debugged
|
13
14
|
@@api_key = nil
|
14
15
|
|
15
16
|
def self.api_key=(api_key)
|
16
17
|
@@api_key = api_key
|
18
|
+
p 'ffskfasdf'
|
17
19
|
end
|
18
20
|
|
19
21
|
def self.api_key
|
@@ -34,7 +36,7 @@ module Debugged
|
|
34
36
|
|
35
37
|
report =
|
36
38
|
{
|
37
|
-
"created_at" => time,
|
39
|
+
"created_at" => time.to_i,
|
38
40
|
"identifier" => hash,
|
39
41
|
"exception_name" => e.class.to_s,
|
40
42
|
"sdk_version" => "ruby",
|
@@ -47,6 +49,8 @@ module Debugged
|
|
47
49
|
"sdk_data" => {"ruby_version" => RUBY_VERSION.to_s,
|
48
50
|
"platform" => RUBY_PLATFORM.to_s}
|
49
51
|
}
|
52
|
+
|
53
|
+
puts report.to_json
|
50
54
|
url = "http://debugged.herokuapp.com/report"
|
51
55
|
uri = URI(url)
|
52
56
|
|
@@ -54,12 +58,10 @@ module Debugged
|
|
54
58
|
req.basic_auth @@api_key, 'pass'
|
55
59
|
req.body = report.to_json
|
56
60
|
|
57
|
-
# NOT ASYNC AS OF YET
|
58
61
|
pending = 1
|
59
62
|
EM.run do
|
60
63
|
http = EM::HttpRequest.new(url).post :body => report.to_json, :head => {'authorization' => [@@api_key, 'pass']}
|
61
64
|
http.callback {
|
62
|
-
puts http.response
|
63
65
|
pending -= 1
|
64
66
|
EM.stop if pending < 1
|
65
67
|
}
|
@@ -72,9 +74,6 @@ module Debugged
|
|
72
74
|
}
|
73
75
|
end
|
74
76
|
|
75
|
-
"debugged.herokuapp.com/report/"+hash
|
77
|
+
"debugged.herokuapp.com/report/"+hash
|
76
78
|
end
|
77
|
-
#
|
78
|
-
#response = RestClient.post url, :payload => report.to_json, :content_typ=>:json, :user => @@api_key
|
79
|
-
#puts response.body
|
80
79
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: debugged-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|
@@ -66,7 +66,7 @@ extensions: []
|
|
66
66
|
extra_rdoc_files: []
|
67
67
|
files:
|
68
68
|
- lib/debugged-ruby/config.rb
|
69
|
-
- lib/debugged-ruby/rack
|
69
|
+
- lib/debugged-ruby/rack.rb
|
70
70
|
- lib/debugged-ruby/version.rb
|
71
71
|
- lib/debugged-ruby.rb
|
72
72
|
- debugged-ruby.gemspec
|
File without changes
|