handcuffs 1.4.0 → 2.0.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
- SHA1:
3
- metadata.gz: 91d9834315136aee1b7a94239c9f66ac9d0eb631
4
- data.tar.gz: 1ca45f40052fba9fc009cfb1a0b28c9bf94d7405
2
+ SHA256:
3
+ metadata.gz: dd48a0c4c4c2948afced7735d5f699648c000e5bbbcc3e4e795dff0f44f15c04
4
+ data.tar.gz: a6471b2358a4f1dae25251de3ae20665878e816e31a4f49687a6603673f69d82
5
5
  SHA512:
6
- metadata.gz: 5e810600a0773709048bbad33a4d41254986fb380739efe3ddb7c81e60d2345052cdaf74a59bccead2a805c4bef1d3d9ed20de53ece2e738776e56d6c991f640
7
- data.tar.gz: 833ad454a0d95dd2e8899d566e271645624cc065e492313ce279091fb377da5563564ae438f7e92c8e1f8ad5cca96b2d75b4428d38b8c28abdde2a375601cc88
6
+ metadata.gz: 873b8306a43cc09b1c524f1b4debdf4fd96bb47ab0ac8fd80a2b14287610b15ef596c13bc4ad65741507ec4a6be686f54763de0da84eefe7b28bcc14741a0be5
7
+ data.tar.gz: d1395678197fd1f74847970e3145002f67c535ac6beb8912b7c7a7990da80cebfee67bf29992f48f0383b834d2d991a5a7726e9c513280ffd81a5fc31a9a157f
@@ -0,0 +1 @@
1
+ * @procore-oss/procore-ospo @procore-oss/procore-handcuffs
@@ -0,0 +1,66 @@
1
+ name: 🐞 Bug
2
+ description: File a bug/issue
3
+ title: "[bug] <title>"
4
+ labels: [bug, needs-triage]
5
+ body:
6
+ - type: checkboxes
7
+ attributes:
8
+ label: Is there an existing issue for this?
9
+ description: Please search to see if an issue already exists for the bug you encountered.
10
+ options:
11
+ - label: I have searched the existing issues
12
+ required: true
13
+ - type: checkboxes
14
+ attributes:
15
+ label: Is this a regression?
16
+ description: Did this behavior work before?
17
+ options:
18
+ - label: Yes, this used to work before
19
+ required: false
20
+ - type: textarea
21
+ attributes:
22
+ label: Current Behavior
23
+ description: A concise description of what you're experiencing.
24
+ validations:
25
+ required: false
26
+ - type: textarea
27
+ attributes:
28
+ label: Expected Behavior
29
+ description: A concise description of what you expected to happen.
30
+ validations:
31
+ required: false
32
+ - type: textarea
33
+ attributes:
34
+ label: Steps To Reproduce
35
+ description: Steps to reproduce the behavior.
36
+ placeholder: |
37
+ 1.
38
+ 2.
39
+ 3.
40
+ 4.
41
+ validations:
42
+ required: true
43
+ - type: textarea
44
+ attributes:
45
+ label: Environment
46
+ description: |
47
+ examples:
48
+ - **OS**: OSX 13.3.1
49
+ - **Browser Name and Version**: Chrome Version 112.0.5615.49 (Official Build) (arm64)
50
+ - **Ruby Version**: 3.0.0
51
+ value: |
52
+ - OS:
53
+ - Browser Name and version:
54
+ - Ruby Version:
55
+ render: markdown
56
+ validations:
57
+ required: true
58
+ - type: textarea
59
+ attributes:
60
+ label: Anything else?
61
+ description: |
62
+ Links? References? Anything that will give us more context about the issue you are encountering!
63
+
64
+ Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
65
+ validations:
66
+ required: false
@@ -0,0 +1 @@
1
+ blank_issues_enabled: false
@@ -0,0 +1,18 @@
1
+ name: 📚 Documentation or README.md issue report
2
+ description: File a bug/issue for docs or README.md
3
+ title: "[bug] <title>"
4
+ labels: [docs, needs-triage]
5
+ body:
6
+ - type: checkboxes
7
+ attributes:
8
+ label: Is there an existing issue for this?
9
+ description: Please search to see if an issue already exists for the bug you encountered.
10
+ options:
11
+ - label: I have searched the existing issues
12
+ required: true
13
+ - type: textarea
14
+ attributes:
15
+ label: Docs/README.md Part to update
16
+ description: A concise description of what you thing should be updated
17
+ validations:
18
+ required: true
@@ -0,0 +1,36 @@
1
+ name: 🚀🆕 Feature Request
2
+ description: Suggest an idea or possible new feature for this project
3
+ title: "[Feature Request] <title>"
4
+ labels: [feature, needs-triage]
5
+ body:
6
+ - type: checkboxes
7
+ attributes:
8
+ label: Is there an existing issue for this?
9
+ description: Please search to see if an issue already exists for the bug you encountered.
10
+ options:
11
+ - label: I have searched the existing issues
12
+ required: true
13
+ - type: textarea
14
+ attributes:
15
+ label: Is your feature request related to a problem? Please describe
16
+ description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
17
+ validations:
18
+ required: true
19
+ - type: textarea
20
+ attributes:
21
+ label: Describe the solution you'd lik
22
+ description: A clear and concise description of what you want to happen
23
+ validations:
24
+ required: true
25
+ - type: textarea
26
+ attributes:
27
+ label: Describe alternatives you've considered
28
+ description: A clear and concise description of any alternative solutions or features you've considered
29
+ validations:
30
+ required: false
31
+ - type: textarea
32
+ attributes:
33
+ label: Additional context
34
+ description: Add any other context or additional information about the problem here
35
+ validations:
36
+ required: false
@@ -0,0 +1,18 @@
1
+ name: ❓ Question or Support Request
2
+ description: Questions and requests for support
3
+ title: "[Question/Support] <title>"
4
+ labels: [question, support, needs-triage]
5
+ body:
6
+ - type: checkboxes
7
+ attributes:
8
+ label: Is there an existing issue for this?
9
+ description: Please search to see if an issue already exists for the bug you encountered.
10
+ options:
11
+ - label: I have searched the existing issues
12
+ required: true
13
+ - type: textarea
14
+ attributes:
15
+ label: Describe your question or ask for support
16
+ description: A concise description of what you would like support with
17
+ validations:
18
+ required: true
@@ -0,0 +1,15 @@
1
+ Checklist:
2
+
3
+ * [ ] I have updated the necessary documentation
4
+ * [ ] I have signed off all my commits as required by [DCO](https://github.com/procore-oss/handcuffs/blob/main/CONTRIBUTING.md)
5
+ * [ ] My build is green
6
+
7
+ <!--
8
+ Note on DCO:
9
+
10
+ If the DCO check fails, one or more of your commits are not signed off. Please click on the *Details* link next to the DCO action for instructions on how to resolve this.
11
+
12
+ Note on Versioning:
13
+
14
+ Maintainers will bump the version and do a release when they are ready to release (possibly multiple merged PRs). Please do not bump the version in your PRs.
15
+ -->
@@ -0,0 +1,20 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: /
5
+ schedule:
6
+ interval: "weekly"
7
+ timezone: "America/Los_Angeles"
8
+ labels:
9
+ - "dependabot"
10
+ - "dependencies"
11
+ - "github-actions"
12
+ - package-ecosystem: "bundler"
13
+ directory: /
14
+ schedule:
15
+ interval: "weekly"
16
+ timezone: "America/Los_Angeles"
17
+ labels:
18
+ - "dependabot"
19
+ - "dependencies"
20
+ - "bundler"
@@ -0,0 +1,13 @@
1
+ name: 'Auto Author Assign'
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: [opened, reopened]
6
+
7
+ jobs:
8
+ assign-author:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: toshimaru/auto-author-assign@v2.1.0
12
+ with:
13
+ repo-token: "${{ secrets.GITHUB_TOKEN }}"
@@ -0,0 +1,43 @@
1
+ name: "Custom CodeQL"
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches: [ "main" ]
7
+ pull_request:
8
+ branches: [ "main" ]
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ analyze:
15
+ name: Analyze
16
+ runs-on: Ubuntu-latest
17
+ timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
18
+ permissions:
19
+ actions: read
20
+ contents: read
21
+ security-events: write
22
+
23
+ strategy:
24
+ fail-fast: false
25
+ matrix:
26
+ language: [ 'ruby' ]
27
+
28
+ steps:
29
+ - name: Checkout repository
30
+ uses: actions/checkout@v4
31
+
32
+ - name: Initialize CodeQL
33
+ uses: github/codeql-action/init@v3
34
+ with:
35
+ languages: ${{ matrix.language }}
36
+
37
+ - name: Autobuild
38
+ uses: github/codeql-action/autobuild@v3
39
+
40
+ - name: Perform CodeQL Analysis
41
+ uses: github/codeql-action/analyze@v3
42
+ with:
43
+ category: "/language:${{matrix.language}}"
@@ -0,0 +1,40 @@
1
+ name: Release
2
+ on:
3
+ workflow_run:
4
+ workflows: [Test]
5
+ types: [completed]
6
+ branches: [main]
7
+ workflow_dispatch: # allow manual deployment through GitHub Action UI
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-latest
11
+ if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - name: Version file changed
15
+ id: version-file-changed
16
+ uses: tj-actions/changed-files@v42
17
+ with:
18
+ files: lib/handcuffs/version.rb
19
+ - name: Set up Ruby
20
+ if: ${{ github.event_name == 'workflow_dispatch' || steps.version-file-changed.outputs.any_changed == 'true' }}
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: 3.2
24
+ bundler-cache: true
25
+ - name: Installing dependencies
26
+ if: ${{ github.event_name == 'workflow_dispatch' || steps.version-file-changed.outputs.any_changed == 'true' }}
27
+ run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle
28
+ - name: Build gem file
29
+ if: ${{ github.event_name == 'workflow_dispatch' || steps.version-file-changed.outputs.any_changed == 'true' }}
30
+ run: bundle exec rake build
31
+ - uses: fac/ruby-gem-setup-credentials-action@v2
32
+ if: ${{ github.event_name == 'workflow_dispatch' || steps.version-file-changed.outputs.any_changed == 'true' }}
33
+ with:
34
+ user: ""
35
+ key: rubygems
36
+ token: ${{secrets.RUBY_GEMS_API_KEY}}
37
+ - uses: fac/ruby-gem-push-action@v2
38
+ if: ${{ github.event_name == 'workflow_dispatch' || steps.version-file-changed.outputs.any_changed == 'true' }}
39
+ with:
40
+ key: rubygems
@@ -0,0 +1,38 @@
1
+ ## Reference: https://github.com/actions/stale
2
+ name: Mark stale issues and pull requests
3
+ on:
4
+ schedule:
5
+ - cron: "30 1 * * *"
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ stale:
12
+ permissions:
13
+ issues: write # for actions/stale to close stale issues
14
+ pull-requests: write # for actions/stale to close stale PRs
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/stale@v9
18
+ with:
19
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
20
+ # Number of days of inactivity before an issue becomes stale
21
+ days-before-stale: 60
22
+ # Number of days of inactivity before a stale issue is closed
23
+ days-before-close: 7
24
+ # Issues with these labels will never be considered stale
25
+ exempt-issue-labels: "on-hold,pinned,security"
26
+ exempt-pr-labels: "on-hold,pinned,security"
27
+ # Comment to post when marking an issue as stale.
28
+ stale-issue-message: >
29
+ This issue has been automatically marked as stale because it has not had
30
+ recent activity. It will be closed if no further activity occurs. Thank you
31
+ for your contributions.
32
+ stale-pr-message: >
33
+ This pull request has been automatically marked as stale because it has not had
34
+ recent activity. It will be closed if no further activity occurs. Thank you
35
+ for your contributions.
36
+ # Label to use when marking an issue as stale
37
+ stale-issue-label: 'no-issue-activity'
38
+ stale-pr-label: 'no-pr-activity'
@@ -0,0 +1,54 @@
1
+ name: Test
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+ branches: [main]
7
+ permissions:
8
+ contents: read
9
+ jobs:
10
+ test:
11
+ strategy:
12
+ matrix:
13
+ ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
14
+ postgres: ['16-bullseye', '15-bullseye', '14-bullseye', '13-bullseye', '12-bullseye']
15
+ name: Ruby ${{ matrix.ruby }} - PostgreSQL ${{ matrix.postgres }}
16
+ # https://docs.github.com/en/actions/learn-github-actions/expressions#example
17
+ runs-on: ${{ matrix.ruby == '2.7' && 'ubuntu-20.04' || 'ubuntu-latest' }}
18
+ services:
19
+ postgres:
20
+ image: postgres:${{ matrix.postgres }}
21
+ env:
22
+ POSTGRES_USER: ubuntu
23
+ POSTGRES_DB: handcuffs_test
24
+ POSTGRES_HOST_AUTH_METHOD: trust
25
+ options: >-
26
+ --health-cmd pg_isready
27
+ --health-interval 10s
28
+ --health-timeout 5s
29
+ --health-retries 5
30
+ ports:
31
+ - 5432:5432
32
+ env:
33
+ PGHOST: localhost
34
+ PGUSER: ubuntu
35
+ RAILS_ENV: test
36
+ BUNDLER_VERSION: 2.4.22
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+ - name: Set up Ruby ${{ matrix.ruby }}
40
+ uses: ruby/setup-ruby@v1
41
+ with:
42
+ ruby-version: ${{ matrix.ruby }}
43
+ bundler: ${{ env.BUNDLER_VERSION }}
44
+ bundler-cache: true
45
+ - name: Installing dependencies
46
+ run: bundle install && cd spec/dummy && bundle install
47
+ - name: Install Apprasals Dependencies
48
+ run: bundle exec appraisal install && cd spec/dummy && bundle exec appraisal install
49
+ - name: Setup Database
50
+ run: cd spec/dummy && bundle exec rake db:create db:migrate --trace
51
+ - name: Run Appraisals Tests
52
+ run: bundle exec appraisal rspec
53
+ - name: Run Dummy App Tests
54
+ run: cd spec/dummy && bundle exec appraisal bin/rspec
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
3
  /Gemfile.lock
4
+ /gemfiles/*.gemfile.lock
4
5
  /_yardoc/
5
6
  /coverage/
6
7
  /doc/
@@ -8,5 +9,5 @@
8
9
  /spec/reports/
9
10
  /tmp/
10
11
  handcuffs-*.gem
11
- /gemfiles/*.gemfile.lock
12
12
  .ruby-version
13
+ .DS_Store
data/Appraisals CHANGED
@@ -1,28 +1,11 @@
1
- # Ruby 2.7 doesn't support BigDecimal.new, which Rails 4 uses
2
- if RUBY_VERSION < "2.7"
3
- appraise "rails-4" do
4
- gem "rails", "~> 4.2.8"
5
- gem 'pg', '~> 0.15'
6
- end
1
+ appraise "rails-6.1" do
2
+ gem "rails", "~> 6.1.0"
7
3
  end
8
4
 
9
- appraise "rails-5" do
10
- gem "rails", "~> 5.0.0.1"
11
- gem 'pg', '~> 0.18'
5
+ appraise "rails-7.0" do
6
+ gem "rails", "~> 7.0.0"
12
7
  end
13
8
 
14
- appraise "rails-5.1" do
15
- gem "rails", "~> 5.1.7"
16
- gem 'pg', '~> 0.18'
17
- end
18
-
19
- appraise "rails-5.2" do
20
- gem "rails", "~> 5.2.3"
21
- end
22
-
23
- # Rails >= 6 requires Ruby >= 2.5
24
- if RUBY_VERSION >= "2.5"
25
- appraise "rails-6" do
26
- gem "rails", "~> 6.0.1"
27
- end
9
+ appraise "rails-7.1" do
10
+ gem "rails", "~> 7.1.0"
28
11
  end
data/CHANGELOG.md ADDED
@@ -0,0 +1,30 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## 2.0.0
11
+
12
+ ### Added
13
+
14
+ - CHANGELOG.md
15
+ - Code coverage for specs
16
+
17
+ ### Changed
18
+
19
+ - Switched to new `cimg` docker imaged for CircleCI testing.
20
+ - Switched to matrix testing for
21
+ - PostgreSQL 12, 13, 14, 15, 16;
22
+ - Ruby 2.7, 3.0, 3.1, 3.2, 3.3;
23
+ - Rails 6.1, 7.0, 7.1 (via Appraisal).
24
+ - Updated Bundler to 2.4.22.
25
+ - Added Appraisal for dummy app testing.
26
+ - Moved repo to procore-oss
27
+
28
+ ### Removed
29
+
30
+ - BREAKING CHANGE: Removed support for Ruby < 2.7, Rails < 6.1, PostgreSQL < 12.
data/CODE_OF_CONDUCT.md CHANGED
@@ -1,49 +1,130 @@
1
- # Contributor Code of Conduct
1
+ # Code of Conduct
2
2
 
3
- As contributors and maintainers of this project, and in the interest of
4
- fostering an open and welcoming community, we pledge to respect all people who
5
- contribute through reporting issues, posting feature requests, updating
6
- documentation, submitting pull requests or patches, and other activities.
3
+ ## Our Pledge
7
4
 
8
- We are committed to making participation in this project a harassment-free
9
- experience for everyone, regardless of level of experience, gender, gender
10
- identity and expression, sexual orientation, disability, personal appearance,
11
- body size, race, ethnicity, age, religion, or nationality.
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
12
11
 
13
- Examples of unacceptable behavior by participants include:
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
14
 
15
- * The use of sexualized language or imagery
16
- * Personal attacks
17
- * Trolling or insulting/derogatory comments
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
18
33
  * Public or private harassment
19
- * Publishing other's private information, such as physical or electronic
20
- addresses, without explicit permission
21
- * Other unethical or unprofessional conduct
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Spam or other deceptive practices that take advantage of the community
37
+ * Other conduct which could reasonably be considered inappropriate in a
38
+ professional setting
39
+
40
+ ## Enforcement Responsibilities
41
+
42
+ Community leaders are responsible for clarifying and enforcing our standards of
43
+ acceptable behavior and will take appropriate and fair corrective action in
44
+ response to any behavior that they deem inappropriate, threatening, offensive,
45
+ or harmful.
46
+
47
+ Community leaders have the right and responsibility to remove, edit, or reject
48
+ comments, commits, code, wiki edits, issues, and other contributions that are
49
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
50
+ decisions when appropriate.
22
51
 
23
- Project maintainers have the right and responsibility to remove, edit, or
24
- reject comments, commits, code, wiki edits, issues, and other contributions
25
- that are not aligned to this Code of Conduct, or to ban temporarily or
26
- permanently any contributor for other behaviors that they deem inappropriate,
27
- threatening, offensive, or harmful.
52
+ ## Scope
28
53
 
29
- By adopting this Code of Conduct, project maintainers commit themselves to
30
- fairly and consistently applying these principles to every aspect of managing
31
- this project. Project maintainers who do not follow or enforce the Code of
32
- Conduct may be permanently removed from the project team.
54
+ This Code of Conduct applies within all community spaces, and also applies when
55
+ an individual is officially representing the community in public spaces.
56
+ Examples of representing our community include using an official e-mail address,
57
+ posting via an official social media account, or acting as an appointed
58
+ representative at an online or offline event.
33
59
 
34
- This code of conduct applies both within project spaces and in public spaces
35
- when an individual is representing the project or its community.
60
+ ## Enforcement
36
61
 
37
62
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
- reported by contacting a project maintainer at opensource@procore.com All
39
- complaints will be reviewed and investigated and will result in a response that
40
- is deemed necessary and appropriate to the circumstances. Maintainers are
41
- obligated to maintain confidentiality with regard to the reporter of an
42
- incident.
63
+ reported to the community leaders responsible for enforcement at
64
+ <opensource@procore.com>.
65
+ All complaints will be reviewed and investigated promptly and fairly by
66
+ the Procore Open Source Program Office (OSPO)
67
+
68
+ All community leaders are obligated to respect the privacy and security of the
69
+ reporter of any incident.
70
+
71
+ ## Enforcement Guidelines
72
+
73
+ Community leaders will follow these Community Impact Guidelines in determining
74
+ the consequences for any action they deem in violation of this Code of Conduct:
75
+
76
+ ### 1. Correction
77
+
78
+ **Community Impact**: Use of inappropriate language or other behavior deemed
79
+ unprofessional or unwelcome in the community.
80
+
81
+ **Consequence**: A private, written warning from community leaders, providing
82
+ clarity around the nature of the violation and an explanation of why the
83
+ behavior was inappropriate. A public apology may be requested.
84
+
85
+ ### 2. Warning
86
+
87
+ **Community Impact**: A violation through a single incident or series
88
+ of actions.
89
+
90
+ **Consequence**: A warning with consequences for continued behavior. No
91
+ interaction with the people involved, including unsolicited interaction with
92
+ those enforcing the Code of Conduct, for a specified period of time. This
93
+ includes avoiding interactions in community spaces as well as external channels
94
+ like social media. Violating these terms may lead to a temporary or
95
+ permanent ban.
96
+
97
+ ### 3. Temporary Ban
98
+
99
+ **Community Impact**: A serious violation of community standards, including
100
+ sustained inappropriate behavior.
101
+
102
+ **Consequence**: A temporary ban from any sort of interaction or public
103
+ communication with the community for a specified period of time. No public or
104
+ private interaction with the people involved, including unsolicited interaction
105
+ with those enforcing the Code of Conduct, is allowed during this period.
106
+ Violating these terms may lead to a permanent ban.
107
+
108
+ ### 4. Permanent Ban
109
+
110
+ **Community Impact**: Demonstrating a pattern of violation of community
111
+ standards, including sustained inappropriate behavior, harassment of an
112
+ individual, or aggression toward or disparagement of classes of individuals.
113
+
114
+ **Consequence**: A permanent ban from any sort of public interaction within
115
+ the community.
116
+
117
+ ## Attribution
43
118
 
44
119
  This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
- version 1.3.0, available at
46
- [http://contributor-covenant.org/version/1/3/0/][version]
120
+ version 2.0, available at
121
+ <https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.
122
+
123
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
124
+ enforcement ladder](https://github.com/mozilla/diversity).
125
+
126
+ [homepage]: https://www.contributor-covenant.org
47
127
 
48
- [homepage]: http://contributor-covenant.org
49
- [version]: http://contributor-covenant.org/version/1/3/0/
128
+ For answers to common questions about this code of conduct, see the FAQ at
129
+ <https://www.contributor-covenant.org/faq>. Translations are available at
130
+ <https://www.contributor-covenant.org/translations>.
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,37 @@
1
+ # Contributing to Procore Projects
2
+
3
+ This document explains the common procedures expected by contributors while submitting code to Procore open source projects.
4
+
5
+ ## Code of Conduct
6
+
7
+ Please read and abide by the [Code of Conduct](CODE_OF_CONDUCT.md)
8
+
9
+ ## General workflow
10
+
11
+ Once a GitHub issue is accepted and assigned to you, please follow general workflow in order to submit your contribution:
12
+
13
+ 1. Fork the target repository under your GitHub username.
14
+ 2. Create a branch in your forked repository for the changes you are about to make.
15
+ 3. Commit your changes in the branch you created in step 2. All commits need to be signed-off. Check the [legal](#legal) section bellow for more details.
16
+ 4. Push your commits to your remote fork.
17
+ 5. Create a Pull Request from your remote fork pointing to the HEAD branch (usually `main` branch) of the target repository.
18
+ 6. Check the GitHub build and ensure that all checks are green.
19
+
20
+ ## Legal
21
+
22
+ Procore projects use Developer Certificate of Origin ([DCO](https://GitHub.com/apps/dco/)).
23
+
24
+ Please sign-off your contributions by doing ONE of the following:
25
+
26
+ * Use `git commit -s ...` with each commit to add the sign-off or
27
+ * Manually add a `Signed-off-by: Your Name <your.email@example.com>` to each commit message.
28
+
29
+ The email address must match your primary GitHub email. You do NOT need cryptographic (e.g. gpg) signing.
30
+
31
+ * Use `git commit -s --amend ...` to add a sign-off to the latest commit, if you forgot.
32
+
33
+ *Note*: Some projects will provide specific configuration to ensure all commits are signed-off. Please check the project's documentation for more details.
34
+
35
+ ## Tests
36
+
37
+ Make sure your changes are properly covered by automated tests. We aim to build an efficient test suite that is low cost to maintain and bring value to project. Prefer writing unit-tests over heavy end-to-end (e2e) tests. However, sometimes e2e tests are necessary. If you aren't sure, ask one of the maintainers about the requirements for your pull-request.
data/README.md CHANGED
@@ -1,9 +1,10 @@
1
1
  # Handcuffs
2
2
 
3
- [![Circle CI](https://circleci.com/gh/procore/handcuffs.svg?style=svg)](https://circleci.com/gh/procore/handcuffs)
3
+ [![Test](https://github.com/procore-oss/handcuffs/actions/workflows/test.yaml/badge.svg?branch=main)](https://github.com/procore-oss/handcuffs/actions/workflows/test.yaml)
4
+ [![Gem Version](https://badge.fury.io/rb/handcuffs.svg)](https://badge.fury.io/rb/handcuffs)
5
+ [![Discord](https://img.shields.io/badge/Chat-EDEDED?logo=discord)](https://discord.gg/PbntEMmWws)
4
6
 
5
- Handcuffs provides an easy way to run migrations in phases in your [Ruby on
6
- Rails](https://rubyonrails.org/) application.
7
+ Handcuffs provides an easy way to run migrations in phases in your [Ruby on Rails](https://rubyonrails.org/) application.
7
8
 
8
9
  To configure, first create a handcuff initializer and define a configuration
9
10
 
@@ -54,25 +55,27 @@ end
54
55
  ```
55
56
 
56
57
  You can then run your migrations in phases using
58
+
57
59
  ```bash
58
60
  rake 'handcuffs:migrate[pre_restart]'
59
61
  ```
62
+
60
63
  or
64
+
61
65
  ```bash
62
66
  rake 'handcuffs:migrate[post_restart]'
63
67
  ```
64
68
 
65
69
  You can run all migrations using
70
+
66
71
  ```bash
67
72
  rake 'handcuffs:migrate[all]'
68
73
  ```
69
74
 
70
- This differs from running `rake db:migrate` in that migrations will be run in
71
- the _order that the phases are defined in the handcuffs config_.
75
+ This differs from running `rake db:migrate` in that migrations will be run in the _order that the phases are defined in the handcuffs config_.
76
+
77
+ If you run a handcuffs rake task and any migration does not have a phase defined, an error will be raised before any migrations are run. To prevent this error, you can define a default phase for migrations that don't define one.
72
78
 
73
- If you run a handcuffs rake task and any migration does not have a phase
74
- defined, an error will be raised before any migrations are run. To prevent this
75
- error, you can define a default phase for migrations that don't define one.
76
79
  ```ruby
77
80
  # config/initializers/handcuffs.rb
78
81
 
@@ -92,23 +95,23 @@ gem 'handcuffs'
92
95
 
93
96
  And then execute:
94
97
 
95
- $ bundle
98
+ ```bash
99
+ bundle
100
+ ```
96
101
 
97
102
  Or install it yourself as:
98
103
 
99
- $ gem install handcuffs
104
+ ```bash
105
+ gem install handcuffs
106
+ ```
100
107
 
101
108
  ## Running specs
102
109
 
103
- The specs for handcuffs are in the dummy application at `/spec/dummy/spec`. The
104
- spec suite requires PostgreSQL. To run it you will have to set the environment
105
- variables `POSTGRES_DB_USERNAME` and `POSTGRES_DB_PASSWORD`. You can then run
106
- the suite using `rake spec`
110
+ The specs for handcuffs are in the dummy application at `/spec/dummy/spec`. The spec suite requires PostgreSQL. To run it you will have to set the environment variables `POSTGRES_DB_USERNAME` and `POSTGRES_DB_PASSWORD`. You can then run the suite using `rake spec`
107
111
 
108
112
  ## Contributing
109
113
 
110
- Bug reports and pull requests are welcome on GitHub at https://github.com/procore/handcuffs. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
111
-
114
+ Bug reports and pull requests are welcome on GitHub at <https://github.com/procore-oss/handcuffs>. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
112
115
 
113
116
  ## License
114
117
 
data/SECURITY.md ADDED
@@ -0,0 +1,19 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ Ruby versions that are currently being supported with security updates.
6
+
7
+ | Version | Supported |
8
+ | ------- | ------------------ |
9
+ | <=2.6 | :x: |
10
+ | 2.7 | :white_check_mark: |
11
+ | 3.0 | :white_check_mark: |
12
+ | 3.1 | :white_check_mark: |
13
+ | 3.2 | :white_check_mark: |
14
+
15
+ ## Reporting a Vulnerability
16
+
17
+ Please click the `Report a vulnerability` button [here](https://github.com/procore-oss/handcuffs/security) to report a vulnerability.
18
+
19
+ A maintainer will respond to you as soon as possible and discuss the process to get the vulnerability fixed.
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 5.2.3"
5
+ gem "rails", "~> 6.1.0"
6
6
 
7
7
  gemspec path: "../"
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 6.0.1"
5
+ gem "rails", "~> 7.0.0"
6
6
 
7
7
  gemspec path: "../"
@@ -2,7 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 4.2.8"
6
- gem "pg", "~> 0.15"
5
+ gem "rails", "~> 7.1.0"
7
6
 
8
7
  gemspec path: "../"
data/handcuffs.gemspec CHANGED
@@ -6,18 +6,20 @@ require 'handcuffs/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "handcuffs"
8
8
  spec.version = Handcuffs::VERSION
9
- spec.authors = ["Brad Urani"]
10
- spec.email = ["bradurani@gmail.com", "opensource@procore.com"]
9
+ spec.authors = ["Procore Technologies, Inc."]
10
+ spec.email = ["opensource@procore.com"]
11
11
 
12
12
  spec.summary = %q{A Ruby gem for running Active Record migrations in phases}
13
13
  spec.description = %q{Allows you to define a phase on Active Record migrations and provides rake tasks for running only migrations tagged with a certain phase}
14
- spec.homepage = "https://github.com/procore/handcuffs/"
14
+ spec.homepage = "https://github.com/procore-oss/handcuffs/"
15
15
  spec.license = "MIT"
16
16
 
17
17
  # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
18
  # delete this section to allow pushing this gem to any host.
19
19
  if spec.respond_to?(:metadata)
20
20
  spec.metadata['allowed_push_host'] = "https://rubygems.org"
21
+ spec.metadata['rubygems_mfa_required'] = 'true'
22
+ spec.metadata['homepage_uri'] = spec.homepage
21
23
  else
22
24
  raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
25
  end
@@ -32,6 +34,7 @@ Gem::Specification.new do |spec|
32
34
  spec.add_development_dependency "pry"
33
35
  spec.add_development_dependency "pry-byebug"
34
36
  spec.add_development_dependency "rspec-rails", "~> 3.0"
37
+ spec.add_development_dependency "simplecov"
35
38
 
36
- spec.add_runtime_dependency "rails", ">= 4.0", "< 6.1"
39
+ spec.add_runtime_dependency "rails", ">= 6.1"
37
40
  end
@@ -44,7 +44,7 @@
44
44
  class HandcuffsPhaseOutOfOrderError < HandcuffsError
45
45
  def initialize(not_run_phase, attempted_phase)
46
46
  msg = <<-MESSAGE
47
- Your tried to run #{attempted_phase.to_s}, but #{not_run_phase.to_s} has not been run
47
+ You tried to run #{attempted_phase.to_s}, but #{not_run_phase.to_s} has not been run
48
48
  MESSAGE
49
49
  super msg
50
50
  end
@@ -1,3 +1,3 @@
1
1
  module Handcuffs
2
- VERSION = "1.4.0"
2
+ VERSION = "2.0.0"
3
3
  end
@@ -47,7 +47,7 @@ namespace :handcuffs do
47
47
  runnable.find_all { |m| ran?(m) }
48
48
  end
49
49
  end
50
- end
50
+ end
51
51
 
52
52
  module PhaseAccessor
53
53
  attr_accessor :handcuffs_phase
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: handcuffs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
- - Brad Urani
7
+ - Procore Technologies, Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-24 00:00:00.000000000 Z
11
+ date: 2024-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal
@@ -81,13 +81,24 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '3.0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rails
84
+ name: simplecov
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '4.0'
90
- - - "<"
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rails
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
91
102
  - !ruby/object:Gem::Version
92
103
  version: '6.1'
93
104
  type: :runtime
@@ -95,36 +106,45 @@ dependencies:
95
106
  version_requirements: !ruby/object:Gem::Requirement
96
107
  requirements:
97
108
  - - ">="
98
- - !ruby/object:Gem::Version
99
- version: '4.0'
100
- - - "<"
101
109
  - !ruby/object:Gem::Version
102
110
  version: '6.1'
103
111
  description: Allows you to define a phase on Active Record migrations and provides
104
112
  rake tasks for running only migrations tagged with a certain phase
105
113
  email:
106
- - bradurani@gmail.com
107
114
  - opensource@procore.com
108
115
  executables: []
109
116
  extensions: []
110
117
  extra_rdoc_files: []
111
118
  files:
112
- - ".circleci/config.yml"
119
+ - ".github/CODEOWNERS"
120
+ - ".github/ISSUE_TEMPLATE/bug.yml"
121
+ - ".github/ISSUE_TEMPLATE/config.yml"
122
+ - ".github/ISSUE_TEMPLATE/docs.yml"
123
+ - ".github/ISSUE_TEMPLATE/feature-request.yml"
124
+ - ".github/ISSUE_TEMPLATE/question-support.yml"
125
+ - ".github/PULL_REQUEST_TEMPLATE.md"
126
+ - ".github/dependabot.yaml"
127
+ - ".github/workflows/auto-assign-author.yaml"
128
+ - ".github/workflows/codeql.yaml"
129
+ - ".github/workflows/release.yaml"
130
+ - ".github/workflows/stale.yaml"
131
+ - ".github/workflows/test.yaml"
113
132
  - ".gitignore"
114
133
  - Appraisals
134
+ - CHANGELOG.md
115
135
  - CODE_OF_CONDUCT.md
136
+ - CONTRIBUTING.md
116
137
  - Gemfile
117
- - LICENSE.txt
138
+ - LICENSE.md
118
139
  - README.md
119
140
  - Rakefile
141
+ - SECURITY.md
120
142
  - bin/console
121
143
  - bin/setup
122
144
  - gemfiles/.bundle/config
123
- - gemfiles/rails_4.gemfile
124
- - gemfiles/rails_5.1.gemfile
125
- - gemfiles/rails_5.2.gemfile
126
- - gemfiles/rails_5.gemfile
127
- - gemfiles/rails_6.gemfile
145
+ - gemfiles/rails_6.1.gemfile
146
+ - gemfiles/rails_7.0.gemfile
147
+ - gemfiles/rails_7.1.gemfile
128
148
  - handcuffs.gemspec
129
149
  - lib/handcuffs.rb
130
150
  - lib/handcuffs/configuration.rb
@@ -136,11 +156,13 @@ files:
136
156
  - lib/handcuffs/railtie.rb
137
157
  - lib/handcuffs/version.rb
138
158
  - lib/tasks/handcuffs.rake
139
- homepage: https://github.com/procore/handcuffs/
159
+ homepage: https://github.com/procore-oss/handcuffs/
140
160
  licenses:
141
161
  - MIT
142
162
  metadata:
143
163
  allowed_push_host: https://rubygems.org
164
+ rubygems_mfa_required: 'true'
165
+ homepage_uri: https://github.com/procore-oss/handcuffs/
144
166
  post_install_message:
145
167
  rdoc_options: []
146
168
  require_paths:
@@ -156,8 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
178
  - !ruby/object:Gem::Version
157
179
  version: '0'
158
180
  requirements: []
159
- rubyforge_project:
160
- rubygems_version: 2.6.11
181
+ rubygems_version: 3.4.19
161
182
  signing_key:
162
183
  specification_version: 4
163
184
  summary: A Ruby gem for running Active Record migrations in phases
data/.circleci/config.yml DELETED
@@ -1,98 +0,0 @@
1
- version: 2
2
-
3
- aliases:
4
- database: &database
5
- image: circleci/postgres:10-ram
6
- environment:
7
- POSTGRES_USER: ubuntu
8
- POSTGRES_DB: handcuffs_test
9
- POSTGRES_HOST_AUTH_METHOD: trust
10
-
11
- test_env: &test_env
12
- - PGHOST=localhost
13
- - PGUSER=ubuntu
14
- - RAILS_ENV=test
15
- - BUNDLER_VERSION=1.17.3
16
-
17
- run_tests: &run_tests
18
- - checkout
19
-
20
- - run:
21
- name: Install Bundler
22
- command: gem install bundler:1.17.3
23
-
24
- - run:
25
- name: Install Ruby Dependencies
26
- command: bundle install && cd spec/dummy && bundle install
27
-
28
- - run:
29
- name: Install Apprasals Dependencies
30
- command: bundle exec appraisal install
31
-
32
- - run:
33
- name: Setup Database
34
- command: cd spec/dummy && bundle exec rake db:create db:migrate --trace
35
-
36
- - run:
37
- name: Run Appraisals Tests
38
- command: bundle exec appraisal rspec
39
-
40
- - run:
41
- name: Run Dummy App Tests
42
- command: cd spec/dummy && bin/rspec
43
-
44
- jobs:
45
- ruby_2_3:
46
- docker:
47
- - image: circleci/ruby:2.3
48
- environment:
49
- *test_env
50
- - *database
51
- steps:
52
- *run_tests
53
-
54
- ruby_2_4:
55
- docker:
56
- - image: circleci/ruby:2.4
57
- environment:
58
- *test_env
59
- - *database
60
- steps:
61
- *run_tests
62
-
63
- ruby_2_5:
64
- docker:
65
- - image: circleci/ruby:2.5
66
- environment:
67
- *test_env
68
- - *database
69
- steps:
70
- *run_tests
71
-
72
- ruby_2_6:
73
- docker:
74
- - image: circleci/ruby:2.6
75
- environment:
76
- *test_env
77
- - *database
78
- steps:
79
- *run_tests
80
-
81
- ruby_2_7:
82
- docker:
83
- - image: circleci/ruby:2.7
84
- environment:
85
- *test_env
86
- - *database
87
- steps:
88
- *run_tests
89
-
90
- workflows:
91
- version: 2
92
- test-all:
93
- jobs:
94
- - ruby_2_3
95
- - ruby_2_4
96
- - ruby_2_5
97
- - ruby_2_6
98
- - ruby_2_7
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 5.1.7"
6
- gem "pg", "~> 0.18"
7
-
8
- gemspec path: "../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 5.0.0.1"
6
- gem "pg", "~> 0.18"
7
-
8
- gemspec path: "../"
File without changes