bug_hunter 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
data/bug_hunter.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bug_hunter}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David A. Cuadrado"]
@@ -22,10 +22,13 @@ Gem::Specification.new do |s|
22
22
  ".document",
23
23
  ".rspec",
24
24
  "Gemfile",
25
+ "Gemfile.lock",
25
26
  "LICENSE.txt",
26
27
  "README.rdoc",
27
28
  "Rakefile",
29
+ "VERSION",
28
30
  "bin/bug_hunter",
31
+ "bug_hunter.gemspec",
29
32
  "config.ru",
30
33
  "lib/bug_hunter.rb",
31
34
  "lib/bug_hunter/app.rb",
@@ -65,6 +65,13 @@ module BugHunter
65
65
  redirect error_path(@error)
66
66
  end
67
67
 
68
+ get "/errors/:id/reopen" do
69
+ @error = BugHunter::Error.minimal.find(params[:id])
70
+ @error.unresolve!
71
+
72
+ redirect error_path(@error)
73
+ end
74
+
68
75
  get "/errors/:id/assign" do
69
76
  @error = BugHunter::Error.minimal.find(params[:id])
70
77
 
@@ -71,6 +71,14 @@ module BugHunter
71
71
  {:$inc => {:errors_resolved_count => 1}})
72
72
  end
73
73
 
74
+ def unresolve!
75
+ self.collection.update({:_id => self.id},
76
+ {:$set => {:resolved => false, :updated_at => Time.now.utc}},
77
+ {:multi => true})
78
+ BugHunter::Project.collection.update({:_id => BugHunter::Project.instance.id},
79
+ {:$inc => {:errors_resolved_count => -1}})
80
+ end
81
+
74
82
  def unique_error_selector
75
83
  msg = self[:message]
76
84
  if msg.match(/#<.+>/)
@@ -78,6 +86,7 @@ module BugHunter
78
86
  end
79
87
 
80
88
  {
89
+ :resolved => false,
81
90
  :message => msg,
82
91
  :file => self.file,
83
92
  :line => self.line,
@@ -91,8 +100,13 @@ module BugHunter
91
100
  doc[:message] = exception.message
92
101
  doc[:backtrace] = exception.backtrace
93
102
 
94
- env = env.dup.delete_if {|k,v| k.include?(".") }
95
- doc[:request_env] = env
103
+ new_env = {}
104
+ env.each do |k,v|
105
+ next if k =~ /^action_/
106
+
107
+ new_env[k.gsub(".", "_")] = v.inspect
108
+ end
109
+ doc[:request_env] = new_env
96
110
 
97
111
  scheme = if env['HTTP_VERSION'] =~ /^HTTPS/i
98
112
  "https://"
@@ -1,4 +1,10 @@
1
1
  %table
2
+ %tr
3
+ %td
4
+ %b
5
+ Status:
6
+ %td
7
+ &=@error.resolved ? "Resolved" : "Open"
2
8
  %tr
3
9
  %td
4
10
  %b
@@ -72,5 +72,9 @@
72
72
  %input(type="submit" value="Submit")
73
73
 
74
74
  -content_for :footer do
75
- %a(href="#{error_path(@error)}/resolve" data-icon="check")
76
- Resolve this error
75
+ -if @error.resolved
76
+ %a(href="#{error_path(@error)}/reopen" data-icon="check")
77
+ Reopen this error
78
+ -else
79
+ %a(href="#{error_path(@error)}/resolve" data-icon="check" data-theme="e")
80
+ Resolve this error
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
  - David A. Cuadrado
@@ -231,7 +231,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
231
231
  requirements:
232
232
  - - ">="
233
233
  - !ruby/object:Gem::Version
234
- hash: 1151554248330691171
234
+ hash: -1886083630548519524
235
235
  segments:
236
236
  - 0
237
237
  version: "0"