eac_rails_base0 0.30.2 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f51da80df146590f4571fc0be0fa13d7b06d87a9db76d5fca4555784ca0f685
4
- data.tar.gz: eb8b6f0af7335b1691b977007c0ddb156d66e3d8b004e28c8efa0972b0da4f93
3
+ metadata.gz: 9de989efc5977d5bb3f869dff1114f014fdaa44c686b13a41b67de037bc217ea
4
+ data.tar.gz: 91faae14a85590c90d9af03227b2f64ec89e4ced01326a1a088ca82088dbc096
5
5
  SHA512:
6
- metadata.gz: ebd8f70422e998300bcdd79ff468cd253d5c1ee1d00268a18ca8b5e26988e28197c4ffa5b7e152c051df7d76080150af11c1b55eda0cea464bc413a98a85c320
7
- data.tar.gz: 232ffafd2902e498eb3f3374a3299109383d7989b5c43dcd59a63bcd3eca10a4ae2fea2fd9e7729ddc8d759b153909dc3e0fb733fdf6ebc53c870fe3d097ffd3
6
+ metadata.gz: 585f89fda0a0b018d05c3ca6e039af2cbdbfde9329a035c915130e3119b47558beb398333bfce6a57fab774f1ba9a7edf7ba04b61154972434355dec5937c483
7
+ data.tar.gz: c96addb8e8388cdd32a4f3ce0f97cdcea7f7c3d70e315851057a88ddd4185d458da3042753ce66d1b49fc166bb7f5e345851efa3f3892c6e28d1525f3125d153
@@ -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'
@@ -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
@@ -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.30.2'
4
+ VERSION = '0.31.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.30.2
4
+ version: 0.31.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-05-18 00:00:00.000000000 Z
11
+ date: 2020-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha
@@ -541,6 +541,7 @@ files:
541
541
  - lib/eac_rails_base0/spec_helper/eac_users_support.rb
542
542
  - lib/eac_rails_base0/spec_helper/factory_bot.rb
543
543
  - lib/eac_rails_base0/version.rb
544
+ - lib/eac_rails_base0/x_engine.rb
544
545
  - lib/fog.rb
545
546
  - lib/generators/eac_rails_base0/abilities/abilities_generator.rb
546
547
  - lib/generators/eac_rails_base0/abilities/templates/ability.rb