wrangler 0.1.19 → 0.1.20

Sign up to get free protection for your applications and to get access to all the features.
data/TODO CHANGED
@@ -1,13 +1,7 @@
1
1
  This is a collection of things that could/should be worked on:
2
2
 
3
- == Right away:
4
- * rename the gem (see a juggler on gemcutter already!)
5
- ** remove repository on github
6
- ** create new repository and upload
7
- ** push to gemcutter
8
-
9
3
  == Robustness:
10
- * in juggler.rb : render_error_template(), if we fail to find a template for the
4
+ * in wrangler.rb : render_error_template(), if we fail to find a template for the
11
5
  exception/status code, we just log that fact right now. this is probably worth
12
6
  a notification in itself (that a template is missing or config is not set up
13
7
  properly)...so send an email if an appropriate template cannot be found.
@@ -27,12 +21,12 @@ implemented the ability to map exceptions to arbitrary templates, so the
27
21
  pattern/approach has been established.
28
22
  * allowing for separate exception handler (and notifier?) configuration for
29
23
  different controllers/classes. probably involves converting the ExceptionHandler
30
- class to being instantiated and have each class that includes the Juggler
24
+ class to being instantiated and have each class that includes the Wrangler
31
25
  module hold onto that instance (maybe have to move the notifier config back to
32
26
  the ExceptionHandler class where it used to be... ;) )
33
27
  * allow configuring which sections of the email are included (e.g. can leave
34
28
  out the stacktrace or the request sections...)
35
- * allow custom email views to override the Juggler email view (e.g. allowing
29
+ * allow custom email views to override the Wrangler email view (e.g. allowing
36
30
  html, additional data, formatting differences...)
37
31
  * add xml responses to the :error_class_xxx_templates pattern to allow
38
32
  configuring xml error response templates
@@ -80,7 +80,7 @@ module Wrangler
80
80
  # where to look for app-specific error page templates (ones you create
81
81
  # yourself, for example...there are some defaults in this gem you can
82
82
  # use as well...and that are configured already by default)
83
- :error_template_dir => File.join(RAILS_ROOT, 'app', 'views', 'error'),
83
+ :error_template_dir => (defined?(RAILS_ROOT) ? File.join(RAILS_ROOT, 'app', 'views', 'error') : nil),
84
84
  # excplicit mappings from exception class to arbitrary error page
85
85
  # templates, different set for html and js responses (Wrangler determines
86
86
  # which to use automatically, so you can have an entry in both
@@ -108,7 +108,12 @@ module Wrangler
108
108
  File.join(WRANGLER_ROOT,'rails','app','views','wrangler','500.html')
109
109
  }
110
110
 
111
- cattr_accessor :config
111
+ # give access to config
112
+ #-----------------------------------------------------------------------------
113
+ def self.config
114
+ @@config
115
+ end
116
+
112
117
 
113
118
  # Allows for overriding default configuration settings.
114
119
  # in your environment.rb or environments/<env name>.rb, use a block that
data/lib/wrangler.rb CHANGED
@@ -1,13 +1,17 @@
1
1
  require 'wrangler/wrangler_helper.rb'
2
2
  require 'wrangler/exception_handler.rb'
3
- require 'wrangler/exception_notifier.rb'
3
+
4
+ # the notifier is still rails-dependent...
5
+ if defined?(Rails)
6
+ require 'wrangler/exception_notifier.rb'
7
+ end
4
8
  require 'wrangler/wrangler_exceptions.rb'
5
9
 
6
10
  module Wrangler
7
11
 
8
12
  def self.included(base)
9
13
  # only add in the controller-specific methods if the including class is one
10
- if class_has_ancestor?(base, ActionController::Base)
14
+ if defined?(Rails) && class_has_ancestor?(base, ActionController::Base)
11
15
  base.send(:include, ControllerMethods)
12
16
 
13
17
  # conditionally including these methods (each wrapped in a separate
data/wrangler.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{wrangler}
8
- s.version = "0.1.19"
8
+ s.version = "0.1.20"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Brian Percival"]
12
- s.date = %q{2010-04-12}
12
+ s.date = %q{2010-05-03}
13
13
  s.description = %q{A gem for handling exceptions thrown inside your Rails app. If you include the
14
14
  gem in your application controller, wrangler will render the error pages you
15
15
  configure for each exception or HTTP error code. It will also handle notifying
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wrangler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.19
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Percival
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-04-12 00:00:00 -07:00
12
+ date: 2010-05-03 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency