whoops 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@ module EventsHelper
5
5
  when Array then "<ul class='array'>#{detail.collect{|d| "<li>- #{format_detail(d)}</li>" }.join}</ul>".html_safe
6
6
  when Hash then detail_table(detail)
7
7
  else
8
- detail.to_s
8
+ detail.to_s.html_safe
9
9
  end
10
10
  end
11
11
 
@@ -1,5 +1,3 @@
1
- # This class is meant to be overwritten in host applications
2
- #
3
1
  # Authorized Service Lookups interact with filters to limit the
4
2
  # services which a user is allowed to see. This allows host
5
3
  # applications to more easily implement authorization.
@@ -2,4 +2,4 @@
2
2
  - detail.to_a.sort{|a,b| a[0] <=> b[0]}.each do |sub_detail|
3
3
  %li
4
4
  %span.key= sub_detail.first + ":"
5
- = format_detail(sub_detail.last).html_safe
5
+ = format_detail(sub_detail.last)
metadata CHANGED
@@ -1,182 +1,174 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: whoops
3
- version: !ruby/object:Gem::Version
4
- version: 0.5.3
3
+ version: !ruby/object:Gem::Version
4
+ hash: 3
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 5
9
+ - 4
10
+ version: 0.5.4
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Daniel Higginbotham
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-12-06 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2012-12-18 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: rails
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: '3'
22
- type: :runtime
23
22
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
23
+ requirement: &id001 !ruby/object:Gem::Requirement
25
24
  none: false
26
- requirements:
25
+ requirements:
27
26
  - - ~>
28
- - !ruby/object:Gem::Version
29
- version: '3'
30
- - !ruby/object:Gem::Dependency
31
- name: sass
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: '0'
27
+ - !ruby/object:Gem::Version
28
+ hash: 5
29
+ segments:
30
+ - 3
31
+ version: "3"
38
32
  type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: sass
39
36
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
46
- - !ruby/object:Gem::Dependency
47
- name: haml
48
- requirement: !ruby/object:Gem::Requirement
37
+ requirement: &id002 !ruby/object:Gem::Requirement
49
38
  none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ hash: 3
43
+ segments:
44
+ - 0
45
+ version: "0"
54
46
  type: :runtime
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: haml
55
50
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
51
+ requirement: &id003 !ruby/object:Gem::Requirement
57
52
  none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- - !ruby/object:Gem::Dependency
63
- name: mongo
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: '0'
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
59
+ version: "0"
70
60
  type: :runtime
61
+ version_requirements: *id003
62
+ - !ruby/object:Gem::Dependency
63
+ name: mongo
71
64
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
78
- - !ruby/object:Gem::Dependency
79
- name: mongoid
80
- requirement: !ruby/object:Gem::Requirement
65
+ requirement: &id004 !ruby/object:Gem::Requirement
81
66
  none: false
82
- requirements:
83
- - - ~>
84
- - !ruby/object:Gem::Version
85
- version: '2.4'
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ hash: 3
71
+ segments:
72
+ - 0
73
+ version: "0"
86
74
  type: :runtime
75
+ version_requirements: *id004
76
+ - !ruby/object:Gem::Dependency
77
+ name: mongoid
87
78
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
79
+ requirement: &id005 !ruby/object:Gem::Requirement
89
80
  none: false
90
- requirements:
81
+ requirements:
91
82
  - - ~>
92
- - !ruby/object:Gem::Version
93
- version: '2.4'
94
- - !ruby/object:Gem::Dependency
95
- name: kaminari
96
- requirement: !ruby/object:Gem::Requirement
97
- none: false
98
- requirements:
99
- - - ! '>='
100
- - !ruby/object:Gem::Version
101
- version: '0'
83
+ - !ruby/object:Gem::Version
84
+ hash: 11
85
+ segments:
86
+ - 2
87
+ - 4
88
+ version: "2.4"
102
89
  type: :runtime
90
+ version_requirements: *id005
91
+ - !ruby/object:Gem::Dependency
92
+ name: kaminari
103
93
  prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
94
+ requirement: &id006 !ruby/object:Gem::Requirement
105
95
  none: false
106
- requirements:
107
- - - ! '>='
108
- - !ruby/object:Gem::Version
109
- version: '0'
110
- - !ruby/object:Gem::Dependency
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ hash: 3
100
+ segments:
101
+ - 0
102
+ version: "0"
103
+ type: :runtime
104
+ version_requirements: *id006
105
+ - !ruby/object:Gem::Dependency
111
106
  name: rspec-rails
112
- requirement: !ruby/object:Gem::Requirement
113
- none: false
114
- requirements:
115
- - - ! '>='
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
107
  prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
- requirements:
123
- - - ! '>='
124
- - !ruby/object:Gem::Version
125
- version: '0'
126
- - !ruby/object:Gem::Dependency
127
- name: fabrication
128
- requirement: !ruby/object:Gem::Requirement
108
+ requirement: &id007 !ruby/object:Gem::Requirement
129
109
  none: false
130
- requirements:
131
- - - ! '>='
132
- - !ruby/object:Gem::Version
133
- version: '0'
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ hash: 3
114
+ segments:
115
+ - 0
116
+ version: "0"
134
117
  type: :development
118
+ version_requirements: *id007
119
+ - !ruby/object:Gem::Dependency
120
+ name: fabrication
135
121
  prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
122
+ requirement: &id008 !ruby/object:Gem::Requirement
137
123
  none: false
138
- requirements:
139
- - - ! '>='
140
- - !ruby/object:Gem::Version
141
- version: '0'
142
- - !ruby/object:Gem::Dependency
143
- name: faker
144
- requirement: !ruby/object:Gem::Requirement
145
- none: false
146
- requirements:
147
- - - ! '>='
148
- - !ruby/object:Gem::Version
149
- version: '0'
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ hash: 3
128
+ segments:
129
+ - 0
130
+ version: "0"
150
131
  type: :development
132
+ version_requirements: *id008
133
+ - !ruby/object:Gem::Dependency
134
+ name: faker
151
135
  prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
- requirements:
155
- - - ! '>='
156
- - !ruby/object:Gem::Version
157
- version: '0'
158
- - !ruby/object:Gem::Dependency
159
- name: capybara
160
- requirement: !ruby/object:Gem::Requirement
136
+ requirement: &id009 !ruby/object:Gem::Requirement
161
137
  none: false
162
- requirements:
163
- - - ! '>='
164
- - !ruby/object:Gem::Version
165
- version: 0.4.0
138
+ requirements:
139
+ - - ">="
140
+ - !ruby/object:Gem::Version
141
+ hash: 3
142
+ segments:
143
+ - 0
144
+ version: "0"
166
145
  type: :development
146
+ version_requirements: *id009
147
+ - !ruby/object:Gem::Dependency
148
+ name: capybara
167
149
  prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
150
+ requirement: &id010 !ruby/object:Gem::Requirement
169
151
  none: false
170
- requirements:
171
- - - ! '>='
172
- - !ruby/object:Gem::Version
152
+ requirements:
153
+ - - ">="
154
+ - !ruby/object:Gem::Version
155
+ hash: 15
156
+ segments:
157
+ - 0
158
+ - 4
159
+ - 0
173
160
  version: 0.4.0
161
+ type: :development
162
+ version_requirements: *id010
174
163
  description: A Rails engine which receives logs and provides an interface for them
175
164
  email:
176
165
  executables: []
166
+
177
167
  extensions: []
168
+
178
169
  extra_rdoc_files: []
179
- files:
170
+
171
+ files:
180
172
  - app/assets/javascripts/jquery-1.5.2.min.js
181
173
  - app/assets/javascripts/whoops.js
182
174
  - app/assets/stylesheets/autocomplete.scss
@@ -203,7 +195,6 @@ files:
203
195
  - app/helpers/notifications_helper.rb
204
196
  - app/lib/field_names.rb
205
197
  - app/mailers/whoops/notification_mailer.rb
206
- - app/models/whoops/#new_event.rb#
207
198
  - app/models/whoops/authorized_service_lookup.rb
208
199
  - app/models/whoops/event.rb
209
200
  - app/models/whoops/event_group.rb
@@ -233,26 +224,36 @@ files:
233
224
  - README.asciidoc
234
225
  homepage: http://www.whoopsapp.com
235
226
  licenses: []
227
+
236
228
  post_install_message:
237
229
  rdoc_options: []
238
- require_paths:
230
+
231
+ require_paths:
239
232
  - lib
240
- required_ruby_version: !ruby/object:Gem::Requirement
233
+ required_ruby_version: !ruby/object:Gem::Requirement
241
234
  none: false
242
- requirements:
243
- - - ! '>='
244
- - !ruby/object:Gem::Version
245
- version: '0'
246
- required_rubygems_version: !ruby/object:Gem::Requirement
235
+ requirements:
236
+ - - ">="
237
+ - !ruby/object:Gem::Version
238
+ hash: 3
239
+ segments:
240
+ - 0
241
+ version: "0"
242
+ required_rubygems_version: !ruby/object:Gem::Requirement
247
243
  none: false
248
- requirements:
249
- - - ! '>='
250
- - !ruby/object:Gem::Version
251
- version: '0'
244
+ requirements:
245
+ - - ">="
246
+ - !ruby/object:Gem::Version
247
+ hash: 3
248
+ segments:
249
+ - 0
250
+ version: "0"
252
251
  requirements: []
252
+
253
253
  rubyforge_project:
254
254
  rubygems_version: 1.8.24
255
255
  signing_key:
256
256
  specification_version: 3
257
257
  summary: A Rails engine which receives logs and provides an interface for them
258
258
  test_files: []
259
+
@@ -1,55 +0,0 @@
1
- # Receives new event params and processes them
2
- class Whoops::NewEvent
3
- def initialize(params)
4
- @params = params.with_indifferent_access
5
- end
6
-
7
- # both records and sends notifications
8
- def record!
9
- find_or_build_event_group
10
- update_event_group_attributes
11
- send_notifications_for_event_group
12
-
13
- @event_group.archived = false
14
- @event_group.save
15
- @event_group.events.create(event_params)
16
- @event_group
17
- end
18
-
19
- private
20
-
21
- def find_or_build_event_group
22
- @event_group = Whoops::EventGroup.first(:conditions => event_group_identifying_fields) || Whoops::EventGroup.new(event_group_params)
23
- end
24
-
25
- def update_event_group_attributes
26
- if @event_group.valid?
27
- @event_group.attributes = event_group_params
28
- @event_group.last_recorded_at = Time.now
29
- @event_group.event_count += 1
30
- end
31
- end
32
-
33
- def should_send_notifications?
34
- @event_group.valid? && (@event_group.archived || @event_group.new_record) && Rails.application.config.whoops_sender
35
- end
36
-
37
- def send_notifications_for_event_group
38
- return unless should_send_notifications?
39
- matcher = Whoops::NotificationSubscription::Matcher.new(@event_group)
40
- Whoops::NotificationMailer.event_notification(@event_group, matcher.matching_emails).deliver unless matcher.matching_emails.empty?
41
- end
42
-
43
- # TODO does it make sense to have a separate params object?
44
- def event_group_params
45
- @params.slice(*Whoops::EventGroup.field_names)
46
- end
47
-
48
- def event_group_identifying_fields
49
- @params.slice(*Whoops::EventGroup.identifying_fields)
50
- end
51
-
52
- def event_params
53
- @params.slice(*Whoops::Event.field_names)
54
- end
55
- end