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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ee35ff7681e64755e2287e318540e66ef5fd891
4
- data.tar.gz: 60d1a4cf7ba3727517250c2a44c40024cc211224
3
+ metadata.gz: f963493605d696311041686e1851bb817c7ffc79
4
+ data.tar.gz: 911449908792e86543e9e2f5f27419c83259f9dc
5
5
  SHA512:
6
- metadata.gz: 66f9f19fe4eaffd3e31f4324b55d69f4b5ed8afaf9d1adf6b370ff990b12a1ee9300b2ebdc9f159f81242535fbfc208f35d2417179afc3406ce19f7c37973b07
7
- data.tar.gz: ecca2c24e3c2eb3f830d52e720ad6dc0ec54e876fe4a4596b768a981ba3004d496a05d8680668af9a2a80d54f642474c1f3eca81e8390e4520bb8714ee47bf79
6
+ metadata.gz: b4f3cf8d4938a0b8bb4aafcf4b66839ea0c84fd5c2326d391804a5ce2dc0f2d768dba937202b594d07870cbfabd13d0e6e67dde2774963d0d766da547b069dab
7
+ data.tar.gz: 69f1a19456a597ea7e418ed13721ef42c6864074ba3e24b3d40f63a951ec21af4aec4a4376007c8f83260e6e2e3b2403106458765460bbdfeb1513e18646222a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- monarchy (1.1.3)
4
+ monarchy (1.1.4)
5
5
  active_record_union (= 1.2.0)
6
6
  closure_tree (= 6.1.0)
7
7
  configurations (= 2.2.0)
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/acts_as_user'
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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Monarchy
3
- VERSION = '1.1.3'
3
+ VERSION = '1.1.4'
4
4
  end
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.3
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-15 00:00:00.000000000 Z
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