abstract_auth 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- abstract_auth (0.1.0)
4
+ abstract_auth (0.1.2)
5
5
  module_ext (~> 0.1.0)
6
6
 
7
7
  GEM
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Ryan Cook and Quick Left, Inc.
1
+ Copyright (c) 2011 Quick Left, Inc.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -3,6 +3,21 @@
3
3
  ##WARNING
4
4
 
5
5
  This gem is still under development and may change significantly.
6
+ Currently, you should do the following...
7
+
8
+ * instance_eval the returns of your `invoke` calls
9
+ * not pass args to your `invoke` calls
10
+
11
+ class SampleController < ::ApplicationController
12
+ before_filter :check_authenticated
13
+ private
14
+ def check_authenticated
15
+ redirect_to root_path if !(instance_eval &AbstractAuth.invoke(:authenticated_resource))
16
+ end
17
+ end
18
+
19
+ This keeps thing readable for your end users, but a little messy for
20
+ you. Working fast on a fix.
6
21
 
7
22
  ##A Short Story
8
23
 
@@ -12,10 +12,11 @@ module AbstractAuth
12
12
  @@implementations.merge!( { requirement => blk } )
13
13
  end
14
14
 
15
+ # @todo Fix this method so that it works with args
15
16
  def self.invoke( method , *args )
16
17
  raise AbstractAuth::Errors::NonRequiredImplementationCallError.new('The requested implementation was not required!') unless @@requirements.include?(method)
17
18
  raise AbstractAuth::Errors::NotImplementedError.new('The requirement was not implemented!') unless @@implementations.has_key?(method)
18
- @@implementations[method].call(args)
19
+ @@implementations[method]
19
20
  end
20
21
 
21
22
  end
@@ -1,3 +1,3 @@
1
1
  module AbstractAuth
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abstract_auth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Cook
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-11 00:00:00 -07:00
18
+ date: 2011-01-12 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency