Skip to content

Commit

Permalink
updated README. fixed mongoid specs. updated rails and rack dependenc…
Browse files Browse the repository at this point in the history
…ies. fixed rails test.
  • Loading branch information
rx committed Jul 23, 2013
1 parent 8b0904b commit ce230e9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
16 changes: 10 additions & 6 deletions README
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
Update Log:
Version 0.2.3 released to https://rubygems.org/gems/egregious on 7.23.2013
Merged pull requests:
Mongoid integration (#6)
Bug Fix: Bad Rails test
Updated rails and rack dependencies
Version 0.2.2 released to https://rubygems.org/gems/egregious on 2.15.2013
Merged pull requests:
Compatibility with Rails::API (#5)
Thank you dwbutler! Keep those pull requests coming.

Version 0.2.1 released to https://rubygems.org/gems/egregious on 9.21.2012
Merged pull requests:
Bug Fix: should translate status code Symbol to right HTTP STATUS CODE - avinasha
Fixes teapot bug with rails 3.2.8. - kbrown
Note: version 0.2.0 does not work with rails 3.2.8 you should update to 0.2.1
Thank you avinasha and kbrown along with all the other forks! Keep those pull requests coming.

If you would like to contribute take a look at the issues feature list, fork and issue a pull request!

Expand All @@ -29,8 +32,8 @@ provide the caller context information.

What egregious can do:

* Defines default exception handling for most common ruby, rails, warden and cancan exceptions.
(warden and cancan are optional)
* Defines default exception handling for most common ruby, rails, warden, cancan and mongoid exceptions.
(warden, cancan and mongoid are optional)
* Catches defined exceptions using a rescue_with returning the status code defined for each exception
and well structured json, xml
* For html production requests attempts to load the html error pages for the mapped status code,
Expand All @@ -42,7 +45,8 @@ provide the caller context information.


REQUIRES:
Rails 3.x
rails ~> 3.1.12
rack >= 1.3.6

USAGE:
1) Add to your Gemfile:
Expand Down Expand Up @@ -99,4 +103,4 @@ def build_html_file_path(status)
end

KNOWN ISSUES:
* If you use CanCan or Devise you must have Egregious after CanCan/Devise in your Gemfile, if not it will not handle those errors correctly.
* If you use Mongoid, CanCan or Devise you must have Egregious after CanCan/Devise in your Gemfile, if not it will not handle those errors correctly.
8 changes: 5 additions & 3 deletions egregious.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]


s.add_runtime_dependency "rails", '~> 3.1.12'
s.add_runtime_dependency "rack", '>= 1.3.6'
s.add_runtime_dependency "htmlentities"

# specify any dependencies here; for example:
s.add_development_dependency "rspec"
s.add_development_dependency "json"
Expand All @@ -27,8 +32,5 @@ Gem::Specification.new do |s|
s.add_development_dependency "mongoid"
s.add_development_dependency "bson_ext"

s.add_runtime_dependency "rails", '>= 3.0.1'
s.add_runtime_dependency "rack"
s.add_runtime_dependency "htmlentities"

end
2 changes: 1 addition & 1 deletion lib/egregious.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def self._load_exception_codes
end

@@exception_codes = self._load_exception_codes
@@root = defined?(Rail) ? Rails.root : nil
@@root = defined?(Rails) ? Rails.root : nil

# exposes the root of the app
def self.root
Expand Down
2 changes: 1 addition & 1 deletion lib/egregious/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Egregious
VERSION = "0.2.2"
VERSION = "0.2.3"
end
4 changes: 2 additions & 2 deletions spec/exceptions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ class TestModel

it "should output json with a short problem description" do
result = JSON.parse(exception.to_json)
result['error'].should == error_message
result['error'].should =~ /#{error_message}/
end

it "should output xml with a short problem description" do
doc = Hpricot.XML(exception.to_xml)
(doc/:errors).each do |error|
HTMLEntities.new.decode((error/:error).inner_html).should == error_message
HTMLEntities.new.decode((error/:error).inner_html).should =~ /#{error_message}/
end
end
end
Expand Down

0 comments on commit ce230e9

Please sign in to comment.