monarchy 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/monarchy.rb +5 -3
- data/lib/monarchy/tasks.rb +38 -0
- data/lib/monarchy/version.rb +1 -1
- metadata +3 -3
- data/lib/tasks/monarchy_tasks.rake +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f963493605d696311041686e1851bb817c7ffc79
|
4
|
+
data.tar.gz: 911449908792e86543e9e2f5f27419c83259f9dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4f3cf8d4938a0b8bb4aafcf4b66839ea0c84fd5c2326d391804a5ce2dc0f2d768dba937202b594d07870cbfabd13d0e6e67dde2774963d0d766da547b069dab
|
7
|
+
data.tar.gz: 69f1a19456a597ea7e418ed13721ef42c6864074ba3e24b3d40f63a951ec21af4aec4a4376007c8f83260e6e2e3b2403106458765460bbdfeb1513e18646222a
|
data/Gemfile.lock
CHANGED
data/lib/monarchy.rb
CHANGED
@@ -3,12 +3,14 @@ require 'closure_tree'
|
|
3
3
|
require 'configurations'
|
4
4
|
require 'active_record_union'
|
5
5
|
|
6
|
+
require 'monarchy/tasks'
|
7
|
+
require 'monarchy/engine'
|
8
|
+
|
9
|
+
require 'monarchy/acts_as_user'
|
6
10
|
require 'monarchy/acts_as_role'
|
7
11
|
require 'monarchy/acts_as_member'
|
8
|
-
require 'monarchy/acts_as_hierarchy'
|
9
12
|
require 'monarchy/acts_as_resource'
|
10
|
-
require 'monarchy/
|
11
|
-
require 'monarchy/engine'
|
13
|
+
require 'monarchy/acts_as_hierarchy'
|
12
14
|
|
13
15
|
module Monarchy
|
14
16
|
cattr_accessor :resource_classes
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'tqdm'
|
3
|
+
|
4
|
+
module Monarchy
|
5
|
+
class << self
|
6
|
+
def rebuild!
|
7
|
+
p 'Rebuilding Monarchy...'
|
8
|
+
hierarhization
|
9
|
+
reparentize
|
10
|
+
p 'Rebuilding Monarchy ended!'
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def hierarhization
|
16
|
+
p 'Monarchy hierarchization...'
|
17
|
+
Monarchy.resource_classes.with_progress.each do |klass|
|
18
|
+
klass.all.each do |model|
|
19
|
+
model.send(:ensure_hierarchy)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
p 'Monarchy hierarchization ended!'
|
23
|
+
end
|
24
|
+
|
25
|
+
def reparentize
|
26
|
+
p 'Monarchy reparentize...'
|
27
|
+
|
28
|
+
Monarchy.resource_classes.with_progress.each do |klass|
|
29
|
+
klass.all.each do |model|
|
30
|
+
model.send(:assign_parent, true)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
Monarchy::Hierarchy.rebuild!
|
35
|
+
p 'Monarchy reparentize ended!'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/monarchy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: monarchy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Exelord
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -166,8 +166,8 @@ files:
|
|
166
166
|
- lib/monarchy/acts_as_role.rb
|
167
167
|
- lib/monarchy/acts_as_user.rb
|
168
168
|
- lib/monarchy/engine.rb
|
169
|
+
- lib/monarchy/tasks.rb
|
169
170
|
- lib/monarchy/version.rb
|
170
|
-
- lib/tasks/monarchy_tasks.rake
|
171
171
|
- monarchy.gemspec
|
172
172
|
- monarchy.png
|
173
173
|
homepage: https://github.com/Exelord/Monarchy
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require 'tqdm'
|
3
|
-
|
4
|
-
task 'monarchy:reparentize' do
|
5
|
-
p 'Monarchy reparentize...'
|
6
|
-
|
7
|
-
Monarchy.resource_classes.with_progress.each do |klass|
|
8
|
-
klass.all.each do |model|
|
9
|
-
model.send(:assign_parent, true)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
Monarchy::Hierarchy.rebuild!
|
14
|
-
p 'Monarchy reparentize ended!'
|
15
|
-
end
|
16
|
-
|
17
|
-
task 'monarchy:hierarchization' do
|
18
|
-
p 'Monarchy hierarchization...'
|
19
|
-
Monarchy.resource_classes.with_progress.each do |klass|
|
20
|
-
klass.all.each do |model|
|
21
|
-
model.send(:ensure_hierarchy)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
p 'Monarchy hierarchization ended!'
|
25
|
-
end
|
26
|
-
|
27
|
-
task 'monarchy:rebuild' do
|
28
|
-
p 'Rebuilding Monarchy...'
|
29
|
-
|
30
|
-
Rake::Task['monarchy:hierarchization'].invoke
|
31
|
-
Rake::Task['monarchy:reparentize'].invoke
|
32
|
-
|
33
|
-
p 'Rebuilding Monarchy ended!'
|
34
|
-
end
|