eac_rails_base0 0.29.3 → 0.32.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
2
  SHA256:
3
- metadata.gz: d7be5d0e1a743ef9e0b7d373a2ae0030c7f82eda70072f3fbc66d1f26aef7b18
4
- data.tar.gz: 4de9cc9fcd0e50ead94d979851e82b88a075ba45469dccb35e57c361a27a010b
3
+ metadata.gz: bb3b18eec95976a1e5442f5571bc7908d4ecbb2fbfb2761557ace73bbbb100f4
4
+ data.tar.gz: 843bad1e838cbd1be6598b4b7690cb5f6f9bc076bcf07b21dbe0efc0d9d45414
5
5
  SHA512:
6
- metadata.gz: f8b9f67a7f0e33fdf3ab35076cdf44b4fdb8b79c95b76f1da55be87cbd7958e951390640cf4152f1b14c1764534e3c840f2c1abe8434fcae71d4bf4b89079a76
7
- data.tar.gz: b1e2d2c7f48d92a97ebc0eb29d94487848da71b01a498ca52e76c8f9ea435adcd9a1f5604a1d656d111574c001afb1e5169a531971d080fa38cb9a2e8712ee97
6
+ metadata.gz: 1d938a10d0d6b962dd749614dfa2ef4b18d68c5d67599ef5f50e2753ca2f2058a962d9e321844e44b29118097bf7ac0a4897f93558fbbbc502fc66cb688e7ce2
7
+ data.tar.gz: 9390b72cc354accaaf17706ac2932005768140ce3166cc8d0a7e452bff47cc889544a55205f30a311e2a463a8ea4863c8d69125b4f0ca77f8d88ca613b160638
@@ -22,3 +22,4 @@ require_dependency 'eac_rails_base0/app_base/ability_mapping'
22
22
  require_dependency 'eac_rails_base0/app_base/ability'
23
23
  require_dependency 'eac_rails_base0/boolean_value'
24
24
  require_dependency 'eac_rails_base0/patches/url_for_patch'
25
+ require_dependency 'eac_rails_base0/x_engine'
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'active_scaffold/bridges/cancan/cancan_bridge'
4
+
3
5
  module EacRailsBase0
4
6
  module AppBase
5
7
  class Ability
@@ -12,11 +14,23 @@ module EacRailsBase0
12
14
  administrator_rules(user)
13
15
  end
14
16
 
15
- def devise_rules(user)
17
+ def devise_password_rules(user)
18
+ return unless user.new_record?
19
+
20
+ can :manage, 'Devise::Password'
21
+ end
22
+
23
+ def devise_session_rules(user)
16
24
  can :destroy, 'Devise::Session' unless user.new_record?
17
25
  can :create, 'Devise::Session'
18
26
  end
19
27
 
28
+ def devise_rules(user)
29
+ %w[password session].each do |devise_module|
30
+ send("devise_#{devise_module}_rules", user)
31
+ end
32
+ end
33
+
20
34
  def administrator_rules(user)
21
35
  return unless user.administrator?
22
36
 
@@ -40,5 +40,15 @@ module EacRailsBase0App
40
40
  config.after_initialize do
41
41
  ActiveRecord::Base.logger = nil
42
42
  end
43
+
44
+ app_tmpdir = ::File.join(::Dir.tmpdir, ::Rails.root.to_path.parameterize, 'tmp')
45
+
46
+ config.assets.configure do |env|
47
+ env.cache = Sprockets::Cache::FileStore.new(
48
+ ::File.join(app_tmpdir, 'cache', 'assets'),
49
+ config.assets.cache_limit,
50
+ env.logger
51
+ )
52
+ end
43
53
  end
44
54
  end
@@ -6,6 +6,7 @@ module EacRailsBase0
6
6
  class << self
7
7
  def included(base)
8
8
  base.include(InstanceMethods)
9
+ base.include(::CanCanDryHelper)
9
10
  base.alias_method_chain :short_object_link, :base0
10
11
  base.alias_method_chain :object_path_by_class, :base0
11
12
  end
@@ -14,6 +14,7 @@ FactoryBot.define do
14
14
  factory :user, class: ::EacUsersSupport::User do
15
15
  email { 'admin@example.com' }
16
16
  password { 'mysecret' }
17
+ confirmed_at { ::Time.zone.now }
17
18
  end
18
19
  end
19
20
 
@@ -5,3 +5,13 @@ require 'factory_bot_rails'
5
5
  RSpec.configure do |config|
6
6
  config.include FactoryBot::Syntax::Methods
7
7
  end
8
+
9
+ ::FactoryBot.definition_file_paths += ::EacRailsBase0::XEngine.local.flat_map do |engine|
10
+ %w[factories test/factories spec/factories].map do |subpath|
11
+ engine.config.root.join(subpath).to_path
12
+ end
13
+ end
14
+
15
+ ::FactoryBot.find_definitions
16
+
17
+ Spring.after_fork { FactoryBot.reload } if defined?(Spring)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRailsBase0
4
- VERSION = '0.29.3'
4
+ VERSION = '0.32.0'
5
5
  end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'find'
5
+ require 'delegate'
6
+
7
+ module EacRailsBase0
8
+ # A extended version of [Rails::Engine].
9
+ class XEngine < SimpleDelegator
10
+ class << self
11
+ enable_simple_cache
12
+
13
+ def local_root
14
+ ::Rails.root.join('engines')
15
+ end
16
+
17
+ private
18
+
19
+ def all_uncached
20
+ ::Rails::Engine.subclasses.map { |engine_class| new(engine_class.instance) }
21
+ end
22
+
23
+ def local_uncached
24
+ all.select(&:local?)
25
+ end
26
+ end
27
+
28
+ def initialize(engine_instance)
29
+ super(engine_instance)
30
+ end
31
+
32
+ def local?
33
+ return false unless self.class.local_root.directory?
34
+
35
+ ::Find.find(self.class.local_root.to_path).include?(config.root.to_path)
36
+ end
37
+ end
38
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_rails_base0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.29.3
4
+ version: 0.32.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-22 00:00:00.000000000 Z
11
+ date: 2020-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.12'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 0.12.1
19
+ version: '0.14'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0.12'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 0.12.1
26
+ version: '0.14'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: bootstrap-sass
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -84,20 +78,14 @@ dependencies:
84
78
  requirements:
85
79
  - - "~>"
86
80
  - !ruby/object:Gem::Version
87
- version: '0.3'
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: 0.3.1
81
+ version: '0.5'
91
82
  type: :runtime
92
83
  prerelease: false
93
84
  version_requirements: !ruby/object:Gem::Requirement
94
85
  requirements:
95
86
  - - "~>"
96
87
  - !ruby/object:Gem::Version
97
- version: '0.3'
98
- - - ">="
99
- - !ruby/object:Gem::Version
100
- version: 0.3.1
88
+ version: '0.5'
101
89
  - !ruby/object:Gem::Dependency
102
90
  name: capybara
103
91
  requirement: !ruby/object:Gem::Requirement
@@ -152,20 +140,14 @@ dependencies:
152
140
  requirements:
153
141
  - - "~>"
154
142
  - !ruby/object:Gem::Version
155
- version: '0.7'
156
- - - ">="
157
- - !ruby/object:Gem::Version
158
- version: 0.7.1
143
+ version: '0.10'
159
144
  type: :runtime
160
145
  prerelease: false
161
146
  version_requirements: !ruby/object:Gem::Requirement
162
147
  requirements:
163
148
  - - "~>"
164
149
  - !ruby/object:Gem::Version
165
- version: '0.7'
166
- - - ">="
167
- - !ruby/object:Gem::Version
168
- version: 0.7.1
150
+ version: '0.10'
169
151
  - !ruby/object:Gem::Dependency
170
152
  name: eac_ruby_gem_support
171
153
  requirement: !ruby/object:Gem::Requirement
@@ -173,6 +155,9 @@ dependencies:
173
155
  - - "~>"
174
156
  - !ruby/object:Gem::Version
175
157
  version: '0.1'
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: 0.1.1
176
161
  type: :runtime
177
162
  prerelease: false
178
163
  version_requirements: !ruby/object:Gem::Requirement
@@ -180,48 +165,57 @@ dependencies:
180
165
  - - "~>"
181
166
  - !ruby/object:Gem::Version
182
167
  version: '0.1'
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ version: 0.1.1
183
171
  - !ruby/object:Gem::Dependency
184
172
  name: eac_ruby_gems_utils
185
173
  requirement: !ruby/object:Gem::Requirement
186
174
  requirements:
187
175
  - - "~>"
188
176
  - !ruby/object:Gem::Version
189
- version: '0.2'
177
+ version: '0.4'
190
178
  type: :runtime
191
179
  prerelease: false
192
180
  version_requirements: !ruby/object:Gem::Requirement
193
181
  requirements:
194
182
  - - "~>"
195
183
  - !ruby/object:Gem::Version
196
- version: '0.2'
184
+ version: '0.4'
197
185
  - !ruby/object:Gem::Dependency
198
186
  name: eac_ruby_utils
199
187
  requirement: !ruby/object:Gem::Requirement
200
188
  requirements:
201
189
  - - "~>"
202
190
  - !ruby/object:Gem::Version
203
- version: '0.19'
191
+ version: '0.32'
204
192
  type: :runtime
205
193
  prerelease: false
206
194
  version_requirements: !ruby/object:Gem::Requirement
207
195
  requirements:
208
196
  - - "~>"
209
197
  - !ruby/object:Gem::Version
210
- version: '0.19'
198
+ version: '0.32'
211
199
  - !ruby/object:Gem::Dependency
212
200
  name: eac_users_support
213
201
  requirement: !ruby/object:Gem::Requirement
214
202
  requirements:
215
203
  - - "~>"
216
204
  - !ruby/object:Gem::Version
217
- version: '0.4'
205
+ version: '0.6'
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: 0.6.1
218
209
  type: :runtime
219
210
  prerelease: false
220
211
  version_requirements: !ruby/object:Gem::Requirement
221
212
  requirements:
222
213
  - - "~>"
223
214
  - !ruby/object:Gem::Version
224
- version: '0.4'
215
+ version: '0.6'
216
+ - - ">="
217
+ - !ruby/object:Gem::Version
218
+ version: 0.6.1
225
219
  - !ruby/object:Gem::Dependency
226
220
  name: factory_bot_rails
227
221
  requirement: !ruby/object:Gem::Requirement
@@ -380,20 +374,14 @@ dependencies:
380
374
  requirements:
381
375
  - - "~>"
382
376
  - !ruby/object:Gem::Version
383
- version: '0.2'
384
- - - ">="
385
- - !ruby/object:Gem::Version
386
- version: 0.2.3
377
+ version: '0.4'
387
378
  type: :runtime
388
379
  prerelease: false
389
380
  version_requirements: !ruby/object:Gem::Requirement
390
381
  requirements:
391
382
  - - "~>"
392
383
  - !ruby/object:Gem::Version
393
- version: '0.2'
394
- - - ">="
395
- - !ruby/object:Gem::Version
396
- version: 0.2.3
384
+ version: '0.4'
397
385
  - !ruby/object:Gem::Dependency
398
386
  name: therubyracer
399
387
  requirement: !ruby/object:Gem::Requirement
@@ -553,6 +541,7 @@ files:
553
541
  - lib/eac_rails_base0/spec_helper/eac_users_support.rb
554
542
  - lib/eac_rails_base0/spec_helper/factory_bot.rb
555
543
  - lib/eac_rails_base0/version.rb
544
+ - lib/eac_rails_base0/x_engine.rb
556
545
  - lib/fog.rb
557
546
  - lib/generators/eac_rails_base0/abilities/abilities_generator.rb
558
547
  - lib/generators/eac_rails_base0/abilities/templates/ability.rb