errbit_github_plugin 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d065fceb33bbad9df6e9df79471b912477ecc0b
|
4
|
+
data.tar.gz: cbe28f266f253f9893578f92e2df28decd5aaeb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64c90834ef30e02d15bfaf2d0fb7e922adb4b2768d978fc8c8ee120d0130d3afb78b27b98a7a03c5bdad425789c27153b9e718d939d48d5f4d8f047032c9d841
|
7
|
+
data.tar.gz: 01ff1b430847c82bebc1b6e58219daffd43bba58ad25086b960d215b3628ac5db3c31ac7dbcfd79613178f1a4a7e8e9264cebe12fc013c73d7b47898366aca83
|
data/lib/errbit_github_plugin.rb
CHANGED
@@ -3,7 +3,10 @@ require 'errbit_github_plugin/error'
|
|
3
3
|
require 'errbit_github_plugin/issue_tracker'
|
4
4
|
require 'errbit_github_plugin/rails'
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
module ErrbitGithubPlugin
|
7
|
+
def self.root
|
8
|
+
File.expand_path '../..', __FILE__
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
ErrbitPlugin::Registry.add_issue_tracker(ErrbitGithubPlugin::IssueTracker)
|
@@ -53,7 +53,7 @@ module ErrbitGithubPlugin
|
|
53
53
|
app.github_repo
|
54
54
|
end
|
55
55
|
|
56
|
-
def
|
56
|
+
def errors
|
57
57
|
errors = []
|
58
58
|
if self.class.fields.detect {|f| params[f[0]].blank? }
|
59
59
|
errors << [:base, 'You must specify your GitHub username and password']
|
@@ -61,18 +61,22 @@ module ErrbitGithubPlugin
|
|
61
61
|
errors
|
62
62
|
end
|
63
63
|
|
64
|
-
def
|
64
|
+
def github_client
|
65
65
|
# Login using OAuth token, if given.
|
66
66
|
if oauth_token
|
67
|
-
|
67
|
+
Octokit::Client.new(
|
68
|
+
:login => params['username'], :oauth_token => oauth_token)
|
68
69
|
else
|
69
|
-
|
70
|
+
Octokit::Client.new(
|
71
|
+
:login => params['username'], :password => params['password'])
|
70
72
|
end
|
73
|
+
end
|
71
74
|
|
75
|
+
def create_issue(problem, reported_by = nil)
|
72
76
|
begin
|
73
|
-
issue =
|
77
|
+
issue = github_client.create_issue(
|
74
78
|
project_id,
|
75
|
-
|
79
|
+
"[#{ problem.environment }][#{ problem.where }] #{problem.message.to_s.truncate(100)}",
|
76
80
|
self.class.body_template.result(binding).unpack('C*').pack('U*')
|
77
81
|
)
|
78
82
|
@url = issue.html_url
|
@@ -0,0 +1,45 @@
|
|
1
|
+
[See this exception on Errbit](<%= problem.url %> "See this exception on Errbit")
|
2
|
+
<% if notice = problem.notices.first %>
|
3
|
+
# <%= notice.message %> #
|
4
|
+
## Summary ##
|
5
|
+
<% if notice.request['url'].present? %>
|
6
|
+
### URL ###
|
7
|
+
[<%= notice.request['url'] %>](<%= notice.request['url'] %>)"
|
8
|
+
<% end %>
|
9
|
+
### Where ###
|
10
|
+
<%= notice.where %>
|
11
|
+
|
12
|
+
### Occured ###
|
13
|
+
<%= notice.created_at.to_s(:micro) %>
|
14
|
+
|
15
|
+
### Similar ###
|
16
|
+
<%= (notice.problem.notices_count - 1).to_s %>
|
17
|
+
|
18
|
+
## Params ##
|
19
|
+
```
|
20
|
+
<%= pretty_hash(notice.params) %>
|
21
|
+
```
|
22
|
+
|
23
|
+
## Session ##
|
24
|
+
```
|
25
|
+
<%= pretty_hash(notice.session) %>
|
26
|
+
```
|
27
|
+
|
28
|
+
## Backtrace ##
|
29
|
+
```
|
30
|
+
<% notice.backtrace_lines.each do |line| %><%= line.number %>: <%= line.file_relative %> -> **<%= line.method %>**
|
31
|
+
<% end %>
|
32
|
+
```
|
33
|
+
|
34
|
+
## Environment ##
|
35
|
+
|
36
|
+
<table>
|
37
|
+
<% for key, val in notice.env_vars %>
|
38
|
+
<tr>
|
39
|
+
<td><%= key %>:</td>
|
40
|
+
<td><%= val %></td>
|
41
|
+
</tr>
|
42
|
+
<% end %>
|
43
|
+
</table>
|
44
|
+
<% end %>
|
45
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: errbit_github_plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Crosby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: errbit_plugin
|
@@ -86,6 +86,7 @@ files:
|
|
86
86
|
- lib/errbit_github_plugin/version.rb
|
87
87
|
- vendor/assets/images/github_create.png
|
88
88
|
- vendor/assets/images/github_inactive.png
|
89
|
+
- views/github_issues_body.txt.erb
|
89
90
|
homepage: https://github.com/brandedcrate/errbit_github_plugin
|
90
91
|
licenses:
|
91
92
|
- MIT
|