lib/picnic/authentication.rb in picnic-0.6.1 vs lib/picnic/authentication.rb in picnic-0.6.2
- old
+ new
@@ -56,11 +56,11 @@
end
end
def service(*a)
app = Kernel.const_get self.class.name.gsub(/^(\w+)::.+$/, '\1')
- unless app.methods.include? :authenticate
+ unless app.respond_to? :authenticate
raise "Basic authentication is enabled but the 'authenticate' method has not been defined."
end
@credentials = read_credentials || {}
@@ -108,17 +108,22 @@
# placed in the /public subdirectory (CSS files, JavaScripts, images, etc.). The
# public directory does not require CAS authentication, so anyone can access its
# contents.
#
module Cas
- def self.include
+ # For some reason the Module#included callback is just not working for me, so I had
+ # to resort to overriding append_features(). If anyone has any ideas why, please
+ # let me know!
+ def self.append_features(mod)
+ super
+
require 'camping/db'
require 'camping/session'
+
+ $: << File.dirname(File.expand_path(__FILE__))+"/../../../rubycas-client2/lib" # for development
+ require 'rubycas-client'
end
-
- $: << File.dirname(File.expand_path(__FILE__))+"/../../../rubycas-client2/lib" # for development
- require 'rubycas-client'
-
+
# app = Kernel.const_get self.name.gsub(/^(\w+)::.+$/, '\1')
# raise "Cannot enable CAS authentication because your Camping app does not extend Camping::Session." unless
# app.ancestors.include?(Camping::Session)
# There must be a smarter way to do this... but for now, we just re-implement
\ No newline at end of file