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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: dd9101daa11496c2da12496ccfdd22d85a6837c2
4
- data.tar.gz: d937f52f786591f66c289b143e48555aced4cc00
2
+ SHA256:
3
+ metadata.gz: 671808e6878f0a65489aa194490bfc731cf7293e5a0465910f7f5c79157807dd
4
+ data.tar.gz: 6cfc4e4fbe521afbd48ada6d1e853ab55daa9afaa9ac2cf540a87a9dfe6c2798
5
5
  SHA512:
6
- metadata.gz: 64fd8e1222ae4be4f936203d89862873b16df5976192bad03173861197ebe2f7288435577016c416287e38ae2122b0e4a8a7cb167beca7ad39c85c8ff7a93d00
7
- data.tar.gz: 8ec78bcdd31367726287854b5a2c6ab810674df26c822593fd6be10e2dd3ea61184dd4415ce55dcc0c1fd8382eaeb81720a527ff58b6d1980f499d0e0d91908e
6
+ metadata.gz: 7385ba48e6f6875ece97c8307ced01fedb343587f090b508fc3b86e22d5c01d6001b07407996c3c425834954b82922e0ca74312c116f1fc19792c0431ead92f8
7
+ data.tar.gz: 9fbb7235fd0b6cc252340573650401c419a33e4c20e44c15e6a38b4df80d4488301642ebe9925542b2cdfcc8e51e53c696efb3b4c6bc9d6f23212935910f34a9
data/README.md CHANGED
@@ -103,3 +103,7 @@ Or install it yourself as:
103
103
  3. Commit your changes (`git commit -am 'Add some feature'`)
104
104
  4. Push to the branch (`git push origin my-new-feature`)
105
105
  5. Create a new Pull Request
106
+ 6.发布 gem
107
+ rake build
108
+ rake release
109
+
@@ -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: "ActiveRecord::Base\n") do
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: "ActiveRecord::Base\n") do
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: "ActiveRecord::Base\n") do
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
@@ -1,3 +1,3 @@
1
1
  module RoleMaking
2
- VERSION = "0.0.4"
2
+ VERSION = "0.1.0"
3
3
  end
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', '~> 1.10','>= 1.10.1'
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
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: 2015-10-26 00:00:00.000000000 Z
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: 1.10.1
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: 1.10.1
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.4.6
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: