errbit_fogbugz_plugin 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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7452ec5136551a36380738006e652b1230ce289e
4
+ data.tar.gz: 20e90c64505f43f4dac975322b0b629b5ba791d3
5
+ SHA512:
6
+ metadata.gz: 8d56459681b734327bf248ff187fe439a9a52511731bf18003c2eee3456a49d5989070d8283d1932b7d3804e86e6990b0a09c50a33a73f6387b18c45f58ceac9
7
+ data.tar.gz: 98324dcf63e2f8fa36c31fc31d799d82655e8bd90d173890d451ff901623a25d0cfc1169234ac4a3641d39c3ffe9ced2acdb750e9822604163d62a7789bea3b8
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ .ruby-version
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Cyril Mougel
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ # ErrbitFogbugzPlugin
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'errbit_fogbugz_plugin'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install errbit_fogbugz_plugin
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'errbit_fogbugz_plugin/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "errbit_fogbugz_plugin"
8
+ spec.version = ErrbitFogbugzPlugin::VERSION
9
+ spec.authors = ["Stephen Crosby"]
10
+ spec.email = ["stevecrozz@gmail.com"]
11
+ spec.description = %q{Fogbugz integration for Errbit}
12
+ spec.summary = %q{Fogbugz integration for Errbit}
13
+ spec.homepage = "https://github.com/brandedcrate/errbit_fogbugz_plugin"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency 'errbit_plugin', '~> 0.4', '>= 0.4.0'
22
+ spec.add_runtime_dependency 'ruby-fogbugz', '~> 0.1', '>= 0.1'
23
+
24
+ spec.add_development_dependency 'bundler', '~> 1.3'
25
+ spec.add_development_dependency 'rake', '~> 0'
26
+ end
@@ -0,0 +1,11 @@
1
+ require 'errbit_fogbugz_plugin/version'
2
+ require 'errbit_fogbugz_plugin/issue_tracker'
3
+ require 'errbit_fogbugz_plugin/rails'
4
+
5
+ module ErrbitFogbugzPlugin
6
+ def self.root
7
+ File.expand_path '../..', __FILE__
8
+ end
9
+ end
10
+
11
+ ErrbitPlugin::Registry.add_issue_tracker(ErrbitFogbugzPlugin::IssueTracker)
@@ -0,0 +1,90 @@
1
+ require 'fogbugz'
2
+
3
+ module ErrbitFogbugzPlugin
4
+ class IssueTracker < ErrbitPlugin::IssueTracker
5
+ LABEL = 'fogbugz'
6
+
7
+ NOTE = ''
8
+
9
+ FIELDS = [
10
+ [:project_id, {
11
+ :label => "Area Name"
12
+ }],
13
+ [:account, {
14
+ :label => "FogBugz URL",
15
+ :placeholder => "abc from https://abc.fogbugz.com/"
16
+ }],
17
+ [:username, {
18
+ :placeholder => "Username/Email for your account"
19
+ }],
20
+ [:password, {
21
+ :placeholder => "Password for your account"
22
+ }]
23
+ ]
24
+
25
+
26
+ def self.label
27
+ LABEL
28
+ end
29
+
30
+ def self.note
31
+ NOTE
32
+ end
33
+
34
+ def self.fields
35
+ FIELDS
36
+ end
37
+
38
+ def self.body_template
39
+ @body_template ||= ERB.new(File.read(
40
+ File.join(
41
+ ErrbitFogbugzPlugin.root, 'views', 'fogbugz_issues_body.txt.erb'
42
+ )
43
+ ))
44
+ end
45
+
46
+ def url
47
+ sprintf('https://%s.fogbugz.com', params['account'])
48
+ end
49
+
50
+ def configured?
51
+ errors.empty?
52
+ end
53
+
54
+ def comments_allowed?; false; end
55
+
56
+ def errors
57
+ errors = []
58
+ if self.class.fields.detect {|f| params[f[0].to_s].blank? }
59
+ errors << [:base, 'You must specify your FogBugz Area Name, FogBugz URL, Username, and Password']
60
+ end
61
+ errors
62
+ end
63
+
64
+ def client
65
+ fogbugz = Fogbugz::Interface.new(
66
+ :email => params['username'],
67
+ :password => params['password'],
68
+ :uri => url
69
+ )
70
+ fogbugz.authenticate
71
+ fogbugz
72
+ end
73
+
74
+ def create_issue(problem, reported_by = nil)
75
+ issue = {
76
+ 'sTitle' => "[#{ problem.environment }][#{ problem.where }] #{problem.message.to_s.truncate(100)}",
77
+ 'sArea' => params['project_id'],
78
+ 'sEvent' => self.class.body_template.result(binding),
79
+ 'sTags' => ['errbit'].join(','),
80
+ 'cols' => ['ixBug'].join(',')
81
+ }
82
+
83
+ fb_resp = client.command(:new, issue)
84
+ problem.update_attributes(
85
+ :issue_link => sprintf('%s/default.asp?%s', url, fb_resp['case']['ixBug']),
86
+ :issue_type => self.class.label
87
+ )
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,8 @@
1
+ if defined?(Rails)
2
+ module ErrbitFogbugzPlugin
3
+ module Rails
4
+ class Engine < ::Rails::Engine
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ module ErrbitFogbugzPlugin
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,29 @@
1
+ "See this exception on Errbit": <%= problem.url %>
2
+ <% if notice = problem.notices.first %>
3
+ <%= notice.message %>
4
+
5
+ Summary
6
+ - Where
7
+ <%= notice.where %>
8
+
9
+ - Occured
10
+ <%= notice.created_at.to_s(:micro) %>
11
+
12
+ - Similar
13
+ <%= (notice.problem.notices_count - 1).to_s %>
14
+
15
+ Params
16
+ <%= pretty_hash(notice.params) %>
17
+
18
+ Session
19
+ <%= pretty_hash(notice.session) %>
20
+
21
+ Backtrace
22
+ <% notice.backtrace_lines.each do |line| %><%= line.number %>: <%= line.file_relative %>
23
+ <% end %>
24
+
25
+ Environment
26
+ <% for key, val in notice.env_vars %><%= key %>: <%= val %>
27
+ <% end %>
28
+ <% end %>
29
+
metadata ADDED
@@ -0,0 +1,127 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: errbit_fogbugz_plugin
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Stephen Crosby
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: errbit_plugin
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.4'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.4.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '0.4'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 0.4.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: ruby-fogbugz
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0.1'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0.1'
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '0.1'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0.1'
53
+ - !ruby/object:Gem::Dependency
54
+ name: bundler
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '1.3'
60
+ type: :development
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: '1.3'
67
+ - !ruby/object:Gem::Dependency
68
+ name: rake
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - "~>"
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ type: :development
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ description: Fogbugz integration for Errbit
82
+ email:
83
+ - stevecrozz@gmail.com
84
+ executables: []
85
+ extensions: []
86
+ extra_rdoc_files: []
87
+ files:
88
+ - ".gitignore"
89
+ - Gemfile
90
+ - LICENSE.txt
91
+ - README.md
92
+ - Rakefile
93
+ - errbit_fogbugz_plugin.gemspec
94
+ - lib/errbit_fogbugz_plugin.rb
95
+ - lib/errbit_fogbugz_plugin/issue_tracker.rb
96
+ - lib/errbit_fogbugz_plugin/rails.rb
97
+ - lib/errbit_fogbugz_plugin/version.rb
98
+ - vendor/assets/images/fogbugz_create.png
99
+ - vendor/assets/images/fogbugz_goto.png
100
+ - vendor/assets/images/fogbugz_inactive.png
101
+ - views/fogbugz_issues_body.txt.erb
102
+ homepage: https://github.com/brandedcrate/errbit_fogbugz_plugin
103
+ licenses:
104
+ - MIT
105
+ metadata: {}
106
+ post_install_message:
107
+ rdoc_options: []
108
+ require_paths:
109
+ - lib
110
+ required_ruby_version: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ required_rubygems_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ requirements: []
121
+ rubyforge_project:
122
+ rubygems_version: 2.2.2
123
+ signing_key:
124
+ specification_version: 4
125
+ summary: Fogbugz integration for Errbit
126
+ test_files: []
127
+ has_rdoc: