Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added defined? checks for various Rails constants such as ActionContr…

…oller

for easier unit testing of Clearance extensions... particularly ActiveRecord
extensions... particularly strong_password.
  • Loading branch information...
commit d5620ecf562911024f132f798bdbb2b77b3a1b44 1 parent aa1071e
@croaky croaky authored
View
6 CHANGELOG.textile
@@ -1,3 +1,9 @@
+h2. 0.6.8 (06/24/2009)
+
+* Added defined? checks for various Rails constants such as ActionController
+for easier unit testing of Clearance extensions... particularly ActiveRecord
+extensions... particularly strong_password. (Dan Croak)
+
h2. 0.6.7 (06/13/2009)
* [#30] Added sign_up, sign_in, sign_out named routes. (Dan Croak)
View
2  Rakefile
@@ -51,7 +51,7 @@ task :default => ['test:all', 'test:features']
gem_spec = Gem::Specification.new do |gem_spec|
gem_spec.name = "clearance"
- gem_spec.version = "0.6.7"
+ gem_spec.version = "0.6.8"
gem_spec.summary = "Rails authentication with email & password."
gem_spec.email = "support@thoughtbot.com"
gem_spec.homepage = "http://github.com/thoughtbot/clearance"
View
4 clearance.gemspec
@@ -1,7 +1,7 @@
--- !ruby/object:Gem::Specification
name: clearance
version: !ruby/object:Gem::Version
- version: 0.6.7
+ version: 0.6.8
platform: ruby
authors:
- Dan Croak
@@ -24,7 +24,7 @@ autorequire:
bindir: bin
cert_chain: []
-date: 2009-06-13 00:00:00 -04:00
+date: 2009-06-24 00:00:00 -04:00
default_executable:
dependencies: []
View
6 lib/clearance/extensions/errors.rb
@@ -1,4 +1,6 @@
-module ActionController
- class Forbidden < StandardError
+if defined?(ActionController)
+ module ActionController
+ class Forbidden < StandardError
+ end
end
end
View
4 lib/clearance/extensions/rescue.rb
@@ -1 +1,3 @@
-ActionController::Base.rescue_responses.update('ActionController::Forbidden' => :forbidden)
+if defined?(ActionController::Base)
+ ActionController::Base.rescue_responses.update('ActionController::Forbidden' => :forbidden)
+end
View
22 lib/clearance/extensions/routes.rb
@@ -1,12 +1,14 @@
-class ActionController::Routing::RouteSet
- def load_routes_with_clearance!
- lib_path = File.dirname(__FILE__)
- clearance_routes = File.join(lib_path, *%w[.. .. .. config clearance_routes.rb])
- unless configuration_files.include?(clearance_routes)
- add_configuration_file(clearance_routes)
+if defined?(ActionController::Routing::RouteSet)
+ class ActionController::Routing::RouteSet
+ def load_routes_with_clearance!
+ lib_path = File.dirname(__FILE__)
+ clearance_routes = File.join(lib_path, *%w[.. .. .. config clearance_routes.rb])
+ unless configuration_files.include?(clearance_routes)
+ add_configuration_file(clearance_routes)
+ end
+ load_routes_without_clearance!
end
- load_routes_without_clearance!
- end
- alias_method_chain :load_routes!, :clearance
-end
+ alias_method_chain :load_routes!, :clearance
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.