feature_pack 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/changelog.md +2 -0
- data/lib/feature_pack/controller.rb +15 -13
- data/lib/feature_pack/group_controller.rb +14 -13
- metadata +13 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f70a5116de8367b0eecf7c72cbab4762b6c28ded77c2cfd7b0df4369e4d82431
|
4
|
+
data.tar.gz: ca02d7cc7f78755908a3adec71641b8740f423cf7eab65d5b2f92c0b1755e861
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b9ea87e71245fc6d56827d933b4ca32ebd6e1e1a8c144b1ba62ca4a005fce36244414a6c278b4f0ff5e263e73ebc0b71617b09f9fba16816804c4cad7ea3d79
|
7
|
+
data.tar.gz: d135218c290abdd63c24c13f5e8944854e4bb186bb1db9982164ac7f52fe19a93e6c6f67e0d07f58d95baeeaf553a32fa021d9053f9513e0a0f40526ac43050c
|
data/doc/changelog.md
ADDED
@@ -1,12 +1,16 @@
|
|
1
1
|
class FeaturePack::Controller < ApplicationController
|
2
|
-
|
3
|
-
before_action :set_view_lookup_context_prefix
|
4
|
-
before_action :set_layout_paths
|
2
|
+
prepend_before_action :setup_feature
|
5
3
|
|
6
4
|
def index; end
|
7
5
|
|
8
6
|
private
|
9
7
|
|
8
|
+
def setup_feature
|
9
|
+
set_group_and_feature
|
10
|
+
set_view_lookup_context_prefix
|
11
|
+
set_layout_paths
|
12
|
+
end
|
13
|
+
|
10
14
|
def set_group_and_feature
|
11
15
|
group_name, feature_name = params['controller'].delete_prefix('feature_pack/').split('/').map(&:to_sym)
|
12
16
|
@group = FeaturePack.group group_name
|
@@ -14,19 +18,17 @@ class FeaturePack::Controller < ApplicationController
|
|
14
18
|
end
|
15
19
|
|
16
20
|
def set_view_lookup_context_prefix
|
17
|
-
|
18
|
-
|
19
|
-
|
21
|
+
return if lookup_context.prefixes.include?(@feature.views_relative_path)
|
22
|
+
|
23
|
+
lookup_context.prefixes.prepend(@feature.views_relative_path)
|
20
24
|
end
|
21
25
|
|
22
26
|
def set_layout_paths
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
-
|
27
|
-
|
28
|
-
- Fallback to Application's default header/footer
|
29
|
-
=end
|
27
|
+
# Header/Footer Lookup order
|
28
|
+
#
|
29
|
+
# - Feature dir/_partials, if not exists
|
30
|
+
# - Fallback to Group, if not exists
|
31
|
+
# - Fallback to Application's default header/footer
|
30
32
|
|
31
33
|
feature_partials_path = @feature.views_relative_path.join('partials')
|
32
34
|
group_partials_path = @feature.group.views_path.concat('/partials')
|
@@ -1,32 +1,33 @@
|
|
1
1
|
class FeaturePack::GroupController < ApplicationController
|
2
|
-
|
3
|
-
before_action :set_view_lookup_context_prefix
|
4
|
-
before_action :set_layout_paths
|
5
|
-
|
2
|
+
prepend_before_action :setup_group
|
6
3
|
def index; end
|
7
4
|
|
8
5
|
private
|
9
6
|
|
7
|
+
def setup_group
|
8
|
+
set_group
|
9
|
+
set_view_lookup_context_prefix
|
10
|
+
set_layout_paths
|
11
|
+
end
|
12
|
+
|
10
13
|
def set_group
|
11
14
|
group_name = params[:controller].split('/')[1].to_sym
|
12
15
|
@group = FeaturePack.group(group_name)
|
13
16
|
end
|
14
17
|
|
15
18
|
def set_view_lookup_context_prefix
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
+
return if lookup_context.prefixes.include?(@group.views_path)
|
20
|
+
|
21
|
+
lookup_context.prefixes.prepend(@group.views_path)
|
19
22
|
end
|
20
23
|
|
21
24
|
def set_layout_paths
|
22
25
|
patials_path = @group.views_path.concat('/partials')
|
23
26
|
|
24
|
-
if template_exists?('header', patials_path, true)
|
25
|
-
|
26
|
-
|
27
|
+
@header_layout_path = @group.view('partials/header') if template_exists?('header', patials_path, true)
|
28
|
+
|
29
|
+
return unless template_exists?('footer', patials_path, true)
|
27
30
|
|
28
|
-
|
29
|
-
@footer_layout_path = @group.view('partials/footer')
|
30
|
-
end
|
31
|
+
@footer_layout_path = @group.view('partials/footer')
|
31
32
|
end
|
32
33
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: feature_pack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gedean Dias
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-02-09 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: activesupport
|
@@ -29,16 +29,17 @@ dependencies:
|
|
29
29
|
- - "<"
|
30
30
|
- !ruby/object:Gem::Version
|
31
31
|
version: '9.0'
|
32
|
-
description:
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
description: |
|
33
|
+
Organizes and sets up the architecture of micro-applications within a Rails application,
|
34
|
+
enabling segregation, management, and isolation of functionalities, thereby supporting
|
35
|
+
independent development, testing, and maintenance.
|
36
36
|
email: gedean.dias@gmail.com
|
37
37
|
executables: []
|
38
38
|
extensions: []
|
39
39
|
extra_rdoc_files: []
|
40
40
|
files:
|
41
41
|
- README.md
|
42
|
+
- doc/changelog.md
|
42
43
|
- doc/feature_pack.md
|
43
44
|
- lib/feature_pack.rb
|
44
45
|
- lib/feature_pack/api/controller.rb
|
@@ -66,8 +67,11 @@ files:
|
|
66
67
|
homepage: https://github.com/gedean/feature_pack
|
67
68
|
licenses:
|
68
69
|
- MIT
|
69
|
-
metadata:
|
70
|
-
|
70
|
+
metadata:
|
71
|
+
bug_tracker_uri: https://github.com/gedean/feature_pack/issues
|
72
|
+
source_code_uri: https://github.com/gedean/feature_pack
|
73
|
+
changelog_uri: https://github.com/gedean/feature_pack/blob/main/CHANGELOG.MD
|
74
|
+
post_install_message: Please check the README file for use instructions.
|
71
75
|
rdoc_options: []
|
72
76
|
require_paths:
|
73
77
|
- lib
|
@@ -84,5 +88,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
88
|
requirements: []
|
85
89
|
rubygems_version: 3.6.3
|
86
90
|
specification_version: 4
|
87
|
-
summary: A different
|
91
|
+
summary: A different approach to organizing Rails app features.
|
88
92
|
test_files: []
|