Skip to content

Commit 7575752

Browse files
author
Deploy from CI
committed
Deploy 9ff844c to gh-pages
0 parents  commit 7575752

File tree

157 files changed

+27532
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+27532
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
8+
---
9+
10+
<!-- By contributing to this project, you agree to abide by the thoughtbot Code
11+
of Conduct: https://thoughtbot.com/open-source-code-of-conduct -->
12+
13+
### Description
14+
15+
<!-- A clear and concise description of what the bug is. -->
16+
17+
### Reproduction Steps
18+
19+
<!-- Steps for others to reproduce the bug. Be as specific as possible. A
20+
reproduction script or link to a sample application that demonstrates the
21+
problem are especially helpful. -->
22+
23+
<!-- You can create a reproduction script by copying this sample reproduction
24+
script and adding whatever code is necessary to get a failing test case:
25+
https://github.com/thoughtbot/factory_bot/blob/main/.github/REPRODUCTION_SCRIPT.rb -->
26+
27+
### Expected behavior
28+
29+
<!-- What you expected to happen. -->
30+
31+
### Actual behavior
32+
33+
<!-- What happened instead. -->
34+
35+
### System configuration
36+
**factory_bot version**:
37+
**rails version**:
38+
**ruby version**:
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: 'feature'
6+
assignees: ''
7+
8+
---
9+
10+
<!-- By contributing to this project, you agree to abide by the thoughtbot Code
11+
of Conduct: https://thoughtbot.com/open-source-code-of-conduct -->
12+
13+
### Problem this feature will solve
14+
15+
<!-- A clear and concise description of what the problem is. Ex. When doing
16+
[...] I find it difficult to [...] -->
17+
18+
### Desired solution
19+
20+
<!-- The feature or change that would solve the problem -->
21+
22+
## Alternatives considered
23+
24+
<!-- Any alternative solutions or features you've considered. -->
25+
26+
## Additional context
27+
28+
<!-- Add any other context about this feature request. -->

.github/REPRODUCTION_SCRIPT.rb

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
require "bundler/inline"
2+
3+
gemfile(true) do
4+
source "https://rubygems.org"
5+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
6+
gem "factory_bot", "~> 6.0"
7+
gem "activerecord"
8+
gem "sqlite3"
9+
end
10+
11+
require "active_record"
12+
require "factory_bot"
13+
require "minitest/autorun"
14+
require "logger"
15+
16+
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
17+
ActiveRecord::Base.logger = Logger.new(STDOUT)
18+
19+
ActiveRecord::Schema.define do
20+
# TODO: Update the schema to include the specific tables or columns necessary
21+
# to reproduct the bug
22+
create_table :posts, force: true do |t|
23+
t.string :body
24+
end
25+
end
26+
27+
# TODO: Add any application specific code necessary to reproduce the bug
28+
class Post < ActiveRecord::Base
29+
end
30+
31+
FactoryBot.define do
32+
# TODO: Write the factory definitions necessary to reproduce the bug
33+
factory :post do
34+
body { "Post body" }
35+
end
36+
end
37+
38+
class FactoryBotTest < Minitest::Test
39+
def test_factory_bot_stuff
40+
# TODO: Write a failing test case to demonstrate what isn't working as
41+
# expected
42+
body_override = "Body override"
43+
44+
post = FactoryBot.build(:post, body: body_override)
45+
46+
assert_equal post.body, body_override
47+
end
48+
end
49+
50+
# Run the tests with `ruby <filename>`

.github/dependabot.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
version: 2
3+
4+
updates:
5+
- package-ecosystem: "bundler"
6+
directory: "/"
7+
schedule:
8+
interval: weekly
9+
time: "02:00"
10+
timezone: "Etc/UTC"
11+
- package-ecosystem: "github-actions"
12+
directory: "/"
13+
schedule:
14+
interval: weekly
15+
time: "02:00"
16+
timezone: "Etc/UTC"

