feature_pack 0.1.2 → 0.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
  SHA256:
3
- metadata.gz: 3e2946dd4dbd9336908bb8044877f745a97d44ee11fa125eb3a8a77f0102c3c2
4
- data.tar.gz: 5e29ad8bcf002715386a2c93fa9a2ef4e9cb5922a49f198dbcdcd9e43caac354
3
+ metadata.gz: 48bfeabf660821f1ba14e60c86985bd9082a2075816e7c7d7a046b87d8d979a9
4
+ data.tar.gz: 3e634e8304a6b9a24faf0b209c953c2f7dbeaff39dd573c9ea9c24938c1301bf
5
5
  SHA512:
6
- metadata.gz: ad1e716ab8b251c4c6677074e338ad84ecaf127e3f6c2acd6a1b52a9ddcb27c7ad6346812645499e269ca6bd929bf14888585026ef0adebfd7a2275be73ff883
7
- data.tar.gz: 8ed15f2382e2c3cc301e55e649e916cb1925ba4c4987e871e9a26156eb0ecb347315cee8b2a25d1a55d162fa367c21ea1dfe73132a211d482f61707630b1236a
6
+ metadata.gz: fbe55e58df6e1455f1a408c065ae6a1b307750cac4660e00452610b53714acf54853e1bf3f57723e5113b1b0cf27ec9c4e04755ca06284987c776295d2696c5b
7
+ data.tar.gz: 7587b5738e9c717a5b3105a19bee9e8d187e1a2e8e036d4c19b08336d6b7f124189df013bd2a4b25036a3132f6681f86cf8b1f54bda6d2ca260036f0f27fbbad
data/lib/feature_pack.rb CHANGED
@@ -39,7 +39,7 @@ module FeaturePack
39
39
 
40
40
  @@ignored_paths << @@path.join('feature_pack/feature_pack_routes.rb')
41
41
 
42
- raise "No Groups found in: '#{@@features_path}'" if Dir.glob("#{@@features_path}/[!_]*/").empty?
42
+ # raise "No Groups found in: '#{@@features_path}'" if Dir.glob("#{@@features_path}/[!_]*/").empty?
43
43
 
44
44
  @@groups = Dir.glob("#{@@features_path}/[!_]*/").map do |group_path|
45
45
  relative_path = Pathname.new(group_path)
@@ -1,3 +1,6 @@
1
+ require 'rails/generators/base'
2
+ require 'rails/generators/named_base'
3
+
1
4
  class FeaturePack::AddFeatureGenerator < Rails::Generators::NamedBase
2
5
  desc 'Adds a new Feature'
3
6
  source_root File.expand_path('templates', __dir__)
@@ -5,6 +8,8 @@ class FeaturePack::AddFeatureGenerator < Rails::Generators::NamedBase
5
8
  argument :name, type: :string, required: true, desc: 'The name (sneak case) of the group to add'
6
9
 
7
10
  def add_feature
11
+ raise "Feature name couldn't have more than one bar '/'" if name.count('/') > 1
12
+
8
13
  @group_name, @feature_name = name.split('/')
9
14
  @group = FeaturePack.group(@group_name.to_sym)
10
15
  @group_class_name = @group_name.camelcase
@@ -1,11 +1,15 @@
1
+ require 'rails/generators/base'
2
+ require 'rails/generators/named_base'
3
+
1
4
  class FeaturePack::AddGroupGenerator < Rails::Generators::NamedBase
2
- # class Generators::FeaturePack::AddGroup::AddGroupGenerator < Rails::Generators::NamedBase
5
+
3
6
  desc 'Adds a new Feature Group'
4
7
  source_root File.expand_path('templates', __dir__)
5
8
 
6
9
  argument :name, type: :string, required: true, desc: 'The name (sneak case) of the group to add'
7
10
 
8
11
  def create_feature_group
12
+ raise "Group name couldn't have '/'" if name.include?('/')
9
13
  raise "Group '#{name}' already exists" if FeaturePack.group(name.to_sym).present?
10
14
 
11
15
  @class_name = name.camelcase
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.2
4
+ version: 0.1.4
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-28 00:00:00.000000000 Z
11
+ date: 2024-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport