sentry-raven 2.5.1 → 2.5.2

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.
data/docs/make.bat ADDED
@@ -0,0 +1,155 @@
1
+ @ECHO OFF
2
+
3
+ REM Command file for Sphinx documentation
4
+
5
+ if "%SPHINXBUILD%" == "" (
6
+ set SPHINXBUILD=sphinx-build
7
+ )
8
+ set BUILDDIR=_build
9
+ set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
10
+ if NOT "%PAPER%" == "" (
11
+ set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
12
+ )
13
+
14
+ if "%1" == "" goto help
15
+
16
+ if "%1" == "help" (
17
+ :help
18
+ echo.Please use `make ^<target^>` where ^<target^> is one of
19
+ echo. html to make standalone HTML files
20
+ echo. dirhtml to make HTML files named index.html in directories
21
+ echo. singlehtml to make a single large HTML file
22
+ echo. pickle to make pickle files
23
+ echo. json to make JSON files
24
+ echo. htmlhelp to make HTML files and a HTML help project
25
+ echo. qthelp to make HTML files and a qthelp project
26
+ echo. devhelp to make HTML files and a Devhelp project
27
+ echo. epub to make an epub
28
+ echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
29
+ echo. text to make text files
30
+ echo. man to make manual pages
31
+ echo. changes to make an overview over all changed/added/deprecated items
32
+ echo. linkcheck to check all external links for integrity
33
+ echo. doctest to run all doctests embedded in the documentation if enabled
34
+ goto end
35
+ )
36
+
37
+ if "%1" == "clean" (
38
+ for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
39
+ del /q /s %BUILDDIR%\*
40
+ goto end
41
+ )
42
+
43
+ if "%1" == "html" (
44
+ %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
45
+ echo.
46
+ echo.Build finished. The HTML pages are in %BUILDDIR%/html.
47
+ goto end
48
+ )
49
+
50
+ if "%1" == "dirhtml" (
51
+ %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
52
+ echo.
53
+ echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
54
+ goto end
55
+ )
56
+
57
+ if "%1" == "singlehtml" (
58
+ %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
59
+ echo.
60
+ echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
61
+ goto end
62
+ )
63
+
64
+ if "%1" == "pickle" (
65
+ %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
66
+ echo.
67
+ echo.Build finished; now you can process the pickle files.
68
+ goto end
69
+ )
70
+
71
+ if "%1" == "json" (
72
+ %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
73
+ echo.
74
+ echo.Build finished; now you can process the JSON files.
75
+ goto end
76
+ )
77
+
78
+ if "%1" == "htmlhelp" (
79
+ %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
80
+ echo.
81
+ echo.Build finished; now you can run HTML Help Workshop with the ^
82
+ .hhp project file in %BUILDDIR%/htmlhelp.
83
+ goto end
84
+ )
85
+
86
+ if "%1" == "qthelp" (
87
+ %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
88
+ echo.
89
+ echo.Build finished; now you can run "qcollectiongenerator" with the ^
90
+ .qhcp project file in %BUILDDIR%/qthelp, like this:
91
+ echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Sentry.qhcp
92
+ echo.To view the help file:
93
+ echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Sentry.ghc
94
+ goto end
95
+ )
96
+
97
+ if "%1" == "devhelp" (
98
+ %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
99
+ echo.
100
+ echo.Build finished.
101
+ goto end
102
+ )
103
+
104
+ if "%1" == "epub" (
105
+ %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
106
+ echo.
107
+ echo.Build finished. The epub file is in %BUILDDIR%/epub.
108
+ goto end
109
+ )
110
+
111
+ if "%1" == "latex" (
112
+ %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
113
+ echo.
114
+ echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
115
+ goto end
116
+ )
117
+
118
+ if "%1" == "text" (
119
+ %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
120
+ echo.
121
+ echo.Build finished. The text files are in %BUILDDIR%/text.
122
+ goto end
123
+ )
124
+
125
+ if "%1" == "man" (
126
+ %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
127
+ echo.
128
+ echo.Build finished. The manual pages are in %BUILDDIR%/man.
129
+ goto end
130
+ )
131
+
132
+ if "%1" == "changes" (
133
+ %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
134
+ echo.
135
+ echo.The overview file is in %BUILDDIR%/changes.
136
+ goto end
137
+ )
138
+
139
+ if "%1" == "linkcheck" (
140
+ %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
141
+ echo.
142
+ echo.Link check complete; look for any errors in the above output ^
143
+ or in %BUILDDIR%/linkcheck/output.txt.
144
+ goto end
145
+ )
146
+
147
+ if "%1" == "doctest" (
148
+ %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
149
+ echo.
150
+ echo.Testing of doctests in the sources finished, look at the ^
151
+ results in %BUILDDIR%/doctest/output.txt.
152
+ goto end
153
+ )
154
+
155
+ :end
@@ -0,0 +1,31 @@
1
+ {
2
+ "support_level": "production",
3
+ "platforms": {
4
+ "ruby": {
5
+ "name": "Ruby",
6
+ "type": "language",
7
+ "doc_link": "",
8
+ "wizard": [
9
+ "index#installation",
10
+ "index#configuration",
11
+ "index#reporting-failures"
12
+ ]
13
+ },
14
+ "ruby.rack": {
15
+ "name": "Rack",
16
+ "type": "framework",
17
+ "doc_link": "integrations/rack/",
18
+ "wizard": [
19
+ "integrations/rack#rack-sinatra-etc"
20
+ ]
21
+ },
22
+ "ruby.rails": {
23
+ "name": "Rails",
24
+ "type": "framework",
25
+ "doc_link": "integrations/rails/",
26
+ "wizard": [
27
+ "integrations/rails#ruby-on-rails"
28
+ ]
29
+ }
30
+ }
31
+ }
data/docs/usage.rst ADDED
@@ -0,0 +1,160 @@
1
+ Usage
2
+ =====
3
+
4
+ To use Raven Ruby all you need is your DSN. Like most Sentry libraries it
5
+ will honor the ``SENTRY_DSN`` environment variable. You can find it on
6
+ the project settings page under API Keys. You can either export it as
7
+ environment variable or manually configure it with ``Raven.configure``:
8
+
9
+ .. code-block:: ruby
10
+
11
+ Raven.configure do |config|
12
+ config.dsn = '___DSN___'
13
+ end
14
+
15
+ If you only want to send events to Sentry in certain environments, you
16
+ should set ``config.environments`` too:
17
+
18
+ .. code-block:: ruby
19
+
20
+ Raven.configure do |config|
21
+ config.dsn = '___DSN___'
22
+ config.environments = ['staging', 'production']
23
+ end
24
+
25
+ Reporting Failures
26
+ ------------------
27
+
28
+ If you use Rails, Rake, Rack etc, you're already done - no more
29
+ configuration required! Check :doc:`integrations/index` for more details on
30
+ other gems Sentry integrates with automatically.
31
+
32
+ Otherwise, Raven supports two methods of capturing exceptions:
33
+
34
+ .. sourcecode:: ruby
35
+
36
+ Raven.capture do
37
+ # capture any exceptions which happen during execution of this block
38
+ 1 / 0
39
+ end
40
+
41
+ begin
42
+ 1 / 0
43
+ rescue ZeroDivisionError => exception
44
+ Raven.capture_exception(exception)
45
+ end
46
+
47
+ Reporting Messages
48
+ ------------------
49
+
50
+ If you want to report a message rather than an exception you can use the
51
+ ``capture_message`` method:
52
+
53
+ .. code-block:: ruby
54
+
55
+ Raven.capture_message("Something went very wrong")
56
+
57
+ Referencing Events
58
+ ------------------
59
+
60
+ The client exposes a ``last_event_id`` accessor allowing you to easily
61
+ reference the last captured event. This is useful, for example, if you wanted
62
+ to show the user a reference on your error page:
63
+
64
+ .. code-block:: ruby
65
+
66
+ # somewhere deep in the stack
67
+ Raven.capture do
68
+ 1 / 0
69
+ end
70
+
71
+ Now you can easily expose this to your error handler:
72
+
73
+ .. code-block:: ruby
74
+
75
+ class ErrorsController < ApplicationController
76
+ def internal_server_error
77
+ render(:status => 500, :sentry_event_id => Raven.last_event_id)
78
+ end
79
+ end
80
+
81
+ Optional Attributes
82
+ -------------------
83
+
84
+ With calls to ``capture_exception`` or ``capture_message`` additional data
85
+ can be supplied:
86
+
87
+ .. code-block:: ruby
88
+
89
+ Raven.capture_message("...", :attr => 'value')
90
+
91
+ .. describe:: extra
92
+
93
+ Additional context for this event. Must be a mapping. Children can be any native JSON type.
94
+
95
+ .. code-block:: ruby
96
+
97
+ {
98
+ :extra => {'key' => 'value'}
99
+ }
100
+
101
+ .. describe:: fingerprint
102
+
103
+ The fingerprint for grouping this event.
104
+
105
+ .. code-block:: ruby
106
+
107
+ {
108
+ :fingerprint => ['{{ default }}', 'other value']
109
+ }
110
+
111
+ .. describe:: level
112
+
113
+ The level of the event. Defaults to ``error``.
114
+
115
+ .. code-block:: ruby
116
+
117
+ {
118
+ :level => 'warning'
119
+ }
120
+
121
+ Sentry is aware of the following levels:
122
+
123
+ * debug (the least serious)
124
+ * info
125
+ * warning
126
+ * error
127
+ * fatal (the most serious)
128
+
129
+ .. describe:: logger
130
+
131
+ The logger name for the event.
132
+
133
+ .. code-block:: ruby
134
+
135
+ {
136
+ :logger => 'default'
137
+ }
138
+
139
+ .. describe:: tags
140
+
141
+ Tags to index with this event. Must be a mapping of strings.
142
+
143
+ .. code-block:: ruby
144
+
145
+ {
146
+ :tags => {'key' => 'value'}
147
+ }
148
+
149
+ .. describe:: user
150
+
151
+ The acting user.
152
+
153
+ .. code-block:: ruby
154
+
155
+ {
156
+ :user => {
157
+ 'id' => 42,
158
+ 'email' => 'clever-girl'
159
+ }
160
+ }
data/exe/raven ADDED
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "raven"
4
+ require "raven/cli"
5
+ require "optparse"
6
+
7
+ parser = OptionParser.new do |opt|
8
+ opt.banner = "Usage: raven COMMAND [OPTIONS]"
9
+ opt.separator ""
10
+ opt.separator "Commands"
11
+ opt.separator " test: send a test event"
12
+ opt.separator ""
13
+ opt.separator "Options"
14
+
15
+ opt.on("-h", "--help", "help") do
16
+ puts parser
17
+ end
18
+ end
19
+
20
+ parser.parse!
21
+
22
+ case ARGV[0]
23
+ when "test"
24
+ dsn = ARGV[1] if ARGV.length > 1
25
+ if !dsn
26
+ puts "Usage: raven test <dsn>"
27
+ else
28
+ Raven::CLI.test(dsn)
29
+ end
30
+ else
31
+ puts parser
32
+ end
@@ -110,7 +110,7 @@ module Raven
110
110
  end