.github/workflows/build.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build
2+
on:
3+
- push
4+
- pull_request
5+
6+
jobs:
7+
build:
8+
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }}
9+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
ruby:
14+
- jruby-9.4
15+
- truffleruby
16+
- "3.3"
17+
- "3.2"
18+
- "3.1"
19+
- "3.0"
20+
rails:
21+
- "6.1"
22+
- "7.0"
23+
- "7.1"
24+
- "7.2"
25+
- main
26+
exclude:
27+
- ruby: jruby-9.4
28+
rails: "7.1"
29+
- ruby: jruby-9.4
30+
rails: "7.2"
31+
- ruby: jruby-9.4
32+
rails: main
33+
# Rails >= 7.2 requires Ruby 3.1
34+
- ruby: "3.0"
35+
rails: "7.2"
36+
- ruby: "3.0"
37+
rails: "main"
38+
# Rails >= 8.0 requires Ruby 3.2
39+
- ruby: "3.1"
40+
rails: "main"
41+
42+
runs-on: 'ubuntu-latest'
43+
44+
env:
45+
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails }}.gemfile
46+
47+
steps:
48+
- uses: actions/checkout@v4
49+
- uses: ruby/setup-ruby@v1
50+
with:
51+
ruby-version: ${{ matrix.ruby }}
52+
- name: Setup project
53+
run: bundle install
54+
- name: Run test
55+
run: bundle exec rake all_specs
56+
57+
standard:
58+
name: Run standard
59+
runs-on: 'ubuntu-latest'
60+
steps:
61+
- uses: actions/checkout@v4
62+
- uses: ruby/setup-ruby@v1
63+
with:
64+
ruby-version: "3.3"
65+
- name: Setup project
66+
run: bundle install
67+
- name: Run test
68+
run: bundle exec rake standard

.github/workflows/docs.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Docs
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write # To push a branch
12+
pull-requests: write # To create a PR from that branch
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
- name: Install mdbook
18+
run: |
19+
mkdir mdbook
20+
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.27/mdbook-v0.4.27-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
21+
echo `pwd`/mdbook >> $GITHUB_PATH
22+
- name: Deploy GitHub Pages
23+
run: |
24+
cd docs
25+
mdbook build
26+
git worktree add gh-pages
27+
git config user.name "Deploy from CI"
28+
git config user.email ""
29+
cd gh-pages
30+
# Delete the ref to avoid keeping history.
31+
git update-ref -d refs/heads/gh-pages
32+
rm -rf *
33+
mv ../book/* .
34+
git add .
35+
git commit -m "Deploy $GITHUB_SHA to gh-pages"
36+
git push --force --set-upstream origin gh-pages

.github/workflows/dynamic-readme.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: update-templates
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- README.md
9+
workflow_dispatch:
10+
11+
jobs:
12+
update-templates:
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
pages: write
17+
uses: thoughtbot/templates/.github/workflows/dynamic-readme.yaml@main
18+
secrets:
19+
token: ${{ secrets.GITHUB_TOKEN }}
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: update-security
2+
3+
on:
4+
push:
5+
paths:
6+
- SECURITY.md
7+
branches:
8+
- main
9+
workflow_dispatch:
10+
11+
jobs:
12+
update-security:
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
pages: write
17+
uses: thoughtbot/templates/.github/workflows/dynamic-security.yaml@main
18+
secrets:
19+
token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*.swp
2+
test.db
3+
factory_girl-*.gem
4+
factory_bot-*.gem
5+
docs/book
6+
.yardoc
7+
coverage
8+
.bundle
9+
tmp
10+
bin
11+
.rubocop-https*
12+
13+
gemfiles/*.lock

.rspec

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--format progress
2+
--color
3+
--require spec_helper

.simplecov

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SimpleCov.start do
2+
add_filter "/spec/"
3+
add_filter "/tmp/"
4+
end

.standard.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ruby_version: "3.0"
2+
parallel: true
3+
format: progress

.standard_todo.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Auto generated files with errors to ignore.
2+
# Remove from this list as you refactor files.
3+
---
4+
ignore:
5+
- lib/factory_bot/linter.rb:
6+
- Lint/SharedMutableDefault

.yardopts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lib/**/*.rb
2+
-
3+
GETTING_STARTED.md
4+
CONTRIBUTING.md
5+
NAME.md
6+
LICENSE

0 commit comments

Comments
 (0)