abilities 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +9 -9
- data/Rakefile +1 -1
- data/lib/abilities.rb +10 -1
- data/lib/abilities/action_controller/base.rb +2 -2
- data/lib/abilities/action_view/base.rb +2 -2
- data/lib/abilities/concern.rb +1 -1
- data/lib/abilities/configuration.rb +13 -0
- data/lib/abilities/definitions.rb +1 -1
- data/lib/abilities/exceptions.rb +1 -1
- data/lib/abilities/proxy.rb +1 -1
- data/lib/abilities/railtie.rb +1 -1
- data/lib/abilities/version.rb +2 -2
- data/lib/generators/abilities/install_generator.rb +1 -1
- data/lib/generators/abilities/templates/abilities.rb +1 -1
- data/test/changes_test.rb +1 -1
- data/test/checking_test.rb +1 -1
- data/test/controller_test.rb +1 -1
- data/test/dummy/README.rdoc +1 -1
- data/test/dummy/Rakefile +1 -1
- data/test/dummy/app/assets/javascripts/application.js +1 -1
- data/test/dummy/app/assets/stylesheets/application.css +1 -1
- data/test/dummy/app/controllers/application_controller.rb +1 -1
- data/test/dummy/app/helpers/application_helper.rb +1 -1
- data/test/dummy/app/models/post.rb +1 -1
- data/test/dummy/app/models/user.rb +1 -1
- data/test/dummy/app/views/layouts/application.html.erb +1 -1
- data/test/dummy/bin/bundle +1 -1
- data/test/dummy/bin/rails +1 -1
- data/test/dummy/bin/rake +1 -1
- data/test/dummy/config.ru +1 -1
- data/test/dummy/config/abilities.rb +1 -1
- data/test/dummy/config/application.rb +1 -1
- data/test/dummy/config/boot.rb +1 -1
- data/test/dummy/config/database.yml +1 -1
- data/test/dummy/config/environment.rb +1 -1
- data/test/dummy/config/environments/development.rb +1 -1
- data/test/dummy/config/environments/production.rb +1 -1
- data/test/dummy/config/environments/test.rb +1 -1
- data/test/dummy/config/initializers/abilities.rb +7 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +1 -1
- data/test/dummy/config/initializers/cookies_serializer.rb +1 -1
- data/test/dummy/config/initializers/filter_parameter_logging.rb +1 -1
- data/test/dummy/config/initializers/inflections.rb +1 -1
- data/test/dummy/config/initializers/mime_types.rb +1 -1
- data/test/dummy/config/initializers/secret_token.rb +1 -1
- data/test/dummy/config/initializers/session_store.rb +1 -1
- data/test/dummy/config/initializers/wrap_parameters.rb +1 -1
- data/test/dummy/config/locales/en.yml +1 -1
- data/test/dummy/config/routes.rb +1 -1
- data/test/dummy/config/secrets.yml +1 -1
- data/test/dummy/db/migrate/20140629203344_create_users.rb +1 -1
- data/test/dummy/db/migrate/20140629203412_create_posts.rb +1 -1
- data/test/dummy/db/schema.rb +1 -1
- data/test/dummy/log/test.log +246 -0
- data/test/dummy/public/404.html +1 -1
- data/test/dummy/public/422.html +1 -1
- data/test/dummy/public/500.html +1 -1
- data/test/generator_test.rb +1 -1
- data/test/test_helper.rb +1 -1
- data/test/view_test.rb +1 -1
- metadata +9 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73ae248bbe708f9a398a788c4db88773f66bbf08
|
4
|
+
data.tar.gz: c59fcc7224d4493496754293d535d2e35e28a5b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad7edc77a9356754a83df963fa96ff53fb677e89a3cbab259b68465973bbf581b594cf40c52fcd0edf663be587471816e3628943ec2940f94a50b7221f941687
|
7
|
+
data.tar.gz: 55d7a75da416b82320cb3fb36c5d8499ed478485d03baf4c5aab7ed74e06d0e34c37d66e42d1f4a083fdca262346a03712a2b2ea26f1409c85f92310da14f47a
|
data/MIT-LICENSE
CHANGED
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
17
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
18
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
19
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/abilities.svg)](http://badge.fury.io/rb/abilities)
|
2
|
-
[![Code Climate](https://codeclimate.com/github/mmontossi/abilities/badges/gpa.svg)](https://codeclimate.com/github/mmontossi/abilities)
|
2
|
+
[![Code Climate](https://codeclimate.com/github/mmontossi/abilities/badges/gpa.svg)](https://codeclimate.com/github/mmontossi/abilities)
|
3
|
+
[![Build Status](https://travis-ci.org/mmontossi/abilities.svg)](https://travis-ci.org/mmontossi/abilities)
|
3
4
|
[![Dependency Status](https://gemnasium.com/mmontossi/abilities.svg)](https://gemnasium.com/mmontossi/abilities)
|
4
5
|
|
5
6
|
# Abilities
|
@@ -25,17 +26,16 @@ Generate the abilities configuration file:
|
|
25
26
|
bundle exec rails g abilities:install
|
26
27
|
```
|
27
28
|
|
28
|
-
|
29
|
+
Define the user fetcher for your controllers and views:
|
29
30
|
```ruby
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
@current_user ||= User.find_by(id: session[:user_id])
|
31
|
+
Abilities.configure do |config|
|
32
|
+
config.fetcher do
|
33
|
+
current_user
|
34
34
|
end
|
35
35
|
end
|
36
36
|
```
|
37
37
|
|
38
|
-
Add the abilities concern to the model:
|
38
|
+
Add the abilities concern to the model if you want to call can? and cannot? in the user instance:
|
39
39
|
```ruby
|
40
40
|
class User < ActiveRecord::Base
|
41
41
|
include Abilities::Concern
|
@@ -68,7 +68,7 @@ Abilities.define do
|
|
68
68
|
end
|
69
69
|
```
|
70
70
|
|
71
|
-
NOTE: Any method besides can and cannot references the
|
71
|
+
NOTE: Any method besides can and cannot references the user instance.
|
72
72
|
|
73
73
|
### Checking
|
74
74
|
|
@@ -113,4 +113,4 @@ This gem is maintained and funded by [mmontossi](https://github.com/mmontossi).
|
|
113
113
|
|
114
114
|
## License
|
115
115
|
|
116
|
-
It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
|
116
|
+
It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
|
data/Rakefile
CHANGED
data/lib/abilities.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'abilities/action_controller/base'
|
2
2
|
require 'abilities/action_view/base'
|
3
3
|
require 'abilities/proxy'
|
4
|
+
require 'abilities/configuration'
|
4
5
|
require 'abilities/definitions'
|
5
6
|
require 'abilities/exceptions'
|
6
7
|
require 'abilities/concern'
|
@@ -9,6 +10,14 @@ require 'abilities/railtie'
|
|
9
10
|
module Abilities
|
10
11
|
class << self
|
11
12
|
|
13
|
+
def configure
|
14
|
+
yield configuration
|
15
|
+
end
|
16
|
+
|
17
|
+
def configuration
|
18
|
+
@configuration ||= Configuration.new
|
19
|
+
end
|
20
|
+
|
12
21
|
def define(&block)
|
13
22
|
@block = block
|
14
23
|
end
|
@@ -22,4 +31,4 @@ module Abilities
|
|
22
31
|
end
|
23
32
|
|
24
33
|
end
|
25
|
-
end
|
34
|
+
end
|
@@ -7,7 +7,7 @@ module Abilities
|
|
7
7
|
|
8
8
|
%w(can? cannot?).each do |name|
|
9
9
|
define_method name do |action, subject|
|
10
|
-
Abilities.send name,
|
10
|
+
Abilities.send name, instance_exec(&Abilities.configuration.fetcher), action, subject
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
@@ -17,4 +17,4 @@ module Abilities
|
|
17
17
|
|
18
18
|
end
|
19
19
|
end
|
20
|
-
end
|
20
|
+
end
|
@@ -5,10 +5,10 @@ module Abilities
|
|
5
5
|
|
6
6
|
%w(can? cannot?).each do |name|
|
7
7
|
define_method name do |action, subject|
|
8
|
-
Abilities.send name,
|
8
|
+
Abilities.send name, instance_exec(&Abilities.configuration.fetcher), action, subject
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
end
|
13
13
|
end
|
14
|
-
end
|
14
|
+
end
|
data/lib/abilities/concern.rb
CHANGED
data/lib/abilities/exceptions.rb
CHANGED
data/lib/abilities/proxy.rb
CHANGED
data/lib/abilities/railtie.rb
CHANGED
data/lib/abilities/version.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
Abilities.define do
|
2
|
-
end
|
2
|
+
end
|
data/test/changes_test.rb
CHANGED
data/test/checking_test.rb
CHANGED
data/test/controller_test.rb
CHANGED
data/test/dummy/README.rdoc
CHANGED
data/test/dummy/Rakefile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
module ApplicationHelper
|
2
|
-
end
|
2
|
+
end
|
data/test/dummy/bin/bundle
CHANGED
data/test/dummy/bin/rails
CHANGED
data/test/dummy/bin/rake
CHANGED
data/test/dummy/config.ru
CHANGED
data/test/dummy/config/boot.rb
CHANGED
@@ -2,4 +2,4 @@
|
|
2
2
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
|
3
3
|
|
4
4
|
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
5
|
-
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
|
5
|
+
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
|
@@ -4,4 +4,4 @@
|
|
4
4
|
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
5
|
|
6
6
|
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
-
# Rails.backtrace_cleaner.remove_silencers!
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -1 +1 @@
|
|
1
|
-
Dummy::Application.config.secret_key_base = '2a5f2475b72242d6835656e2091073d9adcbf05f117ec0a952849e79bf364060ec77979a2d147e4c0a91ae2d6f306412aae345b2d9b30d2337496695fb8b8167'
|
1
|
+
Dummy::Application.config.secret_key_base = '2a5f2475b72242d6835656e2091073d9adcbf05f117ec0a952849e79bf364060ec77979a2d147e4c0a91ae2d6f306412aae345b2d9b30d2337496695fb8b8167'
|
data/test/dummy/config/routes.rb
CHANGED
data/test/dummy/db/schema.rb
CHANGED
@@ -0,0 +1,246 @@
|
|
1
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" text, "user_id" integer, "created_at" datetime, "updated_at" datetime) [0m
|
2
|
+
[1m[35m (0.1ms)[0m CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "email" varchar, "admin" boolean, "created_at" datetime, "updated_at" datetime)
|
3
|
+
[1m[36m (0.1ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
4
|
+
[1m[35m (0.4ms)[0m select sqlite_version(*)
|
5
|
+
[1m[36m (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
6
|
+
[1m[35m (0.0ms)[0m SELECT version FROM "schema_migrations"
|
7
|
+
[1m[36m (0.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140629203412')[0m
|
8
|
+
[1m[35m (0.1ms)[0m begin transaction
|
9
|
+
-------------------------
|
10
|
+
ViewTest: test_can_helper
|
11
|
+
-------------------------
|
12
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
13
|
+
[1m[35m (0.0ms)[0m begin transaction
|
14
|
+
----------------------------
|
15
|
+
ViewTest: test_cannot_helper
|
16
|
+
----------------------------
|
17
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
18
|
+
[1m[35m (0.1ms)[0m begin transaction
|
19
|
+
------------------------------------
|
20
|
+
CheckingTest: test_cannot_definition
|
21
|
+
------------------------------------
|
22
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23
|
+
[1m[35m (0.0ms)[0m begin transaction
|
24
|
+
-------------------------------------
|
25
|
+
CheckingTest: test_ability_conditions
|
26
|
+
-------------------------------------
|
27
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
28
|
+
[1m[35m (0.0ms)[0m begin transaction
|
29
|
+
---------------------------------------
|
30
|
+
CheckingTest: test_undefined_definition
|
31
|
+
---------------------------------------
|
32
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
33
|
+
[1m[35m (0.0ms)[0m begin transaction
|
34
|
+
------------------------------
|
35
|
+
CheckingTest: test_all_subject
|
36
|
+
------------------------------
|
37
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
38
|
+
[1m[35m (0.0ms)[0m begin transaction
|
39
|
+
-----------------------------------------------
|
40
|
+
CheckingTest: test_can_definition_with_instance
|
41
|
+
-----------------------------------------------
|
42
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
43
|
+
[1m[35m (0.0ms)[0m begin transaction
|
44
|
+
--------------------------------
|
45
|
+
CheckingTest: test_manage_action
|
46
|
+
--------------------------------
|
47
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
48
|
+
[1m[35m (0.0ms)[0m begin transaction
|
49
|
+
--------------------------------
|
50
|
+
CheckingTest: test_ability_block
|
51
|
+
--------------------------------
|
52
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
53
|
+
[1m[35m (0.0ms)[0m begin transaction
|
54
|
+
--------------------------------------------
|
55
|
+
CheckingTest: test_can_definition_with_model
|
56
|
+
--------------------------------------------
|
57
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
58
|
+
[1m[35m (0.0ms)[0m begin transaction
|
59
|
+
--------------------------------
|
60
|
+
ChangesTest: test_record_changes
|
61
|
+
--------------------------------
|
62
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
63
|
+
[1m[35m (0.0ms)[0m begin transaction
|
64
|
+
-------------------------------------
|
65
|
+
ControllerTest: test_authorize_helper
|
66
|
+
-------------------------------------
|
67
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
68
|
+
[1m[35m (0.0ms)[0m begin transaction
|
69
|
+
-------------------------------
|
70
|
+
ControllerTest: test_can_helper
|
71
|
+
-------------------------------
|
72
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
73
|
+
[1m[35m (0.0ms)[0m begin transaction
|
74
|
+
----------------------------------
|
75
|
+
ControllerTest: test_cannot_helper
|
76
|
+
----------------------------------
|
77
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
78
|
+
[1m[35m (0.0ms)[0m begin transaction
|
79
|
+
------------------------------------------
|
80
|
+
GeneratorsTest: test_initializer_generator
|
81
|
+
------------------------------------------
|
82
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
83
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" text, "user_id" integer, "created_at" datetime, "updated_at" datetime) [0m
|
84
|
+
[1m[35m (0.1ms)[0m CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "email" varchar, "admin" boolean, "created_at" datetime, "updated_at" datetime)
|
85
|
+
[1m[36m (0.1ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
86
|
+
[1m[35m (0.0ms)[0m select sqlite_version(*)
|
87
|
+
[1m[36m (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
88
|
+
[1m[35m (0.0ms)[0m SELECT version FROM "schema_migrations"
|
89
|
+
[1m[36m (0.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140629203412')[0m
|
90
|
+
[1m[35m (0.1ms)[0m begin transaction
|
91
|
+
-------------------------
|
92
|
+
ViewTest: test_can_helper
|
93
|
+
-------------------------
|
94
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
95
|
+
[1m[35m (0.0ms)[0m begin transaction
|
96
|
+
----------------------------
|
97
|
+
ViewTest: test_cannot_helper
|
98
|
+
----------------------------
|
99
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
100
|
+
[1m[35m (0.0ms)[0m begin transaction
|
101
|
+
-------------------------------------
|
102
|
+
ControllerTest: test_authorize_helper
|
103
|
+
-------------------------------------
|
104
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
105
|
+
[1m[35m (0.0ms)[0m begin transaction
|
106
|
+
-------------------------------
|
107
|
+
ControllerTest: test_can_helper
|
108
|
+
-------------------------------
|
109
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
110
|
+
[1m[35m (0.0ms)[0m begin transaction
|
111
|
+
----------------------------------
|
112
|
+
ControllerTest: test_cannot_helper
|
113
|
+
----------------------------------
|
114
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
115
|
+
[1m[35m (0.0ms)[0m begin transaction
|
116
|
+
--------------------------------
|
117
|
+
ChangesTest: test_record_changes
|
118
|
+
--------------------------------
|
119
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
120
|
+
[1m[35m (0.0ms)[0m begin transaction
|
121
|
+
---------------------------------------
|
122
|
+
CheckingTest: test_undefined_definition
|
123
|
+
---------------------------------------
|
124
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
125
|
+
[1m[35m (0.0ms)[0m begin transaction
|
126
|
+
-------------------------------------
|
127
|
+
CheckingTest: test_ability_conditions
|
128
|
+
-------------------------------------
|
129
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
130
|
+
[1m[35m (0.0ms)[0m begin transaction
|
131
|
+
------------------------------
|
132
|
+
CheckingTest: test_all_subject
|
133
|
+
------------------------------
|
134
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
135
|
+
[1m[35m (0.0ms)[0m begin transaction
|
136
|
+
--------------------------------
|
137
|
+
CheckingTest: test_ability_block
|
138
|
+
--------------------------------
|
139
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
140
|
+
[1m[35m (0.0ms)[0m begin transaction
|
141
|
+
--------------------------------
|
142
|
+
CheckingTest: test_manage_action
|
143
|
+
--------------------------------
|
144
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
145
|
+
[1m[35m (0.0ms)[0m begin transaction
|
146
|
+
--------------------------------------------
|
147
|
+
CheckingTest: test_can_definition_with_model
|
148
|
+
--------------------------------------------
|
149
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
150
|
+
[1m[35m (0.0ms)[0m begin transaction
|
151
|
+
------------------------------------
|
152
|
+
CheckingTest: test_cannot_definition
|
153
|
+
------------------------------------
|
154
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
155
|
+
[1m[35m (0.0ms)[0m begin transaction
|
156
|
+
-----------------------------------------------
|
157
|
+
CheckingTest: test_can_definition_with_instance
|
158
|
+
-----------------------------------------------
|
159
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
160
|
+
[1m[35m (0.0ms)[0m begin transaction
|
161
|
+
------------------------------------------
|
162
|
+
GeneratorsTest: test_initializer_generator
|
163
|
+
------------------------------------------
|
164
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
165
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" text, "user_id" integer, "created_at" datetime, "updated_at" datetime) [0m
|
166
|
+
[1m[35m (0.1ms)[0m CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "email" varchar, "admin" boolean, "created_at" datetime, "updated_at" datetime)
|
167
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
168
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
169
|
+
[1m[36m (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
170
|
+
[1m[35m (0.0ms)[0m SELECT version FROM "schema_migrations"
|
171
|
+
[1m[36m (0.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140629203412')[0m
|
172
|
+
[1m[35m (0.1ms)[0m begin transaction
|
173
|
+
-------------------------
|
174
|
+
ViewTest: test_can_helper
|
175
|
+
-------------------------
|
176
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
177
|
+
[1m[35m (0.1ms)[0m begin transaction
|
178
|
+
----------------------------
|
179
|
+
ViewTest: test_cannot_helper
|
180
|
+
----------------------------
|
181
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
182
|
+
[1m[35m (0.0ms)[0m begin transaction
|
183
|
+
-----------------------------------------------
|
184
|
+
CheckingTest: test_can_definition_with_instance
|
185
|
+
-----------------------------------------------
|
186
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
187
|
+
[1m[35m (0.0ms)[0m begin transaction
|
188
|
+
--------------------------------
|
189
|
+
CheckingTest: test_manage_action
|
190
|
+
--------------------------------
|
191
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
192
|
+
[1m[35m (0.1ms)[0m begin transaction
|
193
|
+
------------------------------------
|
194
|
+
CheckingTest: test_cannot_definition
|
195
|
+
------------------------------------
|
196
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
197
|
+
[1m[35m (0.0ms)[0m begin transaction
|
198
|
+
---------------------------------------
|
199
|
+
CheckingTest: test_undefined_definition
|
200
|
+
---------------------------------------
|
201
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
202
|
+
[1m[35m (0.0ms)[0m begin transaction
|
203
|
+
--------------------------------------------
|
204
|
+
CheckingTest: test_can_definition_with_model
|
205
|
+
--------------------------------------------
|
206
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
207
|
+
[1m[35m (0.0ms)[0m begin transaction
|
208
|
+
--------------------------------
|
209
|
+
CheckingTest: test_ability_block
|
210
|
+
--------------------------------
|
211
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
212
|
+
[1m[35m (0.0ms)[0m begin transaction
|
213
|
+
-------------------------------------
|
214
|
+
CheckingTest: test_ability_conditions
|
215
|
+
-------------------------------------
|
216
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
217
|
+
[1m[35m (0.0ms)[0m begin transaction
|
218
|
+
------------------------------
|
219
|
+
CheckingTest: test_all_subject
|
220
|
+
------------------------------
|
221
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
222
|
+
[1m[35m (0.0ms)[0m begin transaction
|
223
|
+
--------------------------------
|
224
|
+
ChangesTest: test_record_changes
|
225
|
+
--------------------------------
|
226
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
227
|
+
[1m[35m (0.0ms)[0m begin transaction
|
228
|
+
-------------------------------------
|
229
|
+
ControllerTest: test_authorize_helper
|
230
|
+
-------------------------------------
|
231
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
232
|
+
[1m[35m (0.0ms)[0m begin transaction
|
233
|
+
-------------------------------
|
234
|
+
ControllerTest: test_can_helper
|
235
|
+
-------------------------------
|
236
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
237
|
+
[1m[35m (0.0ms)[0m begin transaction
|
238
|
+
----------------------------------
|
239
|
+
ControllerTest: test_cannot_helper
|
240
|
+
----------------------------------
|
241
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
242
|
+
[1m[35m (0.0ms)[0m begin transaction
|
243
|
+
------------------------------------------
|
244
|
+
GeneratorsTest: test_initializer_generator
|
245
|
+
------------------------------------------
|
246
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
data/test/dummy/public/404.html
CHANGED
data/test/dummy/public/422.html
CHANGED
data/test/dummy/public/500.html
CHANGED
data/test/generator_test.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -21,4 +21,4 @@ ActiveRecord::Base.establish_connection(config['test'])
|
|
21
21
|
load(File.expand_path('../dummy/db/schema.rb', __FILE__))
|
22
22
|
|
23
23
|
# Include helpers
|
24
|
-
ActionView::TestCase.send :include, Abilities::ActionView::Base
|
24
|
+
ActionView::TestCase.send :include, Abilities::ActionView::Base
|
data/test/view_test.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abilities
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mmontossi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -58,6 +58,7 @@ files:
|
|
58
58
|
- lib/abilities/action_controller/base.rb
|
59
59
|
- lib/abilities/action_view/base.rb
|
60
60
|
- lib/abilities/concern.rb
|
61
|
+
- lib/abilities/configuration.rb
|
61
62
|
- lib/abilities/definitions.rb
|
62
63
|
- lib/abilities/exceptions.rb
|
63
64
|
- lib/abilities/proxy.rb
|
@@ -89,6 +90,7 @@ files:
|
|
89
90
|
- test/dummy/config/environments/development.rb
|
90
91
|
- test/dummy/config/environments/production.rb
|
91
92
|
- test/dummy/config/environments/test.rb
|
93
|
+
- test/dummy/config/initializers/abilities.rb
|
92
94
|
- test/dummy/config/initializers/backtrace_silencers.rb
|
93
95
|
- test/dummy/config/initializers/cookies_serializer.rb
|
94
96
|
- test/dummy/config/initializers/filter_parameter_logging.rb
|
@@ -103,6 +105,7 @@ files:
|
|
103
105
|
- test/dummy/db/migrate/20140629203344_create_users.rb
|
104
106
|
- test/dummy/db/migrate/20140629203412_create_posts.rb
|
105
107
|
- test/dummy/db/schema.rb
|
108
|
+
- test/dummy/log/test.log
|
106
109
|
- test/dummy/public/404.html
|
107
110
|
- test/dummy/public/422.html
|
108
111
|
- test/dummy/public/500.html
|
@@ -122,7 +125,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
122
125
|
requirements:
|
123
126
|
- - ">="
|
124
127
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
128
|
+
version: 2.0.0
|
126
129
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
130
|
requirements:
|
128
131
|
- - ">="
|
@@ -130,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
133
|
version: '0'
|
131
134
|
requirements: []
|
132
135
|
rubyforge_project:
|
133
|
-
rubygems_version: 2.
|
136
|
+
rubygems_version: 2.5.1
|
134
137
|
signing_key:
|
135
138
|
specification_version: 4
|
136
139
|
summary: Abilities for rails.
|
@@ -156,6 +159,7 @@ test_files:
|
|
156
159
|
- test/dummy/config/environments/development.rb
|
157
160
|
- test/dummy/config/environments/production.rb
|
158
161
|
- test/dummy/config/environments/test.rb
|
162
|
+
- test/dummy/config/initializers/abilities.rb
|
159
163
|
- test/dummy/config/initializers/backtrace_silencers.rb
|
160
164
|
- test/dummy/config/initializers/cookies_serializer.rb
|
161
165
|
- test/dummy/config/initializers/filter_parameter_logging.rb
|
@@ -171,6 +175,7 @@ test_files:
|
|
171
175
|
- test/dummy/db/migrate/20140629203344_create_users.rb
|
172
176
|
- test/dummy/db/migrate/20140629203412_create_posts.rb
|
173
177
|
- test/dummy/db/schema.rb
|
178
|
+
- test/dummy/log/test.log
|
174
179
|
- test/dummy/public/404.html
|
175
180
|
- test/dummy/public/422.html
|
176
181
|
- test/dummy/public/500.html
|