aegis 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.3
1
+ 2.0.4
data/aegis.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{aegis}
8
- s.version = "2.0.3"
8
+ s.version = "2.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Henning Koch", "Tobias Kraze"]
12
- s.date = %q{2010-05-09}
12
+ s.date = %q{2010-05-29}
13
13
  s.description = %q{Aegis is an authorization solution for Ruby on Rails that supports roles and a RESTish, resource-style declaration of permission rules.}
14
14
  s.email = %q{henning.koch@makandra.de}
15
15
  s.extra_rdoc_files = [
data/lib/aegis/parser.rb CHANGED
@@ -17,6 +17,8 @@ module Aegis
17
17
  end
18
18
 
19
19
  def action(*args, &block)
20
+ # useful warning for people upgrading from Aegis 2
21
+ raise "action blocks do not take block arguments. allow/deny blocks do." if block && block.arity > 0
20
22
  split_definitions(*args) do |name, options|
21
23
  @atoms.push({
22
24
  :type => :action,
@@ -322,6 +322,18 @@ describe Aegis::Permissions do
322
322
 
323
323
  end
324
324
 
325
+ it "should raise an error if the argument is given to the action (Aegis 1) instead of the allow block (Aegis 2)" do
326
+
327
+ expect do
328
+ @permissions.class_eval do
329
+ action :sign_in do |password|
330
+ allow :everyone
331
+ end
332
+ end
333
+ end.to raise_error
334
+
335
+ end
336
+
325
337
  it "should provide the object and parent_object for a sieve block" do
326
338
  spy = stub("spy")
327
339
  @permissions.class_eval do
@@ -566,6 +578,4 @@ describe Aegis::Permissions do
566
578
 
567
579
  end
568
580
 
569
-
570
581
  end
571
-
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 0
8
- - 3
9
- version: 2.0.3
8
+ - 4
9
+ version: 2.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Henning Koch
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-05-09 00:00:00 +02:00
18
+ date: 2010-05-29 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21