packs-rails 0.0.4 → 0.0.5
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 +4 -4
- data/README.md +27 -2
- data/lib/packs/rails/railtie.rb +2 -4
- data/lib/packs/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c4b16ad1fd38eabdd5c57a587cf893991dc3d67a84bc0111f04e647d67878b63
|
|
4
|
+
data.tar.gz: bfaaaee8ef07fd9dbf5f7056133c18f294095a3db369cc56d10ffa0f8c0edd0d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 424e39b8c152ee19afb8b85ac5a393145bef1315a7a88acf3fd55bf18033503d4a817313543d397c3b2210013de9aa765a1831f63ee4ffa8a6e5c45e95653e03
|
|
7
|
+
data.tar.gz: f99f87275c735db75b54dac68001fb3dedef117906b7cd20e6b392df96d200348961e69591fb8979784e855f39526a3cabe372f5626f73d95e5bc8b7b823d4cf
|
data/README.md
CHANGED
|
@@ -11,7 +11,7 @@ app/ # Unpackaged code
|
|
|
11
11
|
packs/
|
|
12
12
|
my_domain/
|
|
13
13
|
package.yml # See the packwerk docs for more info
|
|
14
|
-
|
|
14
|
+
package_todo.yml # See the packwerk docs for more info
|
|
15
15
|
app/
|
|
16
16
|
public/ # Recommended location for public API
|
|
17
17
|
my_domain.rb # creates the primary namespaces
|
|
@@ -42,7 +42,7 @@ packs/
|
|
|
42
42
|
some_other_non_namespaced_private_model_spec.rb
|
|
43
43
|
my_domain/
|
|
44
44
|
my_private_namespaced_model_spec.rb
|
|
45
|
-
factories/ # packs-rails will automatically load pack factories into FactoryBot
|
|
45
|
+
factories/ # packs-rails will automatically load pack factories into FactoryBot, see Ecosystem and Integrations#factory_bot below
|
|
46
46
|
my_domain/
|
|
47
47
|
my_private_namespaced_model_factory.rb
|
|
48
48
|
my_other_domain/
|
|
@@ -125,6 +125,31 @@ rspec packs/foobar/spec
|
|
|
125
125
|
rspec packs/foobar/nested_pack
|
|
126
126
|
```
|
|
127
127
|
|
|
128
|
+
#### factory_bot and factory_bot_rails
|
|
129
|
+
|
|
130
|
+
Ensure you have the gem in your Gemfile, and that `require: false` is not present, otherwise the `packs-rails` FactoryBot integration will not be run upon application/environment load.
|
|
131
|
+
This integration will automatically add the `[spec|test]/factories` directory from each pack to the application's `config.factory_bot.definition_file_paths`.
|
|
132
|
+
|
|
133
|
+
Using the example application above:
|
|
134
|
+
```
|
|
135
|
+
...
|
|
136
|
+
packs/
|
|
137
|
+
my_domain/
|
|
138
|
+
...
|
|
139
|
+
spec/ # OR test/
|
|
140
|
+
...
|
|
141
|
+
factories/
|
|
142
|
+
my_domain/
|
|
143
|
+
my_private_namespaced_model_factory.rb
|
|
144
|
+
my_other_domain/
|
|
145
|
+
...
|
|
146
|
+
spec/ # OR test/
|
|
147
|
+
...
|
|
148
|
+
factories/
|
|
149
|
+
my_other_domain/
|
|
150
|
+
my_private_namespaced_model_factory.rb
|
|
151
|
+
```
|
|
152
|
+
|
|
128
153
|
#### parallel_tests
|
|
129
154
|
|
|
130
155
|
`parallel_tests` has it its own spec discovery mechanism, so packs-rails's RSpec integration doesn't do anything when you use them together.
|
data/lib/packs/rails/railtie.rb
CHANGED
|
@@ -5,15 +5,13 @@ module Packs
|
|
|
5
5
|
class Railtie < ::Rails::Railtie
|
|
6
6
|
config.before_configuration do |app|
|
|
7
7
|
Integrations::Rails.new(app)
|
|
8
|
-
|
|
8
|
+
Integrations::FactoryBot.new(app)
|
|
9
|
+
|
|
9
10
|
# This is not used within packs-rails. Rather, this allows OTHER tools to
|
|
10
11
|
# hook into packs-rails via ActiveSupport hooks.
|
|
11
12
|
ActiveSupport.run_load_hooks(:packs_rails, Packs)
|
|
12
13
|
end
|
|
13
14
|
|
|
14
|
-
config.after_initialize do |app|
|
|
15
|
-
Integrations::FactoryBot.new(app)
|
|
16
|
-
end
|
|
17
15
|
end
|
|
18
16
|
end
|
|
19
17
|
end
|
data/lib/packs/rails/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: packs-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ngan Pham
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-12-
|
|
11
|
+
date: 2023-12-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: railties
|