asana_exception_notifier 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.codeclimate.yml +26 -0
- data/.reek +11 -0
- data/.rubocop.yml +76 -0
- data/.travis.yml +16 -0
- data/CONTRIBUTING.md +46 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +180 -0
- data/LICENSE +20 -0
- data/README.md +225 -0
- data/Rakefile +37 -0
- data/asana_exception_notifier.gemspec +48 -0
- data/examples/sinatra/Gemfile +7 -0
- data/examples/sinatra/Gemfile.lock +124 -0
- data/examples/sinatra/Procfile +1 -0
- data/examples/sinatra/README.md +14 -0
- data/examples/sinatra/config.ru +3 -0
- data/examples/sinatra/sinatra_app.rb +46 -0
- data/init.rb +1 -0
- data/lib/asana_exception_notifier/classes/asana.rb +95 -0
- data/lib/asana_exception_notifier/classes/error_page.rb +134 -0
- data/lib/asana_exception_notifier/helpers/application_helper.rb +286 -0
- data/lib/asana_exception_notifier/initializers/zip.rb +14 -0
- data/lib/asana_exception_notifier/note_templates/asana_exception_notifier.html.erb +82 -0
- data/lib/asana_exception_notifier/note_templates/asana_exception_notifier.text.erb +24 -0
- data/lib/asana_exception_notifier/request/client.rb +85 -0
- data/lib/asana_exception_notifier/request/core.rb +132 -0
- data/lib/asana_exception_notifier/request/middleware.rb +41 -0
- data/lib/asana_exception_notifier/version.rb +27 -0
- data/lib/asana_exception_notifier.rb +45 -0
- data/lib/generators/asana_exception_notifier/install_generator.rb +14 -0
- data/lib/generators/asana_exception_notifier/templates/asana_exception_notifier.rb +20 -0
- data/spec/lib/asana_exception_notifier/classes/asana_spec.rb +23 -0
- data/spec/spec_helper.rb +45 -0
- data/spec/test_notification.rb +20 -0
- metadata +467 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 280cdf0b6dca9817e839af8680186847618fb62d
|
4
|
+
data.tar.gz: e762aa0e5e07af7636be397bb0e2595e0a880d48
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 40d1ae01172fea7925e49ddeb897584fdf295816739666a0fe1b4ccb2733287c685a193e20c7f1e943fabd7bf852d1994ae68ab78b5ce8ae3b731251a85d7ffe
|
7
|
+
data.tar.gz: 5cca1aa0d350e023d82ad406b4a05b0393071655f3126aef6809020cdff25567636734124803b36cab9a0bea94235d3733d3296a681bf6e684579380e7b11aca
|
data/.codeclimate.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
engines:
|
3
|
+
bundler-audit:
|
4
|
+
enabled: false
|
5
|
+
csslint:
|
6
|
+
enabled: false
|
7
|
+
eslint:
|
8
|
+
enabled: false
|
9
|
+
fixme:
|
10
|
+
enabled: true
|
11
|
+
rubocop:
|
12
|
+
enabled: true
|
13
|
+
ratings:
|
14
|
+
paths:
|
15
|
+
- Gemfile.lock
|
16
|
+
- "**.css"
|
17
|
+
- "**.js"
|
18
|
+
- "**.jsx"
|
19
|
+
- "**.rb"
|
20
|
+
exclude_paths:
|
21
|
+
- spec/**/*
|
22
|
+
- examples/**/*
|
23
|
+
- test/**/*
|
24
|
+
- vendor/**/*
|
25
|
+
- bin/**/*
|
26
|
+
- .codeclimate.yml
|
data/.reek
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- washout_builder.gemspec
|
4
|
+
- bin/**/*
|
5
|
+
- Guardfile
|
6
|
+
- vendor/**/*
|
7
|
+
- examples/**/*
|
8
|
+
TargetRubyVersion: 2.1
|
9
|
+
|
10
|
+
ClassLength:
|
11
|
+
Max: 500
|
12
|
+
|
13
|
+
ModuleLength:
|
14
|
+
Max: 500
|
15
|
+
|
16
|
+
Documentation:
|
17
|
+
Enabled: true
|
18
|
+
|
19
|
+
Encoding:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
LineLength:
|
23
|
+
Max: 200
|
24
|
+
|
25
|
+
AccessModifierIndentation:
|
26
|
+
EnforcedStyle: outdent
|
27
|
+
|
28
|
+
IfUnlessModifier:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
CaseIndentation:
|
32
|
+
IndentWhenRelativeTo: case
|
33
|
+
IndentOneStep: true
|
34
|
+
|
35
|
+
MethodLength:
|
36
|
+
CountComments: false
|
37
|
+
Max: 20
|
38
|
+
|
39
|
+
SignalException:
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
ColonMethodCall:
|
43
|
+
Enabled: false
|
44
|
+
|
45
|
+
AsciiComments:
|
46
|
+
Enabled: false
|
47
|
+
|
48
|
+
RegexpLiteral:
|
49
|
+
Enabled: false
|
50
|
+
|
51
|
+
AssignmentInCondition:
|
52
|
+
Enabled: false
|
53
|
+
|
54
|
+
ParameterLists:
|
55
|
+
CountKeywordArgs: false
|
56
|
+
|
57
|
+
SingleLineBlockParams:
|
58
|
+
Methods:
|
59
|
+
- reduce:
|
60
|
+
- memo
|
61
|
+
- item
|
62
|
+
|
63
|
+
Metrics/AbcSize:
|
64
|
+
Enabled: false
|
65
|
+
|
66
|
+
Style/CollectionMethods:
|
67
|
+
Enabled: true
|
68
|
+
|
69
|
+
Style/SymbolArray:
|
70
|
+
Enabled: true
|
71
|
+
|
72
|
+
Style/ExtraSpacing:
|
73
|
+
Enabled: true
|
74
|
+
|
75
|
+
Style/FileName:
|
76
|
+
Enabled: false
|
data/.travis.yml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
sudo: false
|
2
|
+
cache: bundler
|
3
|
+
language: ruby
|
4
|
+
before_install:
|
5
|
+
- "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
|
6
|
+
- gem install bundler
|
7
|
+
rvm:
|
8
|
+
- 1.9.3
|
9
|
+
- 2.0.0
|
10
|
+
- 2.1.5
|
11
|
+
- 2.2.2
|
12
|
+
- 2.2.3
|
13
|
+
env:
|
14
|
+
- RAILS_ENV=test RACK_ENV=test
|
15
|
+
notifications:
|
16
|
+
email: false
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
Contributing
|
2
|
+
============
|
3
|
+
|
4
|
+
We love pull requests. Here's a quick guide.
|
5
|
+
|
6
|
+
Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
7
|
+
|
8
|
+
Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
9
|
+
|
10
|
+
Fork, then clone the repo:
|
11
|
+
|
12
|
+
```
|
13
|
+
git clone git@github.com:your-username/asana_exception_notifier.git
|
14
|
+
```
|
15
|
+
|
16
|
+
Start a feature/bugfix branch.
|
17
|
+
|
18
|
+
Set up your machine:
|
19
|
+
|
20
|
+
```
|
21
|
+
bundle install
|
22
|
+
```
|
23
|
+
|
24
|
+
Make sure the tests pass:
|
25
|
+
|
26
|
+
```
|
27
|
+
bundle exec rake
|
28
|
+
```
|
29
|
+
|
30
|
+
Make your change. Add tests for your change. Make the tests pass:
|
31
|
+
|
32
|
+
```
|
33
|
+
bundle exec rake
|
34
|
+
```
|
35
|
+
|
36
|
+
Push to your fork and [submit a pull request](https://github.com/bogdanRada/asana_exception_notifier/compare).
|
37
|
+
|
38
|
+
At this point you're waiting on us. We like to at least comment on pull requests within three business days (and, typically, one business day). We may suggest some changes or improvements or alternatives.
|
39
|
+
|
40
|
+
Some things that will increase the chance that your pull request is accepted:
|
41
|
+
|
42
|
+
- Write tests.
|
43
|
+
- Try to follow this [style guide](https://github.com/thoughtbot/guides/tree/master/style).
|
44
|
+
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
|
45
|
+
|
46
|
+
Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,180 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
asana_exception_notifier (0.0.1)
|
5
|
+
activesupport (>= 4.0, < 5)
|
6
|
+
em-http-request (~> 1.1, >= 1.1.2)
|
7
|
+
eventmachine (~> 1.0, >= 1.0.7)
|
8
|
+
exception_notification (~> 4.1, >= 4.1.4)
|
9
|
+
multipart_body (~> 0.2, >= 0.2.1)
|
10
|
+
rack (~> 1.6, >= 1.6)
|
11
|
+
rubyzip (~> 1.0, >= 1.0.0)
|
12
|
+
sys-uname (~> 1.0, >= 1.0.2)
|
13
|
+
tilt (>= 1.4, < 3)
|
14
|
+
zip-zip (~> 0.3, >= 0.3)
|
15
|
+
|
16
|
+
GEM
|
17
|
+
remote: http://rubygems.org/
|
18
|
+
specs:
|
19
|
+
actionmailer (4.2.5.1)
|
20
|
+
actionpack (= 4.2.5.1)
|
21
|
+
actionview (= 4.2.5.1)
|
22
|
+
activejob (= 4.2.5.1)
|
23
|
+
mail (~> 2.5, >= 2.5.4)
|
24
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
25
|
+
actionpack (4.2.5.1)
|
26
|
+
actionview (= 4.2.5.1)
|
27
|
+
activesupport (= 4.2.5.1)
|
28
|
+
rack (~> 1.6)
|
29
|
+
rack-test (~> 0.6.2)
|
30
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
31
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
32
|
+
actionview (4.2.5.1)
|
33
|
+
activesupport (= 4.2.5.1)
|
34
|
+
builder (~> 3.1)
|
35
|
+
erubis (~> 2.7.0)
|
36
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
37
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
38
|
+
activejob (4.2.5.1)
|
39
|
+
activesupport (= 4.2.5.1)
|
40
|
+
globalid (>= 0.3.0)
|
41
|
+
activesupport (4.2.5.1)
|
42
|
+
i18n (~> 0.7)
|
43
|
+
json (~> 1.7, >= 1.7.7)
|
44
|
+
minitest (~> 5.1)
|
45
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
46
|
+
tzinfo (~> 1.1)
|
47
|
+
addressable (2.4.0)
|
48
|
+
builder (3.2.2)
|
49
|
+
coderay (1.1.0)
|
50
|
+
colored (1.2)
|
51
|
+
cookiejar (0.3.0)
|
52
|
+
coveralls (0.8.10)
|
53
|
+
json (~> 1.8)
|
54
|
+
rest-client (>= 1.6.8, < 2)
|
55
|
+
simplecov (~> 0.11.0)
|
56
|
+
term-ansicolor (~> 1.3)
|
57
|
+
thor (~> 0.19.1)
|
58
|
+
tins (~> 1.6.0)
|
59
|
+
diff-lcs (1.2.5)
|
60
|
+
docile (1.1.5)
|
61
|
+
domain_name (0.5.25)
|
62
|
+
unf (>= 0.0.5, < 1.0.0)
|
63
|
+
em-http-request (1.1.3)
|
64
|
+
addressable (>= 2.3.4)
|
65
|
+
cookiejar (<= 0.3.0)
|
66
|
+
em-socksify (>= 0.3)
|
67
|
+
eventmachine (>= 1.0.3)
|
68
|
+
http_parser.rb (>= 0.6.0)
|
69
|
+
em-socksify (0.3.1)
|
70
|
+
eventmachine (>= 1.0.0.beta.4)
|
71
|
+
erubis (2.7.0)
|
72
|
+
eventmachine (1.0.9.1)
|
73
|
+
exception_notification (4.1.4)
|
74
|
+
actionmailer (~> 4.0)
|
75
|
+
activesupport (~> 4.0)
|
76
|
+
ffi (1.9.10)
|
77
|
+
github-markup (1.4.0)
|
78
|
+
globalid (0.3.6)
|
79
|
+
activesupport (>= 4.1.0)
|
80
|
+
http-cookie (1.0.2)
|
81
|
+
domain_name (~> 0.5)
|
82
|
+
http_parser.rb (0.6.0)
|
83
|
+
i18n (0.7.0)
|
84
|
+
inch (0.7.0)
|
85
|
+
pry
|
86
|
+
sparkr (>= 0.2.0)
|
87
|
+
term-ansicolor
|
88
|
+
yard (~> 0.8.7.5)
|
89
|
+
json (1.8.3)
|
90
|
+
loofah (2.0.3)
|
91
|
+
nokogiri (>= 1.5.9)
|
92
|
+
mail (2.6.3)
|
93
|
+
mime-types (>= 1.16, < 3)
|
94
|
+
method_source (0.8.2)
|
95
|
+
mime-types (2.99)
|
96
|
+
mini_portile2 (2.0.0)
|
97
|
+
minitest (5.8.4)
|
98
|
+
multipart_body (0.2.1)
|
99
|
+
netrc (0.11.0)
|
100
|
+
nokogiri (1.6.7.2)
|
101
|
+
mini_portile2 (~> 2.0.0.rc2)
|
102
|
+
pry (0.10.3)
|
103
|
+
coderay (~> 1.1.0)
|
104
|
+
method_source (~> 0.8.1)
|
105
|
+
slop (~> 3.4)
|
106
|
+
rack (1.6.4)
|
107
|
+
rack-test (0.6.3)
|
108
|
+
rack (>= 1.0)
|
109
|
+
rails-deprecated_sanitizer (1.0.3)
|
110
|
+
activesupport (>= 4.2.0.alpha)
|
111
|
+
rails-dom-testing (1.0.7)
|
112
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
113
|
+
nokogiri (~> 1.6.0)
|
114
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
115
|
+
rails-html-sanitizer (1.0.3)
|
116
|
+
loofah (~> 2.0)
|
117
|
+
rake (10.5.0)
|
118
|
+
redcarpet (3.3.4)
|
119
|
+
rest-client (1.8.0)
|
120
|
+
http-cookie (>= 1.0.2, < 2.0)
|
121
|
+
mime-types (>= 1.16, < 3.0)
|
122
|
+
netrc (~> 0.7)
|
123
|
+
rspec (3.4.0)
|
124
|
+
rspec-core (~> 3.4.0)
|
125
|
+
rspec-expectations (~> 3.4.0)
|
126
|
+
rspec-mocks (~> 3.4.0)
|
127
|
+
rspec-core (3.4.1)
|
128
|
+
rspec-support (~> 3.4.0)
|
129
|
+
rspec-expectations (3.4.0)
|
130
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
131
|
+
rspec-support (~> 3.4.0)
|
132
|
+
rspec-mocks (3.4.1)
|
133
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
134
|
+
rspec-support (~> 3.4.0)
|
135
|
+
rspec-support (3.4.1)
|
136
|
+
rubyzip (1.1.7)
|
137
|
+
simplecov (0.11.1)
|
138
|
+
docile (~> 1.1.0)
|
139
|
+
json (~> 1.8)
|
140
|
+
simplecov-html (~> 0.10.0)
|
141
|
+
simplecov-html (0.10.0)
|
142
|
+
simplecov-summary (0.0.4)
|
143
|
+
colored
|
144
|
+
simplecov
|
145
|
+
slop (3.6.0)
|
146
|
+
sparkr (0.4.1)
|
147
|
+
sys-uname (1.0.2)
|
148
|
+
ffi (>= 1.0.0)
|
149
|
+
term-ansicolor (1.3.2)
|
150
|
+
tins (~> 1.0)
|
151
|
+
thor (0.19.1)
|
152
|
+
thread_safe (0.3.5)
|
153
|
+
tilt (2.0.2)
|
154
|
+
tins (1.6.0)
|
155
|
+
tzinfo (1.2.2)
|
156
|
+
thread_safe (~> 0.1)
|
157
|
+
unf (0.1.4)
|
158
|
+
unf_ext
|
159
|
+
unf_ext (0.0.7.1)
|
160
|
+
yard (0.8.7.6)
|
161
|
+
zip-zip (0.3)
|
162
|
+
rubyzip (>= 1.0.0)
|
163
|
+
|
164
|
+
PLATFORMS
|
165
|
+
ruby
|
166
|
+
|
167
|
+
DEPENDENCIES
|
168
|
+
asana_exception_notifier!
|
169
|
+
coveralls (~> 0.7, >= 0.7)
|
170
|
+
github-markup (~> 1.3, >= 1.3.3)
|
171
|
+
inch (~> 0.6, >= 0.6)
|
172
|
+
rake (~> 10.5, >= 10.5)
|
173
|
+
redcarpet (~> 3.3, >= 3.3)
|
174
|
+
rspec (~> 3.4, >= 3.4)
|
175
|
+
simplecov (~> 0.10, >= 0.10)
|
176
|
+
simplecov-summary (~> 0.0.4, >= 0.0.4)
|
177
|
+
yard (~> 0.8, >= 0.8.7)
|
178
|
+
|
179
|
+
BUNDLED WITH
|
180
|
+
1.11.2
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2016 bogdanRada
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,225 @@
|
|
1
|
+
asana_exception_notifier
|
2
|
+
========================
|
3
|
+
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/asana_exception_notifier.svg)](http://badge.fury.io/rb/asana_exception_notifier) [![Gem Downloads](https://ruby-gem-downloads-badge.herokuapp.com/asana_exception_notifier?type=total)](https://github.com/bogdanRada/asana_exception_notifier) [![Analytics](https://ga-beacon.appspot.com/UA-72570203-1/bogdanRada/asana_exception_notifier)](https://github.com/bogdanRada/asana_exception_notifier)
|
5
|
+
|
6
|
+
Description
|
7
|
+
-----------
|
8
|
+
|
9
|
+
Simple ruby implementation to send notifications to Asana when a exception happens in Rails or Rack-based apps by creating a task and uploading exception details to the task
|
10
|
+
|
11
|
+
The gem provides a notifier for sending notifications to Asana when errors occur in a Rack/Rails application [courtesy of exception_notifications gem](https://github.com/smartinez87/exception_notifications). Check out that gem for more details on setting up the rack middleware with additional options.
|
12
|
+
|
13
|
+
Requirements
|
14
|
+
------------
|
15
|
+
|
16
|
+
- Ruby 2.0 or greater
|
17
|
+
- Rails 4.0 or greater, Sinatra or another Rack-based application.
|
18
|
+
|
19
|
+
Dependencies
|
20
|
+
------------
|
21
|
+
|
22
|
+
1. [ActiveSuport > 4.0](https://rubygems.org/gems/activesupport)
|
23
|
+
2. [em-http-request >= 1.1.0](https://github.com/igrigorik/em-http-request)
|
24
|
+
3. [eventmachine >= 1.0.7](https://github.com/eventmachine/eventmachine)
|
25
|
+
4. [exception_notification >= 4.1.4](https://github.com/smartinez87/exception_notification)
|
26
|
+
5. [multipart_body >= 0.2.1](https://github.com/cloudmailin/multipart_body)
|
27
|
+
6. [tilt >= 1.4](https://github.com/rtomayko/tilt/)
|
28
|
+
7. [rack >= 1.6](http://rack.github.io/)
|
29
|
+
8. [rubyzip >= 1.0.0](https://github.com/rubyzip/rubyzip)
|
30
|
+
9. [zip-zip >= 0.3](https://github.com/orien/zip-zip)
|
31
|
+
10. [sys-uname >= 1.0.2](https://github.com/djberg96/sys-uname)
|
32
|
+
|
33
|
+
Installation Instructions
|
34
|
+
-------------------------
|
35
|
+
|
36
|
+
Add the following to your Gemfile :
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
gem "asana_exception_notifier"
|
40
|
+
```
|
41
|
+
|
42
|
+
#### Options: For more options to this check [here](https://asana.com/developers/api-reference/tasks)
|
43
|
+
|
44
|
+
##### asana_api_key
|
45
|
+
|
46
|
+
*String, required*
|
47
|
+
|
48
|
+
Your Personal Access Token from Asana. You can get it from [here](https://app.asana.com/-/account_api). Please make sure you keep the token secret, and don't commit it in your repository. I suggest to put it into an environment variable and use it from that variable.
|
49
|
+
|
50
|
+
##### workspace
|
51
|
+
|
52
|
+
*Integer, required*
|
53
|
+
|
54
|
+
The workspace ID where the task will be created.
|
55
|
+
|
56
|
+
**If you don't supply the workspace or the asana_api_key flags , the notifier will not run!!!**
|
57
|
+
|
58
|
+
##### assignee
|
59
|
+
|
60
|
+
*String, optional*
|
61
|
+
|
62
|
+
Who will be assigned by default to the task that is going to be created. (Default: 'me'). Can be disabled by setting it to NIL value
|
63
|
+
|
64
|
+
##### assignee_status
|
65
|
+
|
66
|
+
*String, optional*
|
67
|
+
|
68
|
+
Scheduling status of this task for the user it is assigned to. This field can only be set if the assignee is non-null. (Default: 'today'). Can be disabled by setting it to NIL value.
|
69
|
+
|
70
|
+
##### due_at
|
71
|
+
|
72
|
+
*Time, optional*
|
73
|
+
|
74
|
+
Date and time on which this task is due, or null if the task has no due time. This takes a UTC timestamp and should not be used together with due_on. Default ( Time.now.iso8601)
|
75
|
+
|
76
|
+
##### due_on
|
77
|
+
|
78
|
+
*Time, optional*
|
79
|
+
|
80
|
+
Date on which this task is due, or null if the task has no due date. This takes a date with YYYY-MM-DD format and should not be used together with due_at
|
81
|
+
|
82
|
+
##### hearted
|
83
|
+
|
84
|
+
*Boolean, optional*
|
85
|
+
|
86
|
+
True if the task is hearted by the authorized user, false if not (Default: false).
|
87
|
+
|
88
|
+
##### hearts
|
89
|
+
|
90
|
+
*Array, optional*
|
91
|
+
|
92
|
+
Array of users who will heart the task after creation. (Default: []).
|
93
|
+
|
94
|
+
##### projects
|
95
|
+
|
96
|
+
*Array, optional*
|
97
|
+
|
98
|
+
Array of projects this task is associated with. At task creation time, this array can be used to add the task to many projects at once.(Default: []).
|
99
|
+
|
100
|
+
##### followers
|
101
|
+
|
102
|
+
*Array, optional*
|
103
|
+
|
104
|
+
Array of users following this task. (Default: []).
|
105
|
+
|
106
|
+
##### memberships
|
107
|
+
|
108
|
+
*Array, optional*
|
109
|
+
|
110
|
+
Array of projects this task is associated with and the section it is in. At task creation time, this array can be used to add the task to specific sections.Note that over time, more types of memberships may be added to this property.(Default: []).
|
111
|
+
|
112
|
+
##### tags
|
113
|
+
|
114
|
+
*Array, optional*
|
115
|
+
|
116
|
+
Array of tags associated with this task. This property may be specified on creation using just an array of existing tag IDs. (Default: false).
|
117
|
+
|
118
|
+
##### name
|
119
|
+
|
120
|
+
*String, optional*
|
121
|
+
|
122
|
+
Name of the task. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer. (Default: "[AsanaExceptionNotifier] %Exception Class Name%").
|
123
|
+
|
124
|
+
##### notes
|
125
|
+
|
126
|
+
*String, optional*
|
127
|
+
|
128
|
+
More detailed, free-form textual information associated with the task. (Default: '')
|
129
|
+
|
130
|
+
##### template_path
|
131
|
+
|
132
|
+
*Array, optional*
|
133
|
+
|
134
|
+
This can be used to override the default template when rendering the exception details with customized template.
|
135
|
+
|
136
|
+
### Rails
|
137
|
+
|
138
|
+
If you are settting up for the first time this gem, just run the following command from the terminal:
|
139
|
+
|
140
|
+
```
|
141
|
+
rails g asana_exception_notifier:install
|
142
|
+
```
|
143
|
+
|
144
|
+
This command generates an initialize file (`config/initializers/asana_exception_notifier.rb`) where you can customize your configurations.
|
145
|
+
|
146
|
+
Make sure the gem is not listed solely under the `production` group, since this initializer will be loaded regardless of environment.
|
147
|
+
|
148
|
+
AsanaExceptionNotifier is used as a rack middleware, or in the environment you want it to run. In most cases you would want AsanaExceptionNotifier to run on production. Thus, you can make it work by putting the following lines in your `config/environments/production.rb`:
|
149
|
+
|
150
|
+
```ruby
|
151
|
+
Rails.application.config.middleware.use ExceptionNotification::Rack
|
152
|
+
```
|
153
|
+
|
154
|
+
### Rack/Sinatra
|
155
|
+
|
156
|
+
In order to use ExceptionNotification with Sinatra, please take a look in the [example application](https://github.com/smartinez87/exception_notification/tree/master/examples/sinatra).
|
157
|
+
|
158
|
+
Background Notifications
|
159
|
+
------------------------
|
160
|
+
|
161
|
+
If you want to send notifications from a background process like DelayedJob, you should use the `notify_exception` method like this:
|
162
|
+
|
163
|
+
```ruby
|
164
|
+
begin
|
165
|
+
some code...
|
166
|
+
rescue => exception
|
167
|
+
ExceptionNotifier.notify_exception(exception, notifiers: :asana)
|
168
|
+
end
|
169
|
+
```
|
170
|
+
|
171
|
+
You can include information about the background process that created the error by including a data parameter:
|
172
|
+
|
173
|
+
```ruby
|
174
|
+
begin
|
175
|
+
some code...
|
176
|
+
rescue => exception
|
177
|
+
ExceptionNotifier.notify_exception(exception,
|
178
|
+
:data => {:worker => worker.to_s, :queue => queue, :payload => payload}, notifiers: :asana)
|
179
|
+
end
|
180
|
+
```
|
181
|
+
|
182
|
+
### Manually notify of exception
|
183
|
+
|
184
|
+
If your controller action manually handles an error, the notifier will never be run. To manually notify of an error you can do something like the following:
|
185
|
+
|
186
|
+
```ruby
|
187
|
+
rescue_from Exception, :with => :server_error
|
188
|
+
|
189
|
+
def server_error(exception)
|
190
|
+
# Whatever code that handles the exception
|
191
|
+
|
192
|
+
ExceptionNotifier.notify_exception(exception,
|
193
|
+
:env => request.env, :data => {:message => "was doing something wrong"}, notifiers: :asana)
|
194
|
+
end
|
195
|
+
```
|
196
|
+
|
197
|
+
Testing
|
198
|
+
-------
|
199
|
+
|
200
|
+
To test, do the following:
|
201
|
+
|
202
|
+
1. cd to the gem root.
|
203
|
+
2. bundle install
|
204
|
+
3. bundle exec rake
|
205
|
+
|
206
|
+
Contributions
|
207
|
+
-------------
|
208
|
+
|
209
|
+
Please log all feedback/issues via [Github Issues](http://github.com/bogdanRada/asana_exception_notifier/issues). Thanks.
|
210
|
+
|
211
|
+
Contributing to asana_exception_notifier
|
212
|
+
----------------------------------------
|
213
|
+
|
214
|
+
- Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
215
|
+
- Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
216
|
+
- Fork the project.
|
217
|
+
- Start a feature/bugfix branch.
|
218
|
+
- Commit and push until you are happy with your contribution.
|
219
|
+
- Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
220
|
+
- Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
221
|
+
- You can read more details about contributing in the [Contributing](https://github.com/bogdanRada/asana_exception_notifier/blob/master/CONTRIBUTING.md) document
|
222
|
+
|
223
|
+
== Copyright
|
224
|
+
|
225
|
+
Copyright (c) 2016 bogdanRada. See LICENSE.txt for further details.
|