CanCanCanSee 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35a223683b0fbd58a5940a756b693ce857971f53
4
- data.tar.gz: 1687dede8a60c8b7f8a07323b32ddd5d7578f8be
3
+ metadata.gz: 514901faab1095209ba527e761db9cfd9698edb1
4
+ data.tar.gz: 7803f5c9d864e651a8107612b88dbf430003ae91
5
5
  SHA512:
6
- metadata.gz: 0e988404ed8936bae1f2265dd18bd56bc6555ce97985c1fedc97854c431fa8ad7b1ab437a90443d2592a5a902556169d18f0c1de23727fe807bcff0eb9271e61
7
- data.tar.gz: 5408c4b0a042a331d2b996cb2e34d70113da86e07b9064fdb43a37b0c7e01933d0d55e2e07d8fc481ed9d82c6b7d5da289fa6475d7a15a2868ca4f325d68aba3
6
+ metadata.gz: 8e5d69531d698449042d2bd2a11e1cea32cb41f34e0b8300e85e167b725c6f0a635f86f295a4ca5b59a98c8b955124cb3ec1dc15bfa7e8053713b834c84d06f5
7
+ data.tar.gz: e8ad253848158da6fee251f872077cdef09a78068223ceb289a7ce95db5f9c95dfbfb1e9caa7fbb07779111d1aabe08176acfac6b221b655516e5b62969dbe32
data/lib/CanCanCanSee.rb CHANGED
@@ -1,7 +1,8 @@
1
1
  require "CanCanCanSee/version"
2
- require 'pry'
3
- module CanCanCanSee
4
2
 
3
+ module CanCanCanSee
4
+ require 'CanCanCanSee/railtie' if defined?(Rails)
5
+
5
6
  MY_GLOBAL_HOLDER_OF_ABILITY = Hash.new
6
7
 
7
8
  def self.initiate_gem
@@ -0,0 +1,12 @@
1
+ require 'cancancansee'
2
+ require 'rails'
3
+
4
+ module CanCanCanSee
5
+ class Railtie < Rails::Railtie
6
+ railtie_name :cancancansee
7
+
8
+ rake_tasks do
9
+ load 'tasks/custom_actions.rake'
10
+ end
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module CanCanCanSee
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -1,30 +1,15 @@
1
- task abilities: :environment do
2
1
 
3
- CanCanCanSee.establish_variable
4
- @current_slug_abilities = MY_GLOBAL_HOLDER_OF_ABILITY[Figaro.env.slug]
2
+ namespace :cancancansee do
5
3
 
6
- @current_slug_abilities.each do |key, value|
7
- print "\n\n"
8
- print "Role: #{key}:\n"
9
- value.each do |can, can_value|
10
- print " #{can}\n"
11
- can_value = can_value.sort
12
- can_value.each do |can_value_element|
13
- print " #{can_value_element}\n"
14
- end
15
- end
16
- end
17
- end
18
-
19
- task abilities_all_slugs: :environment do
20
- @current_slug_abilities = MY_GLOBAL_HOLDER_OF_ABILITY
4
+ desc 'List current abilities established.'
5
+ task :abilities do
6
+ CanCanCanSee.establish_variable
7
+ @current_slug_abilities = MY_GLOBAL_HOLDER_OF_ABILITY[Figaro.env.slug]
21
8
 
22
- @current_slug_abilities.each do |key, value|
23
- print "\n\n"
24
- print "Slug: #{key}\n\n"
25
- value.each do |role_key, role_value|
26
- print " Role: #{role_key}:\n\n"
27
- role_value.each do |can, can_value|
9
+ @current_slug_abilities.each do |key, value|
10
+ print "\n\n"
11
+ print "Role: #{key}:\n"
12
+ value.each do |can, can_value|
28
13
  print " #{can}\n"
29
14
  can_value = can_value.sort
30
15
  can_value.each do |can_value_element|
@@ -34,4 +19,24 @@ task abilities_all_slugs: :environment do
34
19
  end
35
20
  end
36
21
 
22
+ desc 'Lists current abilities for all slugs'
23
+ task :abilities_all_slugs do
24
+ @current_slug_abilities = MY_GLOBAL_HOLDER_OF_ABILITY
25
+
26
+ @current_slug_abilities.each do |key, value|
27
+ print "\n\n"
28
+ print "Slug: #{key}\n\n"
29
+ value.each do |role_key, role_value|
30
+ print " Role: #{role_key}:\n\n"
31
+ role_value.each do |can, can_value|
32
+ print " #{can}\n"
33
+ can_value = can_value.sort
34
+ can_value.each do |can_value_element|
35
+ print " #{can_value_element}\n"
36
+ end
37
+ end
38
+ end
39
+ end
40
+
41
+ end
37
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: CanCanCanSee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Schwaderer
@@ -86,6 +86,7 @@ files:
86
86
  - bin/console
87
87
  - bin/setup
88
88
  - lib/CanCanCanSee.rb
89
+ - lib/CanCanCanSee/railtie.rb
89
90
  - lib/CanCanCanSee/version.rb
90
91
  - lib/tasks/custom_actions.rake
91
92
  homepage: https://github.com/schwad/cancancansee