forked from errbit/errbit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request errbit#827 from stevecrozz/issue_tracker_templates
Refs errbit#785 add md and txt issue tracker templates
- Loading branch information
Showing
6 changed files
with
92 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
module HashHelper | ||
|
||
def pretty_hash(hash, nesting = 0) | ||
return '{}' if hash.empty? | ||
|
||
tab_size = 2 | ||
nesting += 1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[See this exception on Errbit](<%= app_problem_url problem.app, problem %>) | ||
<% if notice = problem.notices.first %> | ||
# <%= notice.message %> # | ||
## Summary ## | ||
<% if notice.request['url'].present? %> | ||
### URL ### | ||
[<%= notice.request['url'] %>](<%= notice.request['url'] %>)" | ||
<% end %> | ||
### Where ### | ||
<%= notice.where %> | ||
|
||
### Occured ### | ||
<%= notice.created_at.to_s(:micro) %> | ||
|
||
### Similar ### | ||
<%= (notice.problem.notices_count - 1).to_s %> | ||
|
||
## Params ## | ||
~~~ | ||
<%= pretty_hash(notice.params) %> | ||
~~~ | ||
|
||
## Session ## | ||
~~~ | ||
<%= pretty_hash(notice.session) %> | ||
~~~ | ||
|
||
## Backtrace ## | ||
~~~ | ||
<% notice.backtrace_lines.each do |line| %><%= line.number %>: <%= line.file_relative %> -> **<%= line.method %>** | ||
<% end %> | ||
~~~ | ||
|
||
<% if notice.env_vars.present? %> | ||
## Environment ## | ||
| Key | Value | | ||
|------------|------------| | ||
<% notice.env_vars.each do |key, val| %>| <%= key %> | <%= val %> | | ||
<% end %> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,21 @@ | ||
[See this exception on Errbit](<%= app_problem_url problem.app, problem %> "See this exception on Errbit") | ||
Errbit link: <%= app_problem_url problem.app, problem %> | ||
<% if notice = problem.notices.first %> | ||
# <%= notice.message %> # | ||
## Summary ## | ||
<% if notice.request['url'].present? %> | ||
### URL ### | ||
[<%= notice.request['url'] %>](<%= notice.request['url'] %>)" | ||
<% end %> | ||
### Where ### | ||
<%= notice.where %> | ||
|
||
### Occured ### | ||
<%= notice.created_at.to_s(:micro) %> | ||
|
||
### Similar ### | ||
<%= (notice.problem.notices_count - 1).to_s %> | ||
|
||
## Params ## | ||
``` | ||
<%= pretty_hash(notice.params) %> | ||
``` | ||
<% notice.message %> | ||
|
||
## Session ## | ||
``` | ||
<%= pretty_hash(notice.session) %> | ||
``` | ||
|
||
## Backtrace ## | ||
``` | ||
<% notice.backtrace_lines.each do |line| %><%= line.number %>: <%= line.file_relative %> -> **<%= line.method %>** | ||
Summary | ||
------- | ||
<% if notice.request['url'].present? %> | ||
URL: <%= notice.request['url'] %> | ||
<% end %> | ||
``` | ||
|
||
## Environment ## | ||
|
||
<table> | ||
<% for key, val in notice.env_vars %> | ||
<tr> | ||
<td><%= key %>:</td> | ||
<td><%= val %></td> | ||
</tr> | ||
Where: <%= notice.where %> | ||
Occured: <%= notice.created_at.to_s(:micro) %> | ||
Similar: <%= (notice.problem.notices_count - 1).to_s %> | ||
Params: <%= pretty_hash notice.params %> | ||
Session: <%= pretty_hash notice.session %> | ||
Env: <%= pretty_hash notice.env_vars %> | ||
|
||
Backtrace | ||
--------- | ||
<% notice.backtrace_lines.each do |line| %><%= sprintf('%5d: %s **%s', line.number, line.file_relative, line.method) %> | ||
<% end %> | ||
</table> | ||
<% end %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
describe "issue_trackers/issue.md.erb", type: 'view' do | ||
let(:problem) { | ||
problem = Fabricate(:problem) | ||
Fabricate(:notice, :err => Fabricate(:err, :problem => problem)) | ||
problem | ||
} | ||
|
||
before do | ||
allow(view).to receive(:problem).and_return(problem) | ||
end | ||
|
||
it "has the problem url" do | ||
render | ||
expect(rendered).to match(app_problem_url problem.app, problem) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
describe "issue_trackers/issue.txt.erb", type: 'view' do | ||
let(:problem) { | ||
problem = Fabricate(:problem) | ||
Fabricate(:notice, :err => Fabricate(:err, :problem => problem)) | ||
problem | ||
} | ||
|
||
before do | ||
allow(view).to receive(:problem).and_return(problem) | ||
end | ||
|
||
it "has the problem url" do | ||
render | ||
expect(rendered).to match(app_problem_url problem.app, problem) | ||
end | ||
end |