bugsify 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 14517552fa77ab0f3223d16146a1f73bee88cdf16acad2385891c5df0c9db362
4
+ data.tar.gz: 4641664b93a5d12434cad5e3033f528ba02997d08415e6f1777b26da18dec322
5
+ SHA512:
6
+ metadata.gz: e1dc9c90d6619196ccddc86eb05ec5f555b6996c9e66a0e32b746f884f02c8e64260bdf8859aa249a82f256ac45d44424e50d20c34ac49931a60195c8819b477
7
+ data.tar.gz: 1197180e153c21b48d318fa0af21883dfa6cb9e42787b0d560d6931cf338ce641fc38e12f34ba1540676d4e5f395e6e28d4c15c90d3b9807dda7c4a28efbdf76
data/.irbrc ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "awesome_print"
4
+
5
+ AwesomePrint.irb!
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,14 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+ NewCops: enable
4
+
5
+ Style/StringLiterals:
6
+ Enabled: true
7
+ EnforcedStyle: double_quotes
8
+
9
+ Style/StringLiteralsInInterpolation:
10
+ Enabled: true
11
+ EnforcedStyle: double_quotes
12
+
13
+ Layout/LineLength:
14
+ Max: 120
data/.solargraph.yml ADDED
@@ -0,0 +1,22 @@
1
+ ---
2
+ include:
3
+ - "**/*.rb"
4
+ exclude:
5
+ - spec/**/*
6
+ - test/**/*
7
+ - vendor/**/*
8
+ - ".bundle/**/*"
9
+ require: []
10
+ domains: []
11
+ reporters:
12
+ - rubocop
13
+ - require_not_found
14
+ formatter:
15
+ rubocop:
16
+ cops: safe
17
+ except: []
18
+ only: []
19
+ extra_args: []
20
+ require_paths: []
21
+ plugins: []
22
+ max_files: 5000
@@ -0,0 +1,15 @@
1
+ {
2
+ "files.trimTrailingWhitespace": true,
3
+ "editor.wordWrap": "off",
4
+ "editor.tabSize": 2,
5
+ "editor.autoIndent": "advanced",
6
+ "editor.rulers": [80, 100, 120],
7
+ "editor.renderWhitespace": "all",
8
+ "editor.formatOnSave": true,
9
+ "[ruby]": {
10
+ "editor.formatOnSave": true
11
+ },
12
+ "files.exclude": {
13
+ "**/.git": true
14
+ }
15
+ }
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-07-31
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at aleksandar.popovic@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in bugsify.gemspec
6
+ gemspec
7
+
8
+ gem "awesome_print", "~> 1.9", ">= 1.9.2"
9
+ gem "debug", "~> 1.6", ">= 1.6.2"
10
+ gem "padrino", "~> 0.15.1"
11
+ gem "rails", "~> 7.0", ">= 7.0.3.1"
12
+ gem "rake", "~> 13.0"
13
+ gem "rspec", "~> 3.0"
14
+ gem "rubocop", "~> 1.21"
15
+ gem "sinatra", "~> 2.2", ">= 2.2.2"
16
+ gem "solargraph"
data/Gemfile.lock ADDED
@@ -0,0 +1,281 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ bugsify (1.0.2)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ actioncable (7.0.4)
10
+ actionpack (= 7.0.4)
11
+ activesupport (= 7.0.4)
12
+ nio4r (~> 2.0)
13
+ websocket-driver (>= 0.6.1)
14
+ actionmailbox (7.0.4)
15
+ actionpack (= 7.0.4)
16
+ activejob (= 7.0.4)
17
+ activerecord (= 7.0.4)
18
+ activestorage (= 7.0.4)
19
+ activesupport (= 7.0.4)
20
+ mail (>= 2.7.1)
21
+ net-imap
22
+ net-pop
23
+ net-smtp
24
+ actionmailer (7.0.4)
25
+ actionpack (= 7.0.4)
26
+ actionview (= 7.0.4)
27
+ activejob (= 7.0.4)
28
+ activesupport (= 7.0.4)
29
+ mail (~> 2.5, >= 2.5.4)
30
+ net-imap
31
+ net-pop
32
+ net-smtp
33
+ rails-dom-testing (~> 2.0)
34
+ actionpack (7.0.4)
35
+ actionview (= 7.0.4)
36
+ activesupport (= 7.0.4)
37
+ rack (~> 2.0, >= 2.2.0)
38
+ rack-test (>= 0.6.3)
39
+ rails-dom-testing (~> 2.0)
40
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
41
+ actiontext (7.0.4)
42
+ actionpack (= 7.0.4)
43
+ activerecord (= 7.0.4)
44
+ activestorage (= 7.0.4)
45
+ activesupport (= 7.0.4)
46
+ globalid (>= 0.6.0)
47
+ nokogiri (>= 1.8.5)
48
+ actionview (7.0.4)
49
+ activesupport (= 7.0.4)
50
+ builder (~> 3.1)
51
+ erubi (~> 1.4)
52
+ rails-dom-testing (~> 2.0)
53
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
54
+ activejob (7.0.4)
55
+ activesupport (= 7.0.4)
56
+ globalid (>= 0.3.6)
57
+ activemodel (7.0.4)
58
+ activesupport (= 7.0.4)
59
+ activerecord (7.0.4)
60
+ activemodel (= 7.0.4)
61
+ activesupport (= 7.0.4)
62
+ activestorage (7.0.4)
63
+ actionpack (= 7.0.4)
64
+ activejob (= 7.0.4)
65
+ activerecord (= 7.0.4)
66
+ activesupport (= 7.0.4)
67
+ marcel (~> 1.0)
68
+ mini_mime (>= 1.1.0)
69
+ activesupport (7.0.4)
70
+ concurrent-ruby (~> 1.0, >= 1.0.2)
71
+ i18n (>= 1.6, < 2)
72
+ minitest (>= 5.1)
73
+ tzinfo (~> 2.0)
74
+ ast (2.4.2)
75
+ awesome_print (1.9.2)
76
+ backport (1.2.0)
77
+ benchmark (0.2.0)
78
+ builder (3.2.4)
79
+ concurrent-ruby (1.1.10)
80
+ crass (1.0.6)
81
+ debug (1.6.3)
82
+ irb (>= 1.3.6)
83
+ reline (>= 0.3.1)
84
+ diff-lcs (1.5.0)
85
+ e2mmap (0.1.0)
86
+ erubi (1.11.0)
87
+ globalid (1.0.0)
88
+ activesupport (>= 5.0)
89
+ i18n (1.12.0)
90
+ concurrent-ruby (~> 1.0)
91
+ io-console (0.5.11)
92
+ irb (1.4.2)
93
+ reline (>= 0.3.0)
94
+ jaro_winkler (1.5.4)
95
+ json (2.6.2)
96
+ kramdown (2.4.0)
97
+ rexml
98
+ kramdown-parser-gfm (1.1.0)
99
+ kramdown (~> 2.0)
100
+ loofah (2.19.0)
101
+ crass (~> 1.0.2)
102
+ nokogiri (>= 1.5.9)
103
+ mail (2.7.1)
104
+ mini_mime (>= 0.1.1)
105
+ marcel (1.0.2)
106
+ method_source (1.0.0)
107
+ mime-types (3.4.1)
108
+ mime-types-data (~> 3.2015)
109
+ mime-types-data (3.2022.0105)
110
+ mini_mime (1.1.2)
111
+ minitest (5.16.3)
112
+ moneta (1.1.1)
113
+ mustermann (2.0.2)
114
+ ruby2_keywords (~> 0.0.1)
115
+ net-imap (0.3.1)
116
+ net-protocol
117
+ net-pop (0.1.2)
118
+ net-protocol
119
+ net-protocol (0.1.3)
120
+ timeout
121
+ net-smtp (0.3.3)
122
+ net-protocol
123
+ nio4r (2.5.8)
124
+ nokogiri (1.13.9-arm64-darwin)
125
+ racc (~> 1.4)
126
+ nokogiri (1.13.9-x86_64-linux)
127
+ racc (~> 1.4)
128
+ padrino (0.15.1)
129
+ padrino-admin (= 0.15.1)
130
+ padrino-cache (= 0.15.1)
131
+ padrino-core (= 0.15.1)
132
+ padrino-gen (= 0.15.1)
133
+ padrino-helpers (= 0.15.1)
134
+ padrino-mailer (= 0.15.1)
135
+ padrino-support (= 0.15.1)
136
+ padrino-admin (0.15.1)
137
+ padrino-core (= 0.15.1)
138
+ padrino-helpers (= 0.15.1)
139
+ padrino-cache (0.15.1)
140
+ moneta (~> 1.1.0)
141
+ padrino-core (= 0.15.1)
142
+ padrino-helpers (= 0.15.1)
143
+ padrino-core (0.15.1)
144
+ padrino-support (= 0.15.1)
145
+ sinatra (>= 2.0.0)
146
+ thor (~> 1.0)
147
+ padrino-gen (0.15.1)
148
+ bundler (>= 1.0, < 3)
149
+ padrino-core (= 0.15.1)
150
+ padrino-helpers (0.15.1)
151
+ i18n (>= 0.6.7, < 2)
152
+ padrino-support (= 0.15.1)
153
+ tilt (>= 1.4.1, < 3)
154
+ padrino-mailer (0.15.1)
155
+ mail (~> 2.5)
156
+ mime-types (< 4)
157
+ padrino-core (= 0.15.1)
158
+ padrino-support (0.15.1)
159
+ parallel (1.22.1)
160
+ parser (3.1.2.1)
161
+ ast (~> 2.4.1)
162
+ racc (1.6.0)
163
+ rack (2.2.4)
164
+ rack-protection (2.2.2)
165
+ rack
166
+ rack-test (2.0.2)
167
+ rack (>= 1.3)
168
+ rails (7.0.4)
169
+ actioncable (= 7.0.4)
170
+ actionmailbox (= 7.0.4)
171
+ actionmailer (= 7.0.4)
172
+ actionpack (= 7.0.4)
173
+ actiontext (= 7.0.4)
174
+ actionview (= 7.0.4)
175
+ activejob (= 7.0.4)
176
+ activemodel (= 7.0.4)
177
+ activerecord (= 7.0.4)
178
+ activestorage (= 7.0.4)
179
+ activesupport (= 7.0.4)
180
+ bundler (>= 1.15.0)
181
+ railties (= 7.0.4)
182
+ rails-dom-testing (2.0.3)
183
+ activesupport (>= 4.2.0)
184
+ nokogiri (>= 1.6)
185
+ rails-html-sanitizer (1.4.3)
186
+ loofah (~> 2.3)
187
+ railties (7.0.4)
188
+ actionpack (= 7.0.4)
189
+ activesupport (= 7.0.4)
190
+ method_source
191
+ rake (>= 12.2)
192
+ thor (~> 1.0)
193
+ zeitwerk (~> 2.5)
194
+ rainbow (3.1.1)
195
+ rake (13.0.6)
196
+ regexp_parser (2.6.0)
197
+ reline (0.3.1)
198
+ io-console (~> 0.5)
199
+ reverse_markdown (2.1.1)
200
+ nokogiri
201
+ rexml (3.2.5)
202
+ rspec (3.12.0)
203
+ rspec-core (~> 3.12.0)
204
+ rspec-expectations (~> 3.12.0)
205
+ rspec-mocks (~> 3.12.0)
206
+ rspec-core (3.12.0)
207
+ rspec-support (~> 3.12.0)
208
+ rspec-expectations (3.12.0)
209
+ diff-lcs (>= 1.2.0, < 2.0)
210
+ rspec-support (~> 3.12.0)
211
+ rspec-mocks (3.12.0)
212
+ diff-lcs (>= 1.2.0, < 2.0)
213
+ rspec-support (~> 3.12.0)
214
+ rspec-support (3.12.0)
215
+ rubocop (1.38.0)
216
+ json (~> 2.3)
217
+ parallel (~> 1.10)
218
+ parser (>= 3.1.2.1)
219
+ rainbow (>= 2.2.2, < 4.0)
220
+ regexp_parser (>= 1.8, < 3.0)
221
+ rexml (>= 3.2.5, < 4.0)
222
+ rubocop-ast (>= 1.23.0, < 2.0)
223
+ ruby-progressbar (~> 1.7)
224
+ unicode-display_width (>= 1.4.0, < 3.0)
225
+ rubocop-ast (1.23.0)
226
+ parser (>= 3.1.1.0)
227
+ ruby-progressbar (1.11.0)
228
+ ruby2_keywords (0.0.5)
229
+ sinatra (2.2.2)
230
+ mustermann (~> 2.0)
231
+ rack (~> 2.2)
232
+ rack-protection (= 2.2.2)
233
+ tilt (~> 2.0)
234
+ solargraph (0.47.2)
235
+ backport (~> 1.2)
236
+ benchmark
237
+ bundler (>= 1.17.2)
238
+ diff-lcs (~> 1.4)
239
+ e2mmap
240
+ jaro_winkler (~> 1.5)
241
+ kramdown (~> 2.3)
242
+ kramdown-parser-gfm (~> 1.1)
243
+ parser (~> 3.0)
244
+ reverse_markdown (>= 1.0.5, < 3)
245
+ rubocop (>= 0.52)
246
+ thor (~> 1.0)
247
+ tilt (~> 2.0)
248
+ yard (~> 0.9, >= 0.9.24)
249
+ thor (1.2.1)
250
+ tilt (2.0.11)
251
+ timeout (0.3.0)
252
+ tzinfo (2.0.5)
253
+ concurrent-ruby (~> 1.0)
254
+ unicode-display_width (2.3.0)
255
+ webrick (1.7.0)
256
+ websocket-driver (0.7.5)
257
+ websocket-extensions (>= 0.1.0)
258
+ websocket-extensions (0.1.5)
259
+ yard (0.9.28)
260
+ webrick (~> 1.7.0)
261
+ zeitwerk (2.6.6)
262
+
263
+ PLATFORMS
264
+ arm64-darwin-21
265
+ arm64-darwin-22
266
+ x86_64-linux
267
+
268
+ DEPENDENCIES
269
+ awesome_print (~> 1.9, >= 1.9.2)
270
+ bugsify!
271
+ debug (~> 1.6, >= 1.6.2)
272
+ padrino (~> 0.15.1)
273
+ rails (~> 7.0, >= 7.0.3.1)
274
+ rake (~> 13.0)
275
+ rspec (~> 3.0)
276
+ rubocop (~> 1.21)
277
+ sinatra (~> 2.2, >= 2.2.2)
278
+ solargraph
279
+
280
+ BUNDLED WITH
281
+ 2.3.24
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Bugsify
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/Makefile ADDED
@@ -0,0 +1,51 @@
1
+ # ==================================================================================== #
2
+ # HELPERS
3
+ # ==================================================================================== #
4
+
5
+ ## help: print this help message
6
+ .PHONY: help
7
+ help:
8
+ @echo 'Usage:'
9
+ @sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
10
+
11
+
12
+ # ==================================================================================== #
13
+ # DEVELOPMENT
14
+ # ==================================================================================== #
15
+
16
+ ## bundle: install dependencies
17
+ .PHONY: bundle
18
+ bundle:
19
+ bundle install
20
+
21
+ ## terminal: go to the interactive terminal
22
+ .PHONY: console
23
+ console:
24
+ ./bin/console
25
+
26
+ # ==================================================================================== #
27
+ # TESTING
28
+ # ==================================================================================== #
29
+
30
+ ## test: run tests
31
+ .PHONY: test
32
+ test:
33
+ rspec
34
+
35
+ # ==================================================================================== #
36
+ # LINTING
37
+ # ==================================================================================== #
38
+
39
+ ## lint: run linter
40
+ .PHONY: lint
41
+ lint:
42
+ rubocop
43
+
44
+ # ==================================================================================== #
45
+ # Release
46
+ # ==================================================================================== #
47
+
48
+ ## release: run release
49
+ .PHONY: release
50
+ release:
51
+ rake release
data/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # bugsify_ruby
2
+
3
+ ## Error monitoring & exception reporter for Ruby
4
+
5
+ ## Installation
6
+
7
+ Add gem to the application's Gemfile by executing:
8
+
9
+ ```sh
10
+ gem 'bugsify'
11
+ ```
12
+
13
+ Setup bugsify gem by executing:
14
+
15
+ If you using rails:
16
+
17
+ ```sh
18
+ rails g bugsify:install
19
+ ```
20
+
21
+ Or create config file bugsify.rb
22
+
23
+ ## Usage
24
+
25
+ Setup api_key from project page https://app.bugsify.io/projects/YOUR_PROJECT
26
+
27
+ ```sh
28
+ Bugsify.configure do |config|
29
+ config.api_key = "YOUR_PROJECT_API_KEY"
30
+ end
31
+ ```
32
+
33
+ ## Development
34
+
35
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
36
+
37
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
38
+
39
+ ## Contributing
40
+
41
+ Bug reports and pull requests are welcome on GitHub at https://github.com/bugsify/bugsify_ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/bugsify/bugsify_ruby/blob/main/CODE_OF_CONDUCT.md).
42
+
43
+ ## License
44
+
45
+ The gem is available as open source under the terms of the [MIT License](https://github.com/bugsify/bugsify_ruby/blob/main/LICENSE.txt).
46
+
47
+ ## Code of Conduct
48
+
49
+ Everyone interacting in the Bugsify project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/bugsify/bugsify_ruby/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/bugsify.gemspec ADDED
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/bugsify/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "bugsify"
7
+ spec.version = Bugsify::VERSION
8
+ spec.authors = ["Aleksandar Popovic"]
9
+ spec.email = ["aleksandar.popovic@hotmail.com"]
10
+
11
+ spec.summary = "Ruby notifier for bugsify.io"
12
+ spec.description = "Bugsify error monitoring & exception reporter for Ruby"
13
+ spec.homepage = "https://github.com/bugsify/bugsify_ruby"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.6.0"
16
+
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = "https://github.com/bugsify/bugsify_ruby"
19
+ spec.metadata["changelog_uri"] = "https://github.com/bugsify/bugsify_ruby/blob/main/CHANGELOG.md"
20
+
21
+ spec.files = Dir.chdir(__dir__) do
22
+ `git ls-files -z`.split("\x0").reject do |f|
23
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
24
+ end
25
+ end
26
+
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+ spec.metadata["rubygems_mfa_required"] = "true"
31
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "uri"
4
+ require "net/http"
5
+ require "json"
6
+
7
+ module Bugsify
8
+ # Client
9
+ module Client
10
+ # Api
11
+ class Api
12
+ # rubocop:disable Metrics/AbcSize
13
+ # rubocop:disable Metrics/MethodLength
14
+ def request(uri, method, body = nil)
15
+ uri = URI.parse("https://api.bugsify.io/v1/#{uri}")
16
+ http = Net::HTTP.new(uri.host, uri.port)
17
+ http.use_ssl = true
18
+
19
+ klass = "Net::HTTP::#{method}"
20
+ constantized = Object.const_get(klass)
21
+
22
+ request = constantized.new(uri)
23
+ request["Content-Type"] = "application/json"
24
+ request["Api-Key"] = Bugsify.config.api_key
25
+ request.body = { data: body }.to_json if body
26
+
27
+ response = http.request(request)
28
+
29
+ obj = JSON.pretty_generate(
30
+ JSON.parse(response.read_body)
31
+ )
32
+
33
+ yield(obj) if block_given?
34
+ end
35
+ # rubocop:enable Metrics/AbcSize
36
+ # rubocop:enable Metrics/MethodLength
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bugsify
4
+ # Config
5
+ module Config
6
+ def self.included(host_class)
7
+ host_class.extend ClassMethods
8
+ end
9
+
10
+ # ClassMethods
11
+ module ClassMethods
12
+ def config
13
+ @config ||= Configuration.new
14
+ end
15
+
16
+ def configure
17
+ yield config
18
+ end
19
+ end
20
+
21
+ extend ClassMethods
22
+
23
+ class Configuration
24
+ attr_accessor :api_key
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ if Gem.loaded_specs.key?("rails")
4
+ require "rails"
5
+ require_relative "../middlewares/rails"
6
+
7
+ module Bugsify
8
+ # BugsifyEngine
9
+ class BugsifyEngine < Rails::Engine
10
+ initializer "bugsify_engine.add_middleware" do |app|
11
+ app.middleware.use Bugsify::Middleware::Rails
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ if Gem.loaded_specs.key?("padrino")
4
+ require_relative "../reporters/rack"
5
+
6
+ module Bugsify
7
+ module Middleware
8
+ # Padrino
9
+ class Padrino
10
+ include Bugsify::Reporter::Rack
11
+
12
+ def initialize(app)
13
+ @app = app
14
+ end
15
+
16
+ # rubocop:disable Metrics/MethodLength
17
+ # rubocop:disable Lint/RescueException
18
+ def call(env)
19
+ @app.call(env)
20
+ rescue Exception => e
21
+ payload = {
22
+ error_class: e.class,
23
+ error_backtrace: e,
24
+ error_full_backtrace: "\n#{e.class}\n#{e.message}\n#{e}",
25
+ runtime_version: {
26
+ padrino: Gem.loaded_specs["padrino"].version,
27
+ rack: Gem.loaded_specs["rake"].version,
28
+ ruby: RUBY_VERSION
29
+ }
30
+ }
31
+ notify(payload)
32
+ raise e
33
+ end
34
+ # rubocop:enable Metrics/MethodLength
35
+ # rubocop:enable Lint/RescueException
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ if Gem.loaded_specs.key?("rails")
4
+ require_relative "../reporters/rails"
5
+
6
+ module Bugsify
7
+ module Middleware
8
+ # Rails
9
+ class Rails
10
+ include Bugsify::Reporter::Rails
11
+
12
+ def initialize(app)
13
+ @app = app
14
+ end
15
+
16
+ # rubocop:disable Metrics/MethodLength
17
+ # rubocop:disable Lint/RescueException
18
+ # rubocop:disable Metrics/AbcSize
19
+ def call(env)
20
+ @app.call(env)
21
+ rescue Exception => e
22
+ trace = e.backtrace.select { |l| l.start_with?(Rack::Directory.new("").root) }.join("\n ")
23
+ payload = {
24
+ error_class: e.class,
25
+ error_backtrace: "\n#{e.class}\n#{e.message}\n#{trace}",
26
+ error_full_backtrace: e.backtrace.select { |l| l }.join("\n "),
27
+ runtime_version: {
28
+ rails: Gem.loaded_specs["rails"].version,
29
+ rack: Gem.loaded_specs["rake"].version,
30
+ ruby: RUBY_VERSION
31
+ }
32
+ }
33
+ notify(payload)
34
+ raise e
35
+ end
36
+ # rubocop:enable Metrics/MethodLength
37
+ # rubocop:enable Lint/RescueException
38
+ # rubocop:enable Metrics/AbcSize
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ if Gem.loaded_specs.key?("sinatra")
4
+ require_relative "../reporters/rack"
5
+
6
+ module Bugsify
7
+ module Middleware
8
+ # Sinatra
9
+ class Sinatra
10
+ include Bugsify::Reporter::Rack
11
+
12
+ def initialize(app)
13
+ @app = app
14
+ end
15
+
16
+ # rubocop:disable Metrics/MethodLength
17
+ # rubocop:disable Lint/RescueException
18
+ def call(env)
19
+ @app.call(env)
20
+ rescue Exception => e
21
+ payload = {
22
+ error_class: e.class,
23
+ error_backtrace: e,
24
+ error_full_backtrace: "\n#{e.class}\n#{e.message}\n#{e}",
25
+ runtime_version: {
26
+ padrino: Gem.loaded_specs["sinatra"].version,
27
+ rack: Gem.loaded_specs["rake"].version,
28
+ ruby: RUBY_VERSION
29
+ }
30
+ }
31
+ notify(payload)
32
+ raise e
33
+ end
34
+ # rubocop:enable Metrics/MethodLength
35
+ # rubocop:enable Lint/RescueException
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bugsify
4
+ # Error
5
+ module Notifier
6
+ # rubocop:disable Metrics/MethodLength
7
+ def auto_notify(args = {})
8
+ params = {
9
+ errorClass: args[:errorClass],
10
+ errorBacktrace: args[:errorBacktrace],
11
+ errorFullBacktrace: args[:errorFullBacktrace],
12
+ runtimeVersion: args[:runtimeVersion],
13
+ applicationEnvironment: args[:applicationEnvironment]
14
+ }
15
+
16
+ Bugsify::Client::Api.new.request(
17
+ "collectors/ruby",
18
+ "Post",
19
+ params,
20
+ &method(:parse)
21
+ )
22
+ end
23
+ # rubocop:enable Metrics/MethodLength
24
+
25
+ private
26
+
27
+ def parse(response)
28
+ puts response
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bugsify
4
+ module Reporter
5
+ # Rack
6
+ module Rack
7
+ def notify(event)
8
+ Bugsify.auto_notify({
9
+ errorClass: event[:error_class],
10
+ errorBacktrace: event[:error_backtrace],
11
+ errorFullBacktrace: event[:error_full_backtrace],
12
+ runtimeVersion: event[:runtime_version],
13
+ applicationEnvironment: ENV["RACK_ENV"]
14
+ })
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bugsify
4
+ module Reporter
5
+ # Rails
6
+ module Rails
7
+ # rubocop:disable Metrics/MethodLength
8
+ def notify(event)
9
+ semaphore = Thread::Mutex.new
10
+
11
+ Thread.new do
12
+ semaphore.synchronize do
13
+ Bugsify.auto_notify({
14
+ errorClass: event[:error_class],
15
+ errorBacktrace: event[:error_backtrace],
16
+ errorFullBacktrace: event[:error_full_backtrace],
17
+ runtimeVersion: event[:runtime_version],
18
+ applicationEnvironment: ENV["RACK_ENV"]
19
+ })
20
+ end
21
+ end
22
+ end
23
+ # rubocop:enable Metrics/MethodLength
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bugsify
4
+ VERSION = "1.0.3"
5
+ end
data/lib/bugsify.rb ADDED
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bugsify/version"
4
+ require "bugsify/config"
5
+ require "bugsify/client"
6
+ require "bugsify/notifier"
7
+ require "bugsify/engines/bugsify" if Gem.loaded_specs.key?("rails")
8
+ require "bugsify/middlewares/rails" if Gem.loaded_specs.key?("rails")
9
+ require "bugsify/middlewares/sinatra" if Gem.loaded_specs.key?("sinatra")
10
+ require "bugsify/middlewares/padrino" if Gem.loaded_specs.key?("padrino")
11
+
12
+ # Bugsify
13
+ module Bugsify
14
+ include Config
15
+ include Client
16
+ extend Notifier
17
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ if Gem.loaded_specs.key?("rails")
4
+ require "rails/generators"
5
+
6
+ module Bugsify
7
+ module Generators
8
+ # Install
9
+ class Install < Rails::Generators::Base
10
+ # rubocop:disable Layout/HeredocIndentation
11
+ def create_helper_file
12
+ create_file "config/initializers/bugsify.rb", <<-FILE
13
+ # frozen_string_literal: true
14
+
15
+ Bugsify.configure do |config|
16
+ config.api_key = ""
17
+ end
18
+ FILE
19
+ end
20
+ # rubocop:enable Layout/HeredocIndentation
21
+ end
22
+ end
23
+ end
24
+ end
data/sig/bugsify.rbs ADDED
@@ -0,0 +1,4 @@
1
+ module Bugsify
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bugsify
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Aleksandar Popovic
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-01-09 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Bugsify error monitoring & exception reporter for Ruby
14
+ email:
15
+ - aleksandar.popovic@hotmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".irbrc"
21
+ - ".rspec"
22
+ - ".rubocop.yml"
23
+ - ".solargraph.yml"
24
+ - ".vscode/settings.json"
25
+ - CHANGELOG.md
26
+ - CODE_OF_CONDUCT.md
27
+ - Gemfile
28
+ - Gemfile.lock
29
+ - LICENSE.txt
30
+ - Makefile
31
+ - README.md
32
+ - Rakefile
33
+ - bugsify.gemspec
34
+ - lib/bugsify.rb
35
+ - lib/bugsify/client.rb
36
+ - lib/bugsify/config.rb
37
+ - lib/bugsify/engines/bugsify.rb
38
+ - lib/bugsify/middlewares/padrino.rb
39
+ - lib/bugsify/middlewares/rails.rb
40
+ - lib/bugsify/middlewares/sinatra.rb
41
+ - lib/bugsify/notifier.rb
42
+ - lib/bugsify/reporters/rack.rb
43
+ - lib/bugsify/reporters/rails.rb
44
+ - lib/bugsify/version.rb
45
+ - lib/generators/bugsify/install_generator.rb
46
+ - sig/bugsify.rbs
47
+ homepage: https://github.com/bugsify/bugsify_ruby
48
+ licenses:
49
+ - MIT
50
+ metadata:
51
+ homepage_uri: https://github.com/bugsify/bugsify_ruby
52
+ source_code_uri: https://github.com/bugsify/bugsify_ruby
53
+ changelog_uri: https://github.com/bugsify/bugsify_ruby/blob/main/CHANGELOG.md
54
+ rubygems_mfa_required: 'true'
55
+ post_install_message:
56
+ rdoc_options: []
57
+ require_paths:
58
+ - lib
59
+ required_ruby_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 2.6.0
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ requirements: []
70
+ rubygems_version: 3.3.7
71
+ signing_key:
72
+ specification_version: 4
73
+ summary: Ruby notifier for bugsify.io
74
+ test_files: []