factory_bot_instrumentation 1.0.1 → 1.1.0

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: 106c1aa5ca524b01dbff80a366493e8e921d2b65aba880d156da6481f6798d74
4
- data.tar.gz: 538be239cc2016d21996c85d96730c8501dfca703f5d7a1d259dc198aa0da880
3
+ metadata.gz: 4893e1b40e7d03da45c7be90714efdae1c41c10fdf03152c20725100a19ed717
4
+ data.tar.gz: cb2481504a13586d664a02f0314684074938c0eb28ad910cf358482f51277301
5
5
  SHA512:
6
- metadata.gz: 423b35d7c9c7e590a1b312206f5f05a93407fa1fe3f5dff3790ae0ba9d263f782e7a3e8cbd24ae48307e422dd4806e15284b378b71f35792384d0fbf1739e449
7
- data.tar.gz: 6f2211b069039602f7e74bfa6a5d737acf2a651953ce81e6c758fed27625719f4128abb419dd5a66accfa5614c89e7663e65e9944bca09674e58f05244158b28
6
+ metadata.gz: 3ba69df7c7cc56fbe23d9758b69324938d8ef5db9080c0e6f3aa949e87e8f30f301c1382a8a56d423f8fd88c9d4741db6027f7ab95cb0c0a601919df6e417b0c
7
+ data.tar.gz: d95ae1e9a2ba594536c30ead21c161ff088f33b552b16085c1cf821645dbec61f1f14841e69f7af837ebbae5674b8850a5bcab143986068759dbb200d4d47f98
@@ -0,0 +1,47 @@
1
+ name: Release
2
+ run-name: Release ${{ github.event.inputs.VERSION }}
3
+
4
+ on:
5
+ workflow_dispatch:
6
+ inputs:
7
+ VERSION:
8
+ description: The new version to release. (eg. `1.0.0`) Check the
9
+ changelog for the latest version.
10
+
11
+ concurrency:
12
+ group: '${{ github.event.inputs.VERSION }}'
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ docs:
17
+ name: Release the gem
18
+ runs-on: ubuntu-22.04
19
+ timeout-minutes: 5
20
+ steps:
21
+ - uses: actions/checkout@v3
22
+
23
+ - name: Install Ruby 2.5
24
+ uses: ruby/setup-ruby@v1
25
+ with:
26
+ ruby-version: 2.5
27
+ bundler-cache: true
28
+ rubygems: '3.3.26'
29
+
30
+ - name: Prepare the virtual environment
31
+ uses: hausgold/actions/ci@master
32
+ with:
33
+ clone_token: '${{ secrets.CLONE_TOKEN }}'
34
+ settings: '${{ github.repository }}'
35
+ target: ci/gem-test
36
+
37
+ - name: Switch to SSH remotes for the Git repository
38
+ run: git-ssh-remotes
39
+
40
+ - name: Enforce version '${{ github.event.inputs.VERSION }}'
41
+ run: set-gem-version '${{ github.event.inputs.VERSION }}'
42
+
43
+ - name: Prepare the Git release commit
44
+ run: git-release-commit '${{ github.event.inputs.VERSION }}'
45
+
46
+ - name: Push the release Git commit/tag and package to the registry
47
+ run: make release
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ### next
2
+
3
+ * TODO: Replace this bullet point with an actual description of a change.
4
+
5
+ ### 1.1.0
6
+
7
+ * Added support for Gem release automation
8
+
9
+ ### 1.0.2
10
+
11
+ * When used in combination with the `factory_bot_rails` gem (>= 6.0) we do not
12
+ force a `FactoryBot.reload` at Rails engine initialization as it breaks with
13
+ an `FactoryBot::DuplicateDefinitionError` (#14)
14
+
1
15
  ### 1.0.1
2
16
 
3
17
  * Added a retry logic to the FactoryBot reloading on the POST/create endpoint
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at development@hausgold.de. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/README.md CHANGED
@@ -38,7 +38,9 @@ cases.
38
38
  - [Custom scripts](#custom-scripts)
39
39
  - [Custom styles](#custom-styles)
40
40
  - [Development](#development)
41
+ - [Code of Conduct](#code-of-conduct)
41
42
  - [Contributing](#contributing)
43
+ - [Releasing](#releasing)
42
44
 
43
45
  ## Installation
44
46
 
@@ -730,17 +732,28 @@ application. The file could look like this:
730
732
 
731
733
  ## Development
732
734
 
733
- After checking out the repo, run `bin/setup` to install dependencies. Then, run
734
- `bundle exec rake spec` to run the tests. You can also run `bin/console` for an
735
+ After checking out the repo, run `make install` to install dependencies. Then,
736
+ run `make test` to run the tests. You can also run `make shell-irb` for an
735
737
  interactive prompt that will allow you to experiment.
736
738
 
737
- To install this gem onto your local machine, run `bundle exec rake install`. To
738
- release a new version, update the version number in `version.rb`, and then run
739
- `bundle exec rake release`, which will create a git tag for the version, push
740
- git commits and tags, and push the `.gem` file to
741
- [rubygems.org](https://rubygems.org).
739
+ ## Code of Conduct
740
+
741
+ Everyone interacting in the project codebase, issue tracker, chat
742
+ rooms and mailing lists is expected to follow the [code of
743
+ conduct](./CODE_OF_CONDUCT.md).
742
744
 
743
745
  ## Contributing
744
746
 
745
747
  Bug reports and pull requests are welcome on GitHub at
746
- https://github.com/hausgold/factory_bot_instrumentation.
748
+ https://github.com/hausgold/factory_bot_instrumentation. Make sure that every pull request adds
749
+ a bullet point to the [changelog](./CHANGELOG.md) file with a reference to the
750
+ actual pull request.
751
+
752
+ ## Releasing
753
+
754
+ The release process of this Gem is fully automated. You just need to open the
755
+ Github Actions [Release
756
+ Workflow](https://github.com/hausgold/factory_bot_instrumentation/actions/workflows/release.yml)
757
+ and trigger a new run via the **Run workflow** button. Insert the new version
758
+ number (check the [changelog](./CHANGELOG.md) first for the latest release) and
759
+ you're done.
@@ -40,6 +40,7 @@ Gem::Specification.new do |spec|
40
40
  spec.add_development_dependency 'appraisal', '~> 2.4'
41
41
  spec.add_development_dependency 'bundler', '~> 2.3'
42
42
  spec.add_development_dependency 'countless', '~> 1.1'
43
+ spec.add_development_dependency 'factory_bot_rails', '~> 6.2'
43
44
  spec.add_development_dependency 'guard-rspec', '~> 4.7'
44
45
  spec.add_development_dependency 'railties', '>= 5.2'
45
46
  spec.add_development_dependency 'rspec-rails', '~> 5.1'
@@ -7,11 +7,16 @@ module FactoryBot
7
7
  isolate_namespace FactoryBot::Instrumentation
8
8
 
9
9
  # Fill in some dynamic settings (application related)
10
- initializer 'factory_bot_instrumentation.config' do
11
- # Ensure the FactoryBot gem loads its factories to ensure they are
12
- # also available in the rails console and other places in the app
13
- # and not only via instrumentation frontend.
14
- FactoryBot.reload
10
+ initializer 'factory_bot_instrumentation.config' do |app|
11
+ # Ensure the FactoryBot gem loads its factories to ensure they are also
12
+ # available in the rails console and other places in the app and not
13
+ # only via instrumentation frontend. We skip this step as in
14
+ # combination with the +factory_bot_rails+ gem (>=6.0) the FactoryBot
15
+ # initializing occurs after the Rails application initializing, which
16
+ # leads to +FactoryBot::DuplicateDefinitionError+s.
17
+ initializer_names = app.initializers.map(&:name).map(&:to_s)
18
+ FactoryBot.reload \
19
+ if initializer_names.grep(/^factory_bot\./).count.zero?
15
20
 
16
21
  FactoryBot::Instrumentation.configure do |conf|
17
22
  # Set the application name dynamically
@@ -4,7 +4,7 @@ module FactoryBot
4
4
  # The gem version details.
5
5
  module Instrumentation
6
6
  # The version of the +factory_bot_instrumentation+ gem
7
- VERSION = '1.0.1'
7
+ VERSION = '1.1.0'
8
8
 
9
9
  class << self
10
10
  # Returns the version of gem as a string.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factory_bot_instrumentation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hermann Mayer
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-15 00:00:00.000000000 Z
11
+ date: 2023-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: factory_bot
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.1'
97
+ - !ruby/object:Gem::Dependency
98
+ name: factory_bot_rails
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '6.2'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '6.2'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: guard-rspec
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -257,6 +271,7 @@ extra_rdoc_files: []
257
271
  files:
258
272
  - ".editorconfig"
259
273
  - ".github/workflows/documentation.yml"
274
+ - ".github/workflows/release.yml"
260
275
  - ".github/workflows/test.yml"
261
276
  - ".gitignore"
262
277
  - ".rspec"
@@ -265,6 +280,7 @@ files:
265
280
  - ".yardopts"
266
281
  - Appraisals
267
282
  - CHANGELOG.md
283
+ - CODE_OF_CONDUCT.md
268
284
  - Dockerfile
269
285
  - Envfile
270
286
  - Gemfile
@@ -310,7 +326,7 @@ files:
310
326
  - lib/factory_bot/instrumentation/engine.rb
311
327
  - lib/factory_bot/instrumentation/version.rb
312
328
  - lib/factory_bot_instrumentation.rb
313
- homepage:
329
+ homepage:
314
330
  licenses:
315
331
  - MIT
316
332
  metadata:
@@ -319,7 +335,7 @@ metadata:
319
335
  changelog_uri: https://github.com/hausgold/factory_bot_instrumentation/blob/master/CHANGELOG.md
320
336
  bug_tracker_uri: https://github.com/hausgold/factory_bot_instrumentation/issues
321
337
  documentation_uri: https://www.rubydoc.info/gems/factory_bot_instrumentation
322
- post_install_message:
338
+ post_install_message:
323
339
  rdoc_options: []
324
340
  require_paths:
325
341
  - lib
@@ -334,8 +350,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
334
350
  - !ruby/object:Gem::Version
335
351
  version: '0'
336
352
  requirements: []
337
- rubygems_version: 3.3.8
338
- signing_key:
353
+ rubygems_version: 3.3.26
354
+ signing_key:
339
355
  specification_version: 4
340
356
  summary: Allow your testers to generate test data on demand
341
357
  test_files: []