errbit_pivotal_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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7ffa429178835f0e8bb3ed86249bf230297fb404
4
+ data.tar.gz: d0532168e9d987e1b065d1795c72184eddc2713c
5
+ SHA512:
6
+ metadata.gz: 75763c6dbc144a2ed9f13ec9e6e1fcdf9746004ab81447f49c48d5c7c9630ec920956df60a20ac688befd36cdd8cb39046f583bf2bc422d20c861cf13c3c124d
7
+ data.tar.gz: 60e0dc39d400c5f00b82a17ed676bdd71cb1582cf8502744cc22e9c17977dc9da7086b7d6be9a25b7b46d0cf5bc8b61240b27a53d79a28adb9af95f29afaab1c
data/.gitignore ADDED
@@ -0,0 +1,17 @@
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
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.1.1
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE.txt ADDED
@@ -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.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # ErrbitPivotalPlugin
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'errbit_pivotal_plugin'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install errbit_pivotal_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
data/Rakefile ADDED
@@ -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_pivotal_plugin/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "errbit_pivotal_plugin"
8
+ spec.version = ErrbitPivotalPlugin::VERSION
9
+ spec.authors = ["Stephen Crosby"]
10
+ spec.email = ["stevecrozz@gmail.com"]
11
+ spec.description = %q{Pivotal integration for Errbit}
12
+ spec.summary = %q{Pivotal integration for Errbit}
13
+ spec.homepage = "https://github.com/brandedcrate/errbit_pivotal_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 'pivotal-tracker', '~> 0.5', '>= 0.5.0'
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_pivotal_plugin/version'
2
+ require 'errbit_pivotal_plugin/issue_tracker'
3
+ require 'errbit_pivotal_plugin/rails'
4
+
5
+ module ErrbitPivotalPlugin
6
+ def self.root
7
+ File.expand_path '../..', __FILE__
8
+ end
9
+ end
10
+
11
+ ErrbitPlugin::Registry.add_issue_tracker(ErrbitPivotalPlugin::IssueTracker)
@@ -0,0 +1,80 @@
1
+ require 'pivotal-tracker'
2
+
3
+ module ErrbitPivotalPlugin
4
+ class IssueTracker < ErrbitPlugin::IssueTracker
5
+
6
+ LABEL = 'pivotal'
7
+
8
+ NOTE = 'You can find your project\'s ID in the URL when you are ' <<
9
+ 'viewing a project in pivotal.'
10
+
11
+ FIELDS = {
12
+ :api_token => {
13
+ :placeholder => 'API Token for your account'
14
+ },
15
+ :project_id => {
16
+ :label => 'Project ID',
17
+ :placeholder => 'Project ID (e.g. 1185196)'
18
+ }
19
+ }
20
+
21
+ def self.label
22
+ LABEL
23
+ end
24
+
25
+ def self.note
26
+ NOTE
27
+ end
28
+
29
+ def self.fields
30
+ FIELDS
31
+ end
32
+
33
+ def self.body_template
34
+ @body_template ||= ERB.new(File.read(
35
+ File.join(
36
+ ErrbitPivotalPlugin.root, 'views', 'pivotal_issues_body.txt.erb'
37
+ )
38
+ ))
39
+ end
40
+
41
+ def url
42
+ "https://www.pivotaltracker.com/"
43
+ end
44
+
45
+ def configured?
46
+ params['project_id'].present? && params['api_token'].present?
47
+ end
48
+
49
+ def comments_allowed?; false; end
50
+
51
+ def errors
52
+ errors = []
53
+ if self.class.fields.detect {|f| params[f[0]].blank? }
54
+ errors << [:base, 'You must specify your Pivotal Tracker API token and Project ID']
55
+ end
56
+ errors
57
+ end
58
+
59
+ def create_issue(problem, reported_by = nil)
60
+ PivotalTracker::Client.token = params['api_token']
61
+ PivotalTracker::Client.use_ssl = true
62
+ project = PivotalTracker::Project.find params['project_id'].to_i
63
+ story = project.stories.create({
64
+ :name => "[#{ problem.environment }][#{ problem.where }] #{problem.message.to_s.truncate(100)}",
65
+ :story_type => 'bug',
66
+ :description => self.class.body_template.result(binding).unpack('C*').pack('U*'),
67
+ :requested_by => reported_by.name
68
+ })
69
+
70
+ if story.errors.present?
71
+ raise IssueTrackers::IssueTrackerError, story.errors.first
72
+ else
73
+ problem.update_attributes(
74
+ :issue_link => "https://www.pivotaltracker.com/story/show/#{story.id}",
75
+ :issue_type => self.class.label
76
+ )
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,8 @@
1
+ if defined?(Rails)
2
+ module ErrbitPivotalPlugin
3
+ module Rails
4
+ class Engine < ::Rails::Engine
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ module ErrbitPivotalPlugin
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,16 @@
1
+ See this exception on Errbit: <%= problem.url %>
2
+ <% if notice = problem.notices.first %>
3
+ <% if notice.request['url'].present? %>*URL:* <%= notice.request['url'] %><% end %>
4
+ *Where*: <%= notice.where %>
5
+ *Occurred*: <%= notice.created_at.to_s :micro %>
6
+ *Similar*: <%= (notice.problem.notices_count - 1).to_s %>
7
+
8
+ *Params*
9
+ <%= pretty_hash notice.params %>
10
+
11
+ *Session*
12
+ <%= pretty_hash notice.session %>
13
+
14
+ *Backtrace*
15
+ <%= notice.backtrace_lines[0..4].map { |line| "#{line.number}: #{line.file_relative} -> *#{line.method}*" }.join "\n" %>
16
+ <% end %>
metadata ADDED
@@ -0,0 +1,128 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: errbit_pivotal_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-10 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: pivotal-tracker
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0.5'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 0.5.0
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '0.5'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 0.5.0
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: Pivotal integration for Errbit
82
+ email:
83
+ - stevecrozz@gmail.com
84
+ executables: []
85
+ extensions: []
86
+ extra_rdoc_files: []
87
+ files:
88
+ - ".gitignore"
89
+ - ".ruby-version"
90
+ - Gemfile
91
+ - LICENSE.txt
92
+ - README.md
93
+ - Rakefile
94
+ - errbit_pivotal_plugin.gemspec
95
+ - lib/errbit_pivotal_plugin.rb
96
+ - lib/errbit_pivotal_plugin/issue_tracker.rb
97
+ - lib/errbit_pivotal_plugin/rails.rb
98
+ - lib/errbit_pivotal_plugin/version.rb
99
+ - vendor/assets/images/pivotal_create.png
100
+ - vendor/assets/images/pivotal_goto.png
101
+ - vendor/assets/images/pivotal_inactive.png
102
+ - views/pivotal_issues_body.txt.erb
103
+ homepage: https://github.com/brandedcrate/errbit_pivotal_plugin
104
+ licenses:
105
+ - MIT
106
+ metadata: {}
107
+ post_install_message:
108
+ rdoc_options: []
109
+ require_paths:
110
+ - lib
111
+ required_ruby_version: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ required_rubygems_version: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ requirements: []
122
+ rubyforge_project:
123
+ rubygems_version: 2.2.2
124
+ signing_key:
125
+ specification_version: 4
126
+ summary: Pivotal integration for Errbit
127
+ test_files: []
128
+ has_rdoc: