rails_exception_handler 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  before_script:
2
- - "spec/exception_handler_test_app/script/setup"
2
+ - "spec/testapp_30/script/setup"
3
3
 
4
4
  notifications:
5
5
  disable: true
data/Gemfile CHANGED
@@ -1,9 +1,10 @@
1
1
  # A sample Gemfile
2
2
  source "http://rubygems.org"
3
3
 
4
- group :test do
4
+ group :test, :development do
5
5
  gem "rails", '3.0.9'
6
6
  gem "rspec-rails"
7
7
  gem "rack-test", '0.5.7'
8
8
  gem "mysql2", '0.2.6'
9
+ gem "jeweler"
9
10
  end
data/Gemfile.lock CHANGED
@@ -33,7 +33,12 @@ GEM
33
33
  diff-lcs (1.1.2)
34
34
  erubis (2.6.6)
35
35
  abstract (>= 1.0.0)
36
+ git (1.2.5)
36
37
  i18n (0.5.0)
38
+ jeweler (1.6.3)
39
+ bundler (~> 1.0)
40
+ git (>= 1.2.5)
41
+ rake
37
42
  mail (2.2.19)
38
43
  activesupport (>= 2.3.6)
39
44
  i18n (>= 0.4.0)
@@ -85,6 +90,7 @@ PLATFORMS
85
90
  ruby
86
91
 
87
92
  DEPENDENCIES
93
+ jeweler
88
94
  mysql2 (= 0.2.6)
89
95
  rack-test (= 0.5.7)
90
96
  rails (= 3.0.9)
data/HISTORY ADDED
@@ -0,0 +1,8 @@
1
+ CHANGELOG
2
+
3
+
4
+ v1.0.1 - 17. Jul 2011
5
+ - Minor fix for 1.8.7 compatibility
6
+
7
+ v1.0.0 - 17. Jul 2011
8
+ - Initial release
data/README.markdown CHANGED
@@ -2,11 +2,17 @@
2
2
 
3
3
  This is an exception handler for Rails 3 built as Rack middleware. It enables you to save the key information from the error message in a database somewhere and display a customized error message to the user within the applications layout file. You can hook this gem into all your rails apps and gather the exception reports in one place. If you make yourself a simple web front on top of that you have a user friendly way of keeping track of exceptions raised by your rails apps.
4
4
 
5
+ ## Compatiblity
6
+
7
+ The gem is tested against Rails 3.0.9. It does not work with Rails 2.
8
+ See travis-ci for info on which rubies it is tested against:
9
+ http://travis-ci.org/#!/Sharagoz/rails_exception_handler
10
+
5
11
  ## Installation
6
12
  Add this line to your Gemfile:
7
13
 
8
14
  ```
9
- config.gem 'rails_exception_handler', '~> 1.0'
15
+ gem 'rails_exception_handler', '~> 1.0'
10
16
  ```
11
17
 
12
18
  Create an initializer in **config/initializers** called **rails_exception_handler.rb** and uncomment the options where you want something other than the default:
@@ -188,5 +194,5 @@ activesupport (3.0.7) lib/active_support/notifications.rb:54:in `instrument'
188
194
  ```ruby
189
195
  config.storage_strategies = [:remote_url => {:target => 'http://example.com/error_messages'}]
