acl_system2 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
1
  Dir[File.dirname(__FILE__) + '/acl_system2/*.rb'].each do |file|
2
2
  require file
3
3
  end
4
+
5
+ if defined?(Rails) && Rails::VERSION::MAJOR > 2
6
+ require "#{ File.dirname(__FILE__) }/../rails/railtie"
7
+ end
@@ -1,3 +1,3 @@
1
1
  module ACLSystem2
2
- VERSION = '0.2.1'
2
+ VERSION = '0.3.0'
3
3
  end
@@ -1,5 +1,7 @@
1
+ # Rails 2 Campatability
1
2
  require "#{ File.dirname(__FILE__) }/../lib/acl_system2"
2
3
 
3
- ActionController::Base.send :include, ACLSystem2
4
- ActionController::Base.send :include, ACLSystem2::AccessControl
5
-
4
+ if defined?(Rails) && Rails::VERSION::MAJOR < 3
5
+ ActionController::Base.send :include, ACLSystem2
6
+ ActionController::Base.send :include, ACLSystem2::AccessControl
7
+ end
@@ -0,0 +1,10 @@
1
+ require "#{ File.dirname(__FILE__) }/../lib/acl_system2"
2
+ require 'rails'
3
+
4
+ module ACLSystem2
5
+ class Engine < Rails::Engine
6
+ initializer 'initialize acl_system2' do |app|
7
+ ActionController::Base.send :include, ACLSystem2::AccessControl
8
+ end
9
+ end
10
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acl_system2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-03-06 00:00:00.000000000 Z
14
+ date: 2013-03-07 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: minitest
@@ -84,6 +84,7 @@ files:
84
84
  - lib/acl_system2/role_handler.rb
85
85
  - lib/acl_system2/version.rb
86
86
  - rails/init.rb
87
+ - rails/railtie.rb
87
88
  - test/access_control_test.rb
88
89
  - test/mocks.rb
89
90
  - test/mocks/controller_proxy.rb