errordite 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.travis.yml +6 -0
  4. data/Gemfile +5 -0
  5. data/Guardfile +24 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +23 -0
  8. data/Rakefile +20 -0
  9. data/errordite-rack.gemspec +21 -0
  10. data/errordite-rails.gemspec +21 -0
  11. data/errordite.gemspec +28 -0
  12. data/examples/rack/Gemfile +4 -0
  13. data/examples/rack/config.ru +7 -0
  14. data/examples/rails/.gitignore +16 -0
  15. data/examples/rails/Gemfile +36 -0
  16. data/examples/rails/README.rdoc +28 -0
  17. data/examples/rails/Rakefile +6 -0
  18. data/examples/rails/app/assets/images/.keep +0 -0
  19. data/examples/rails/app/assets/javascripts/application.js +16 -0
  20. data/examples/rails/app/assets/stylesheets/application.css +13 -0
  21. data/examples/rails/app/controllers/application_controller.rb +5 -0
  22. data/examples/rails/app/controllers/concerns/.keep +0 -0
  23. data/examples/rails/app/helpers/application_helper.rb +2 -0
  24. data/examples/rails/app/mailers/.keep +0 -0
  25. data/examples/rails/app/models/.keep +0 -0
  26. data/examples/rails/app/models/concerns/.keep +0 -0
  27. data/examples/rails/app/views/layouts/application.html.erb +14 -0
  28. data/examples/rails/bin/bundle +3 -0
  29. data/examples/rails/bin/rails +4 -0
  30. data/examples/rails/bin/rake +4 -0
  31. data/examples/rails/config.ru +4 -0
  32. data/examples/rails/config/application.rb +23 -0
  33. data/examples/rails/config/boot.rb +4 -0
  34. data/examples/rails/config/database.yml +25 -0
  35. data/examples/rails/config/environment.rb +5 -0
  36. data/examples/rails/config/environments/development.rb +29 -0
  37. data/examples/rails/config/environments/production.rb +80 -0
  38. data/examples/rails/config/environments/test.rb +36 -0
  39. data/examples/rails/config/initializers/backtrace_silencers.rb +7 -0
  40. data/examples/rails/config/initializers/filter_parameter_logging.rb +4 -0
  41. data/examples/rails/config/initializers/inflections.rb +16 -0
  42. data/examples/rails/config/initializers/mime_types.rb +5 -0
  43. data/examples/rails/config/initializers/secret_token.rb +12 -0
  44. data/examples/rails/config/initializers/session_store.rb +3 -0
  45. data/examples/rails/config/initializers/wrap_parameters.rb +14 -0
  46. data/examples/rails/config/locales/en.yml +23 -0
  47. data/examples/rails/config/routes.rb +56 -0
  48. data/examples/rails/db/seeds.rb +7 -0
  49. data/examples/rails/lib/assets/.keep +0 -0
  50. data/examples/rails/lib/tasks/.keep +0 -0
  51. data/examples/rails/log/.keep +0 -0
  52. data/examples/rails/public/404.html +58 -0
  53. data/examples/rails/public/422.html +58 -0
  54. data/examples/rails/public/500.html +57 -0
  55. data/examples/rails/public/favicon.ico +0 -0
  56. data/examples/rails/public/robots.txt +5 -0
  57. data/lib/errordite-rails.rb +7 -0
  58. data/lib/errordite.rb +33 -0
  59. data/lib/errordite/client.rb +44 -0
  60. data/lib/errordite/config.rb +44 -0
  61. data/lib/errordite/rack.rb +22 -0
  62. data/lib/errordite/serializer.rb +62 -0
  63. data/lib/errordite/version.rb +3 -0
  64. data/spec/lib/errordite/client_spec.rb +64 -0
  65. data/spec/lib/errordite/config_spec.rb +61 -0
  66. data/spec/lib/errordite/serializer_spec.rb +66 -0
  67. data/spec/lib/errordite_spec.rb +34 -0
  68. data/spec/spec_helper.rb +1 -0
  69. metadata +214 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3bb7e8209b3537789911d8a8e3b7f54a2cdb53e0