190
196
  ```
191
- This option is meant for those who want to store the exception in a database table, but does not have direct access to the database itself, making active_record store unsuitable. You need a web app on a server that has access to the database. An HTTP POST request will be sent to the specified URL with the error message as data.
197
+ This option is meant for those who want to store the exception in a database table, but does not have direct access to the database itself, making active record store unsuitable. You need a web app on a server that has access to the database. An HTTP POST request will be sent to the specified URL with the error message as data.
192
198
  If you use a Rails app at the other end you should simply be able to do _ErrorMessage.create(params[:error_message])_ to save the report.
data/Rakefile CHANGED
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'rubygems'
3
3
  require 'rake'
4
+ require 'jeweler'
4
5
 
5
6
  task :default => :test
6
7
 
@@ -15,7 +16,6 @@ task :test do
15
16
  system "bundle exec rspec #{files.join(' ')}"
16
17
  end
17
18
 
18
- require 'jeweler'
19
19
  Jeweler::Tasks.new do |gem|
20
20
  # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
21
21
  gem.name = "rails_exception_handler"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -26,7 +26,7 @@ class RailsExceptionHandler::Parser
26
26
  if(filter.class == Symbol)
27
27
  result = send("filter_#{filter}")
28
28
  elsif(filter.class == Hash)
29
- result = send("filter_#{filter.flatten[0]}", filter.flatten[1])
29
+ result = send("filter_#{filter.keys[0]}", filter.values[0])
30
30
  else
31
31
  raise "RailsExceptionHandler: Unknown filter #{filter.inspect}"
32
32
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rails_exception_handler}
8
- s.version = "1.0.0"
8
+ s.version = "1.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Sharagoz"]
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
19
19
  ".travis.yml",
20
20
  "Gemfile",
21
21
  "Gemfile.lock",
22
+ "HISTORY",
22
23
  "LICENCE",
23
24
  "README.markdown",
24
25
  "Rakefile",
@@ -49,7 +50,6 @@ Gem::Specification.new do |s|
49
50
  "spec/testapp_30/config.ru",
50
51
  "spec/testapp_30/config/application.rb",
51
52
  "spec/testapp_30/config/boot.rb",
52
- "spec/testapp_30/config/database.yml",
53
53
  "spec/testapp_30/config/environment.rb",
54
54
  "spec/testapp_30/config/environments/development.rb",
55
55
  "spec/testapp_30/config/environments/production.rb",
@@ -79,9 +79,24 @@ Gem::Specification.new do |s|
79
79
  s.specification_version = 3
80
80
 
81
81
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
82
+ s.add_development_dependency(%q<rails>, ["= 3.0.9"])
83
+ s.add_development_dependency(%q<rspec-rails>, [">= 0"])
84
+ s.add_development_dependency(%q<rack-test>, ["= 0.5.7"])
85
+ s.add_development_dependency(%q<mysql2>, ["= 0.2.6"])
86
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
82
87
  else
88
+ s.add_dependency(%q<rails>, ["= 3.0.9"])
89
+ s.add_dependency(%q<rspec-rails>, [">= 0"])
90
+ s.add_dependency(%q<rack-test>, ["= 0.5.7"])
91
+ s.add_dependency(%q<mysql2>, ["= 0.2.6"])
92
+ s.add_dependency(%q<jeweler>, [">= 0"])
83
93
  end
84
94
  else
95
+ s.add_dependency(%q<rails>, ["= 3.0.9"])
96
+ s.add_dependency(%q<rspec-rails>, [">= 0"])
97
+ s.add_dependency(%q<rack-test>, ["= 0.5.7"])
98
+ s.add_dependency(%q<mysql2>, ["= 0.2.6"])
99
+ s.add_dependency(%q<jeweler>, [">= 0"])
85
100
  end
86
101
  end
87
102
 
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.dirname(__FILE__)) + '/../spec_helper.rb'
1
+ require 'spec_helper'
2
2
 
3
3
  describe RailsExceptionHandler::Configuration do
4
4
  describe ".storage_strategies" do
@@ -13,7 +13,7 @@ describe RailsExceptionHandler::Configuration do
13
13
  get('/home/model_error')
14
14
  read_test_log.should match /NoMethodError \(undefined method `foo' for nil:NilClass\)/
15
15
  read_test_log.should match /lib\/active_support\/whiny_nil\.rb:48/
16
- read_test_log.should match /PARAMS:\s+{\"controller\"=>\"home\", \"action\"=>\"model_error\"}/
16
+ read_test_log.should match /PARAMS:\s+\{/
17
17
  read_test_log.should match /TARGET:\s+http:\/\/example\.org\/home\/model_error/
18
18
  end
19
19
 
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.dirname(__FILE__)) + '/../spec_helper.rb'
1
+ require 'spec_helper'
2
2
 
3
3
  describe RailsExceptionHandler do
4
4
  it "should catch controller errors" do
data/spec/spec_helper.rb CHANGED
@@ -14,12 +14,11 @@ ActionController::Base.logger = nil
14
14
  RSpec.configure do |config|
15
15
  config.include Rack::Test::Methods
16
16
  config.include TestMacros
17
- config.around do |example|
17
+ config.color_enabled = true
18
+ config.full_backtrace = true
19
+ config.before(:each) do
18
20
  ErrorMessage.delete_all
19
21
  clear_test_log
20
22
  reset_configuration
21
- example.call
22
23
  end
23
- config.color_enabled = true
24
- config.full_backtrace = true
25
24
  end
@@ -1,4 +1,4 @@
1
-
1
+ require 'spec_helper'
2
2
 
3
3
  describe RailsExceptionHandler::Configuration do
4
4
  describe ".initialize" do
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.dirname(__FILE__)) + '/../spec_helper.rb'
1
+ require 'spec_helper'
2
2
 
