aegis 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.1
1
+ 2.0.2
data/aegis.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{aegis}
8
- s.version = "2.0.1"
8
+ s.version = "2.0.2"
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"]
data/lib/aegis.rb CHANGED
@@ -1,20 +1,2 @@
1
- require 'ostruct'
2
-
3
- #for file in Dir["#{File.dirname(__FILE__)}/*/*.rb"]
4
- # p file
5
- #end
6
-
7
- # Dir["#{File.dirname(__FILE__)}/**/*.rb"].each {|f| require f}
8
-
9
1
  require 'aegis/loader'
10
- require 'aegis/access_denied'
11
- require 'aegis/action'
12
- require 'aegis/compiler'
13
- require 'aegis/has_role'
14
- require 'aegis/parser'
15
- require 'aegis/permissions'
16
- require 'aegis/role'
17
- require 'aegis/sieve'
18
-
19
- require 'rails/action_controller'
20
- require 'rails/active_record'
2
+ Aegis::Loader.load_paths
data/lib/aegis/loader.rb CHANGED
@@ -1,26 +1,35 @@
1
- class Aegis::Loader
2
- class << self
1
+ module Aegis
2
+ class Loader
3
+ class << self
3
4
 
4
- def paths
5
- [ 'aegis/access_denied',
6
- 'aegis/action',
7
- 'aegis/compiler',
8
- 'aegis/has_role',
9
- 'aegis/parser',
10
- 'aegis/permissions',
11
- 'aegis/resource',
12
- 'aegis/role',
13
- 'aegis/sieve',
5
+ def paths
6
+ [ 'ostruct',
14
7
 
15
- 'rails/action_controller',
16
- 'rails/active_record' ]
17
- end
8
+ 'aegis/access_denied',
9
+ 'aegis/action',
10
+ 'aegis/compiler',
11
+ 'aegis/has_role',
12
+ 'aegis/parser',
13
+ 'aegis/permissions',
14
+ 'aegis/resource',
15
+ 'aegis/role',
16
+ 'aegis/sieve',
17
+
18
+ 'rails/action_controller',
19
+ 'rails/active_record' ]
20
+ end
18
21
 
19
- def load
20
- for path in paths
21
- require path
22
+ def load_paths
23
+ for path in paths
24
+ require path
25
+ end
26
+ @loaded = true
22
27
  end
28
+
29
+ def loaded?
30
+ @loaded
31
+ end
32
+
23
33
  end
24
-
25
34
  end
26
- end
35
+ end
data/spec/loader_spec.rb CHANGED
@@ -7,12 +7,19 @@ describe Aegis::Loader do
7
7
  it "should return all paths in the lib folder" do
8
8
 
9
9
  root = "#{File.dirname(__FILE__)}/../lib/"
10
- expected_paths = Dir["#{root}*/*.rb"].collect do |file|
11
- file.sub(root, "").sub(/\.rb$/, "")
12
- end - ['aegis/loader']
10
+ Dir["#{root}*/*.rb"].collect do |file|
11
+ path = file.sub(root, "").sub(/\.rb$/, "")
12
+ Aegis::Loader.paths.should include(path) unless path == 'aegis/loader'
13
+ end
13
14
 
14
- Aegis::Loader.paths.should =~ expected_paths
15
+ end
16
+
17
+ end
18
+
19
+ describe 'loaded?' do
15
20
 
21
+ it "should be loaded" do
22
+ Aegis::Loader.should be_loaded
16
23
  end
17
24
 
18
25
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 0
8
- - 1
9
- version: 2.0.1
8
+ - 2
9
+ version: 2.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Henning Koch