4
+ data.tar.gz: ce35f91845c4b98c27873de43d11d5d613ee6c28
5
+ SHA512:
6
+ metadata.gz: 040f7bf811dc52c428dcb649f6e849fad80129e0978f39196993e98413ef6f537ea60a826db0043c6cc3c276cb58da9b971a19b13307c8fe049755cde2afbac1
7
+ data.tar.gz: e0794c50108be962117e22cf5559f9da58315369597b7a0b3c823211bdc5a23ffc491d3491f66724b5fc6c56448afd466125ff1f93936421e2ad570a21596db6
@@ -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
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.8.7"
4
+ - "1.9.2"
5
+ - "1.9.3"
6
+ - "2.0.0"
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in errordite.gemspec
4
+ gemspec name: 'errordite'
5
+ gemspec name: 'errordite-rack'
@@ -0,0 +1,24 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard 'rspec' do
5
+ watch(%r{^spec/.+_spec\.rb$})
6
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7
+ watch('spec/spec_helper.rb') { "spec" }
8
+
9
+ # Rails example
10
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
11
+ watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
12
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
13
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
14
+ watch('config/routes.rb') { "spec/routing" }
15
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
16
+
17
+ # Capybara features specs
18
+ watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
19
+
20
+ # Turnip features and steps
21
+ watch(%r{^spec/acceptance/(.+)\.feature$})
22
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
23
+ end
24
+
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Tom Ward
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,23 @@
1
+ # Errordite
2
+
3
+ A ruby client for https://www.errordite.com
4
+
5
+ ## Adding errordite to your application
6
+
7
+ There are different gems for general, rack, and rails applications, so add either `errordite`, `errordite-rack` or `errordite-rails` to your `Gemfile` and reinstall the bundle.
8
+
9
+ For rails applications, errordite will automatically be added to capture and log all errors thrown during a request. For rack applications, you'll need to explicitly add rack middleware, adding something like this to your `config.ru` file:
10
+
11
+ use Errordite::Rack
12
+
13
+ ## Setting the errordite api token
14
+
15
+ Errordite uses a unique api token to identify users, and you'll need to set this before it can record errors. This can be done in one of two ways. The first (and preferred method) is to set the environment variable `ERRORDITE_TOKEN` with your API key. If this isn't possible you can also directly set `Errordite.config.api_key`.
16
+
17
+ ## Capturing non-request related errors
18
+
19
+ Using `errordite-rail` or adding the `Errordite::Rack` middleware will capture errors that occur during a request to your application, but it's also useful to capture errors that happen outside a web process. An example might be errors from a job queue or similar. This is easy to achieve, using `Errordite.monitor(&block)`. e.g.:
20
+
21
+ Errordite.monitor do
22
+ ErrorProneQueue.process_next_job
23
+ end
@@ -0,0 +1,20 @@
1
+ require 'bundler/gem_helper'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ gems = ['errordite', 'errordite-rack', 'errordite-rails']
7
+ gems.each do |gem|
8
+ namespace gem do
9
+ Bundler::GemHelper.install_tasks name: gem
10
+ end
11
+ end
12
+
13
+ desc 'build all gems'
14
+ task build: gems.map {|g| "#{g}:build"}
15
+ desc 'install all gems'
16
+ task install: gems.map {|g| "#{g}:install"}
17
+ desc 'release all gems'
18
+ task release: gems.map {|g| "#{g}:release"}
19
+
20
+ task :default => :spec
@@ -0,0 +1,21 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'errordite/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "errordite-rack"
8
+ spec.version = Errordite::VERSION
9
+ spec.authors = ["Tom Ward"]
10
+ spec.email = ["tom@popdog.net"]
11
+ spec.description = %q{A rack client for www.errordite.com}
12
+ spec.summary = %q{A rack client for www.errordite.com}
13
+ spec.homepage = "https://www.errordite.com"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = ["lib/errordite-rack.rb", "lib/errordite/version.rb"]
17
+ spec.require_paths = ["lib"]
18
+
19
+ spec.add_dependency "errordite", Errordite::VERSION
20
+ spec.add_dependency "rack"
21
+ end
@@ -0,0 +1,21 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'errordite/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "errordite-rails"
8
+ spec.version = Errordite::VERSION
9
+ spec.authors = ["Tom Ward"]
10
+ spec.email = ["tom@popdog.net"]
11
+ spec.description = %q{A rails client for www.errordite.com}
12
+ spec.summary = %q{A rails client for www.errordite.com}
13
+ spec.homepage = "https://www.errordite.com"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = ["lib/errordite-rails.rb", "lib/errordite/version.rb"]
17
+ spec.require_paths = ["lib"]
18
+
19
+ spec.add_dependency "errordite", Errordite::VERSION
20
+ spec.add_dependency "rails"
21
+ end
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'errordite/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "errordite"
8
+ spec.version = Errordite::VERSION
9
+ spec.authors = ["Tom Ward"]
10
+ spec.email = ["tom@popdog.net"]
11
+ spec.description = %q{A ruby client for www.errordite.com}
12
+ spec.summary = %q{A ruby client for www.errordite.com}
13
+ spec.homepage = "https://www.errordite.com"
14
+ spec.license = "MIT"
15
+ spec.files = `git ls-files`.split($/) - ["lib/errordite-rack.rb"]
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_dependency "json"
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.3"
23
+ spec.add_development_dependency "rspec"
24
+ spec.add_development_dependency "rake"
25
+ spec.add_development_dependency "guard"
26
+ spec.add_development_dependency "rb-fsevent"
27
+ spec.add_development_dependency "guard-rspec"
28
+ end
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rack'
4
+ gem 'errordite-rack', path: "../.."
@@ -0,0 +1,7 @@
1
+ require 'errordite-rack'
2
+
3
+ use Errordite::Rack, context: {'Version' => '1.0.0'}
4
+
5
+ run lambda {|env|
6
+ raise 'An example error'
7
+ }
@@ -0,0 +1,16 @@
1
+ # See http://help.github.com/ignore-files/ for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*.log
16
+ /tmp
@@ -0,0 +1,36 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
4
+ gem 'rails', '4.0.0'
5
+
6
+ # Use sqlite3 as the database for Active Record
7
+ gem 'sqlite3'
8
+
9
+ # Use SCSS for stylesheets
10
+ gem 'sass-rails', '~> 4.0.0'
11
+
12
+ # Use Uglifier as compressor for JavaScript assets
13
+ gem 'uglifier', '>= 1.3.0'
14
+
15
+ # Use CoffeeScript for .js.coffee assets and views
16
+ gem 'coffee-rails', '~> 4.0.0'
17
+
18
+
19
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
20
+ # gem 'therubyracer', platforms: :ruby
21
+
22
+ # Use jquery as the JavaScript library
23
+ gem 'jquery-rails'
24
+
25
+ # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
26
+ gem 'turbolinks'
27
+
28
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
29
+ gem 'jbuilder', '~> 1.2'
30
+
31
+ group :doc do
32
+ # bundle exec rake doc:rails generates the API under doc/api.
33
+ gem 'sdoc', require: false
34
+ end
35
+
36
+ gem 'errordite-rails', path: "../.."
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ ExampleApp::Application.load_tasks
File without changes
@@ -0,0 +1,16 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require turbolinks
16
+ //= require_tree .
@@ -0,0 +1,13 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
File without changes
File without changes
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>ExampleApp</title>
5
+ <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
+ <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
@@ -0,0 +1,23 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(:default, Rails.env)
8
+
9
+ module ExampleApp
10
+ class Application < Rails::Application
11
+ # Settings in config/environments/* take precedence over those specified here.
12
+ # Application configuration should go into files in config/initializers
13
+ # -- all .rb files in that directory are automatically loaded.
14
+
15
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
16
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
17
+ # config.time_zone = 'Central Time (US & Canada)'
18
+
19
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21
+ # config.i18n.default_locale = :de
22
+ end
23
+ end
@@ -0,0 +1,4 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ timeout: 5000