3
3
  describe RailsExceptionHandler::Handler do
4
4
  before(:each) do
@@ -54,7 +54,7 @@ describe RailsExceptionHandler::Handler do
54
54
  @handler.handle_exception
55
55
  read_test_log.should match /NoMethodError \(undefined method `foo' for nil:NilClass\)/
56
56
  read_test_log.should match /lib\/active_support\/whiny_nil\.rb:48/
57
- read_test_log.should match /PARAMS:\s+{\"foo\"=>\"bar\"}/
57
+ read_test_log.should match /PARAMS:\s+\{\"foo\"=>\"bar\"\}/
58
58
  read_test_log.should match /USER_AGENT:\s+Mozilla\/4.0 \(compatible; MSIE 8\.0\)/
59
59
  read_test_log.should match /TARGET:\s+http:\/\/example\.org\/home\?foo=bar/
60
60
  read_test_log.should match /REFERER:\s+http:\/\/google\.com\//
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.dirname(__FILE__)) + '/../spec_helper.rb'
1
+ require 'spec_helper'
2
2
 
3
3
  describe RailsExceptionHandler::Parser do
4
4
  before(:each) do
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rails_exception_handler
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.0
5
+ version: 1.0.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Sharagoz
@@ -12,8 +12,62 @@ cert_chain: []
12
12
 
13
13
  date: 2011-07-17 00:00:00 +02:00
14
14
  default_executable:
15
- dependencies: []
16
-
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: rails
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - "="
22
+ - !ruby/object:Gem::Version
23
+ version: 3.0.9
24
+ type: :development
25
+ prerelease: false
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec-rails
29
+ requirement: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: "0"
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: rack-test
40
+ requirement: &id003 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - "="
44
+ - !ruby/object:Gem::Version
45
+ version: 0.5.7
46
+ type: :development
47
+ prerelease: false
48
+ version_requirements: *id003
49
+ - !ruby/object:Gem::Dependency
50
+ name: mysql2
51
+ requirement: &id004 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - "="
55
+ - !ruby/object:Gem::Version
56
+ version: 0.2.6
57
+ type: :development
58
+ prerelease: false
59
+ version_requirements: *id004
60
+ - !ruby/object:Gem::Dependency
61
+ name: jeweler
62
+ requirement: &id005 !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: *id005
17
71
  description: ""
18
72
  email: contact@sharagoz.com
19
73
  executables: []
@@ -26,6 +80,7 @@ files:
26
80
  - .travis.yml
27
81
  - Gemfile
28
82
  - Gemfile.lock
83
+ - HISTORY
29
84
  - LICENCE
30
85
  - README.markdown
31
86
  - Rakefile
@@ -56,7 +111,6 @@ files:
56
111
  - spec/testapp_30/config.ru
57
112
  - spec/testapp_30/config/application.rb
58
113
  - spec/testapp_30/config/boot.rb
59
- - spec/testapp_30/config/database.yml
60
114
  - spec/testapp_30/config/environment.rb
61
115
  - spec/testapp_30/config/environments/development.rb
62
116
  - spec/testapp_30/config/environments/production.rb
@@ -1,12 +0,0 @@
1
- test: &test
2
- adapter: mysql2
3
- encoding: utf8
4
- reconnect: false
5
- database: exception_handler_test_app_test
6
- pool: 5
7
- username: root
8
- password: admin
9
- socket: /var/run/mysqld/mysqld.sock
10
-
11
- exception_database:
12
- <<: *test