role_making 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +4 -0
- data/lib/generators/role_making_generator.rb +3 -3
- data/lib/role_making/resourcing.rb +1 -0
- data/lib/role_making/version.rb +1 -1
- data/role_making.gemspec +1 -1
- metadata +5 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 671808e6878f0a65489aa194490bfc731cf7293e5a0465910f7f5c79157807dd
|
4
|
+
data.tar.gz: 6cfc4e4fbe521afbd48ada6d1e853ab55daa9afaa9ac2cf540a87a9dfe6c2798
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7385ba48e6f6875ece97c8307ced01fedb343587f090b508fc3b86e22d5c01d6001b07407996c3c425834954b82922e0ca74312c116f1fc19792c0431ead92f8
|
7
|
+
data.tar.gz: 9fbb7235fd0b6cc252340573650401c419a33e4c20e44c15e6a38b4df80d4488301642ebe9925542b2cdfcc8e51e53c696efb3b4c6bc9d6f23212935910f34a9
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ module RoleMaking
|
|
12
12
|
def inject_user_class
|
13
13
|
model_path = File.join("app", "models", "#{name.underscore}.rb")
|
14
14
|
|
15
|
-
insert_into_file(model_path,after: "
|
15
|
+
insert_into_file(model_path,after: "ApplicationRecord\n") do
|
16
16
|
" role_making role_cname: '#{role_cname.classify}'\n"
|
17
17
|
end
|
18
18
|
|
@@ -76,7 +76,7 @@ module RoleMaking
|
|
76
76
|
|
77
77
|
join_table = "#{name.tableize}_#{role_cname.tableize}"
|
78
78
|
join_table = [name.tableize,role_cname.tableize].sort.join("_")
|
79
|
-
insert_into_file(model_path,after: "
|
79
|
+
insert_into_file(model_path,after: "ApplicationRecord\n") do
|
80
80
|
<<-EOF
|
81
81
|
RESERVED = [:admin,:guest]
|
82
82
|
has_and_belongs_to_many :#{name.tableize}, join_table: :#{join_table}
|
@@ -94,7 +94,7 @@ EOF
|
|
94
94
|
def inject_role_resource_class
|
95
95
|
model_path = File.join("app", "models", "role_resource.rb")
|
96
96
|
|
97
|
-
insert_into_file(model_path,after: "
|
97
|
+
insert_into_file(model_path,after: "ApplicationRecord\n") do
|
98
98
|
<<-EOF
|
99
99
|
validates_uniqueness_of :resource_name, scope: :#{role_cname.underscore}_id
|
100
100
|
|
@@ -42,6 +42,7 @@ module RoleMaking
|
|
42
42
|
name = "#{verb}@#{hashs.try(:delete,:res_name) || object.to_s.underscore}"
|
43
43
|
action_scope = hashs.try(:delete,:action_scope)
|
44
44
|
res_scope = hashs.try(:delete,:res_scope)
|
45
|
+
hashs = nil if hashs.blank?
|
45
46
|
resource = Res.new(name,group,verb,hashs,object,behavior,action_scope,res_scope)
|
46
47
|
@resources << resource
|
47
48
|
end
|
data/lib/role_making/version.rb
CHANGED
data/role_making.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency 'cancancan'
|
21
|
+
spec.add_dependency 'cancancan'#, '~> 1.10','>= 1.10.1'
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.7"
|
23
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
24
|
end
|
metadata
CHANGED
@@ -1,35 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: role_making
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- javy_liu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cancancan
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.10'
|
20
17
|
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
19
|
+
version: '0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '1.10'
|
30
24
|
- - ">="
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
26
|
+
version: '0'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: bundler
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,9 +94,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
94
|
version: '0'
|
101
95
|
requirements: []
|
102
96
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.
|
97
|
+
rubygems_version: 2.7.6
|
104
98
|
signing_key:
|
105
99
|
specification_version: 4
|
106
100
|
summary: for custom defined role to manage the resources
|
107
101
|
test_files: []
|
108
|
-
has_rdoc:
|