feature_pack 0.1.4 → 0.1.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 281dd30e4d1dfff4a4be468c364b5528c910fd79afb3eec21fd8e9d8436f1fee
|
4
|
+
data.tar.gz: 25ec88a0b0c8626977687d642954fda17abdd617bdf422fb2c09774c6667341d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 214735c4ec76ee1a6c23f36acda37ab1ec009c10234695390ea6e75a4102bb33522450eb30eea1616a4592c408a21b9e5b2b62efe8a953151346db9ee2edf30c
|
7
|
+
data.tar.gz: 91e5690231a142beb0abbcd0bef2f745926ca5cb5e113b605703ce974b7ee371ea65535b3bb71ffff6d14250cb50ecfb21de0b8785e96e8332847da7cc06209d
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class FeaturePack::Controller < ApplicationController
|
2
|
-
before_action :
|
2
|
+
before_action :set_group_and_feature
|
3
3
|
before_action :set_view_lookup_context_prefix
|
4
4
|
before_action :set_layout_paths
|
5
5
|
|
@@ -7,8 +7,10 @@ class FeaturePack::Controller < ApplicationController
|
|
7
7
|
|
8
8
|
private
|
9
9
|
|
10
|
-
def
|
11
|
-
|
10
|
+
def set_group_and_feature
|
11
|
+
group_name, feature_name = params['controller'].delete_prefix('feature_pack/').split('/').map(&:to_sym)
|
12
|
+
@group = FeaturePack.group group_name
|
13
|
+
@feature = FeaturePack.feature group_name, feature_name
|
12
14
|
end
|
13
15
|
|
14
16
|
def set_view_lookup_context_prefix
|
data/lib/feature_pack.rb
CHANGED
@@ -62,6 +62,11 @@ module FeaturePack
|
|
62
62
|
manifest: YAML.load_file(File.join(group_path, GROUP_METADATA_DIRECTORY, MANIFEST_FILE_NAME)).deep_symbolize_keys
|
63
63
|
)
|
64
64
|
|
65
|
+
group.manifest.fetch(:const_aliases, []).each do |alias_data|
|
66
|
+
alias_method_name, alias_const_name = alias_data.first
|
67
|
+
group.define_singleton_method(alias_method_name) { "FeaturePack::#{group.name.name.camelize}::#{alias_const_name}".constantize }
|
68
|
+
end
|
69
|
+
|
65
70
|
def group.feature(feature_name) = features.find { |p| p.name.eql?(feature_name) }
|
66
71
|
def group.views_path = "#{base_dir}/#{GROUP_METADATA_DIRECTORY}/views"
|
67
72
|
def group.view(view_name) = "#{base_dir}/#{GROUP_METADATA_DIRECTORY}/views/#{view_name}"
|
@@ -24,11 +24,5 @@ class FeaturePack::AddGroupGenerator < Rails::Generators::NamedBase
|
|
24
24
|
template './_group_metadata/views/home.html.slim.tt', group_dir.join('_group_metadata', 'views/home.html.slim')
|
25
25
|
template './_group_metadata/views/partials/_header.html.slim.tt', group_dir.join('_group_metadata', 'views/partials/_header.html.slim')
|
26
26
|
template './_group_metadata/views/partials/_footer.html.slim.tt', group_dir.join('_group_metadata', 'views/partials/_footer.html.slim')
|
27
|
-
|
28
|
-
# create_file "app/models/#{group_name.underscore}/#{name.underscore}.rb", <<-FILE
|
29
|
-
# class #{group_name.camelize}::#{name.camelize} < ApplicationRecord
|
30
|
-
# # Lógicas específicas da feature, como validações e associações
|
31
|
-
# end
|
32
|
-
# FILE
|
33
27
|
end
|
34
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: feature_pack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gedean Dias
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|