errbit_github_plugin 0.0.1 → 0.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7741a7f8a95adb5d10a1e7f69a70e59832dc5ec5
4
- data.tar.gz: 71de08f7e046d4db9f1285787d1daf9d159e4343
3
+ metadata.gz: 9d065fceb33bbad9df6e9df79471b912477ecc0b
4
+ data.tar.gz: cbe28f266f253f9893578f92e2df28decd5aaeb1
5
5
  SHA512:
6
- metadata.gz: ee896db4640ce263089e2e0bd5c0ae6b6f2f3679e1986d16f4429412f6ca630921cd8cee4c32cc4f7cd8f10938099adedcff352e8a383d0bb5845b6f57198221
7
- data.tar.gz: 32d93bfc6156226fcaa92e469fb26ad875dd1387afd4d556d89a362774ec0a5d1ba1ef093e1c5778d6026871f4f8ebd5e6d9b1a2504440a54d5379f17e1f75c7
6
+ metadata.gz: 64c90834ef30e02d15bfaf2d0fb7e922adb4b2768d978fc8c8ee120d0130d3afb78b27b98a7a03c5bdad425789c27153b9e718d939d48d5f4d8f047032c9d841
7
+ data.tar.gz: 01ff1b430847c82bebc1b6e58219daffd43bba58ad25086b960d215b3628ac5db3c31ac7dbcfd79613178f1a4a7e8e9264cebe12fc013c73d7b47898366aca83
@@ -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
- ErrbitPlugin::Register.add_issue_tracker(
7
- 'IssueTrackers::GithubIssuesTracker',
8
- ErrbitGithubPlugin::IssueTracker
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 check_params
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 create_issue(problem, reported_by = nil)
64
+ def github_client
65
65
  # Login using OAuth token, if given.
66
66
  if oauth_token
67
- client = Octokit::Client.new(:login => username, :oauth_token => oauth_token)
67
+ Octokit::Client.new(
68
+ :login => params['username'], :oauth_token => oauth_token)
68
69
  else
69
- client = Octokit::Client.new(:login => username, :password => password)
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 = client.create_issue(
77
+ issue = github_client.create_issue(
74
78
  project_id,
75
- issue_title(problem),
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
@@ -1,3 +1,3 @@
1
1
  module ErrbitGithubPlugin
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -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.1
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-07-25 00:00:00.000000000 Z
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