111
111
 
112
112
  def inspect
113
- "<Backtrace: " + lines.map(&inspect).join(", ") + ">"
113
+ "<Backtrace: " + lines.map(&:inspect).join(", ") + ">"
114
114
  end
115
115
 
116
116
  def to_s
data/lib/raven/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Raven
3
3
  # Freezing this constant breaks in 1.9.x
4
- VERSION = "2.5.1" # rubocop:disable Style/MutableConstant
4
+ VERSION = "2.5.2" # rubocop:disable Style/MutableConstant
5
5
  end
@@ -0,0 +1,22 @@
1
+ $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
2
+ require 'raven/version'
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.name = "sentry-raven"
6
+ gem.authors = ["Sentry Team"]
7
+ gem.description = gem.summary = "A gem that provides a client interface for the Sentry error logger"
8
+ gem.email = "getsentry@googlegroups.com"
9
+ gem.license = 'Apache-2.0'
10
+ gem.homepage = "https://github.com/getsentry/raven-ruby"
11
+
12
+ gem.version = Raven::VERSION
13
+ gem.platform = Gem::Platform::RUBY
14
+ gem.required_ruby_version = '>= 1.9.0'
15
+ gem.has_rdoc = true
16
+ gem.extra_rdoc_files = ["README.md", "LICENSE"]
17
+ gem.files = `git ls-files | grep -Ev '^(spec|benchmarks|examples)'`.split("\n")
18
+ gem.bindir = "exe"
19
+ gem.executables = "raven"
20
+
21
+ gem.add_dependency "faraday", ">= 0.7.6", "< 1.0"
22
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentry-raven
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sentry Team
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-24 00:00:00.000000000 Z
11
+ date: 2017-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -30,100 +30,40 @@ dependencies:
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '1.0'
33
- - !ruby/object:Gem::Dependency
34
- name: rake
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- version: '0'
40
- type: :development
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: '0'
47
- - !ruby/object:Gem::Dependency
48
- name: rubocop
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: 0.41.1
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: 0.41.1
61
- - !ruby/object:Gem::Dependency
62
- name: rspec
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: '0'
68
- type: :development
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- version: '0'
75
- - !ruby/object:Gem::Dependency
76
- name: rspec-rails
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- version: '0'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- version: '0'
89
- - !ruby/object:Gem::Dependency
90
- name: timecop
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - ">="
94
- - !ruby/object:Gem::Version
95
- version: '0'
96
- type: :development
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- version: '0'
103
- - !ruby/object:Gem::Dependency
104
- name: test-unit
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- version: '0'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- version: '0'
117
33
  description: A gem that provides a client interface for the Sentry error logger
118
34
  email: getsentry@googlegroups.com
119
- executables: []
35
+ executables:
36
+ - raven
120
37
  extensions: []
121
38
  extra_rdoc_files:
122
39
  - README.md
123
40
  - LICENSE
124
41
  files:
42
+ - ".gitignore"
43
+ - ".gitmodules"
44
+ - ".rspec"
45
+ - ".rubocop.yml"
46
+ - ".travis.yml"
47
+ - Gemfile
125
48
  - LICENSE
126
49
  - README.md
50
+ - Rakefile
51
+ - changelog.md
52
+ - docs/Makefile
53
+ - docs/breadcrumbs.rst
54
+ - docs/conf.py
55
+ - docs/config.rst
56
+ - docs/context.rst
57
+ - docs/index.rst
58
+ - docs/install.rst
59
+ - docs/integrations/index.rst
60
+ - docs/integrations/puma.rst
61
+ - docs/integrations/rack.rst
62
+ - docs/integrations/rails.rst
63
+ - docs/make.bat
64
+ - docs/sentry-doc-config.json
65
+ - docs/usage.rst
66
+ - exe/raven
127
67
  - lib/raven.rb
128
68
  - lib/raven/backtrace.rb
129
69
  - lib/raven/base.rb
@@ -173,6 +113,7 @@ files:
173
113
  - lib/raven/version.rb
174
114
  - lib/sentry-raven-without-integrations.rb
175
115
  - lib/sentry-raven.rb
116
+ - sentry-raven.gemspec
176
117
  homepage: https://github.com/getsentry/raven-ruby
177
118
  licenses:
178
119
  - Apache-2.0