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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c9a4e816b8efb6891cf9b373c7c099b28a3d2f17d4f240d1177182698e1e791
4
- data.tar.gz: 9e1428992751e466c6cefb19230c1b0e5f0bad323b5740951e18e5e3e68604ca
3
+ metadata.gz: c4b16ad1fd38eabdd5c57a587cf893991dc3d67a84bc0111f04e647d67878b63
4
+ data.tar.gz: bfaaaee8ef07fd9dbf5f7056133c18f294095a3db369cc56d10ffa0f8c0edd0d
5
5
  SHA512:
6
- metadata.gz: c7400fe1e63caf68bc2ade9b562f9ebc5562bc661bd6a31093356a17a46161610e4807df6aa0d8bb10318e13420fd75fff628dfe70b5312e0241e343bdd96d15
7
- data.tar.gz: a329905ac9d4aa3de0d6b650d3acca0c7c917ef615de2c439ba61f440b4d33e998f5c5c0c6257ac165df060e5df16c8c46f6d1658211cc18b3dd9f227c272d16
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
- deprecated_references.yml # See the packwerk docs for more info
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.
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Packs
2
2
  module Rails
3
- VERSION = "0.0.4".freeze
3
+ VERSION = "0.0.5".freeze
4
4
  end
5
5
  end
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
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-04 00:00:00.000000000 Z
11
+ date: 2023-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties