Skip to content

Commit 2afc542

Browse files
authored
Merge pull request #25 from clarkedb/develop
v1.0.0
2 parents f8698b0 + 611ddff commit 2afc542

Some content is hidden

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

54 files changed

+9417
-43
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.github/ @clarkedb

.github/CONTRIBUTING.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# How to become a contributor and submit your own code
2+
3+
1. Submit an issue on GitHub describing your proposed change to this repo
4+
1. A repo owner will respond to your issue promptly
5+
1. Fork the repo, develop and test your code changes
6+
1. Ensure that your code adheres to the existing style in the code to which you are contributing
7+
1. Ensure that your code has an appropriate set of tests which all pass
8+
1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling
9+
1. Submit a pull request.
10+
11+
## Policy on inclusive language
12+
13+
To make Grift a pleasant and effective experience for everyone, we use try to use inclusive language.
14+
15+
These resources can help:
16+
17+
- Google's tutorial [Writing inclusive documentation](https://developers.google.com/style/inclusive-documentation) teaches by example, how to reword non-inclusive things.
18+
- Linux kernel mailing list's [Coding Style: Inclusive Terminology](https://lkml.org/lkml/2020/7/4/229) said "Add no new instances of non-inclusive words, here is a list of words not include new ones of."
19+
- Linguistic Society of America published [Guidelines for Inclusive Language](https://www.linguisticsociety.org/resource/guidelines-inclusive-language) which concluded: "We encourage all linguists to consider the possible reactions of their potential audience to their writing and, in so doing, to choose expository practices and content that is positive, inclusive, and respectful."
20+
21+
This project attempts to improve in these areas. Join us in doing that important work.
22+
23+
## Required checks
24+
25+
Before pushing your code and opening a PR, we recommend you run the following checks to avoid
26+
our GitHub Actions Workflow to block your contribution.
27+
28+
```bash
29+
# install dependencies
30+
$ bundle install
31+
32+
# Run unit tests and check code coverage
33+
$ bundle exec rake test
34+
35+
# Check code style
36+
$ bundle exec rubocop
37+
```

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
3+
updates:
4+
- directory: /
5+
open-pull-requests-limit: 10
6+
package-ecosystem: bundler
7+
target-branch: develop
8+
schedule:
9+
interval: weekly
10+
labels:
11+
- dependencies

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on: push
4+
5+
env:
6+
GIT_COMMIT_SHA: ${{ github.sha }}
7+
GIT_BRANCH: ${{ github.ref }}
8+
9+
jobs:
10+
linting:
11+
runs-on: ubuntu-latest
12+
env:
13+
BUNDLE_WITH: lint
14+
BUNDLE_WITHOUT: development:test
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Set up Ruby 2.7
20+
uses: ruby/setup-ruby@v1
21+
with:
22+
ruby-version: 2.7
23+
bundler-cache: true
24+
25+
- name: Rubocop
26+
run: bundle exec rubocop --format progress
27+
28+
build:
29+
needs: [ linting ]
30+
runs-on: ubuntu-latest
31+
name: build (ruby v${{ matrix.ruby }})
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
ruby: [ '2.5', '2.6', '2.7', '3.0' ]
36+
37+
steps:
38+
- uses: actions/checkout@v2
39+
- uses: ruby/setup-ruby@v1
40+
with:
41+
ruby-version: ${{ matrix.ruby }}
42+
bundler-cache: true
43+
44+
- name: Test
45+
continue-on-error: ${{ matrix.experimental }}
46+
run: bundle exec rake test

.gitignore

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,11 @@
1111
/tmp/
1212

1313
# Used by dotenv library to load environment variables.
14-
# .env
14+
.env
1515

1616
# Ignore Byebug command history file.
1717
.byebug_history
1818

19-
## Specific to RubyMotion:
20-
.dat*
21-
.repl_history
22-
build/
23-
*.bridgesupport
24-
build-iPhoneOS/
25-
build-iPhoneSimulator/
26-
27-
## Specific to RubyMotion (use of CocoaPods):
28-
#
29-
# We recommend against adding the Pods directory to your .gitignore. However
30-
# you should judge for yourself, the pros and cons are mentioned at:
31-
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
32-
#
33-
# vendor/Pods/
34-
3519
## Documentation cache and generated files:
3620
/.yardoc/
3721
/_yardoc/
@@ -46,11 +30,15 @@ build-iPhoneSimulator/
4630
# for a library or gem, you might want to ignore these files since the code is
4731
# intended to run in multiple environments; otherwise, check them in:
4832
# Gemfile.lock
49-
# .ruby-version
50-
# .ruby-gemset
33+
.ruby-version
34+
.ruby-gemset
5135

5236
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
5337
.rvmrc
5438

5539
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
5640
# .rubocop-https?--*
41+
42+
# IDE and system files
43+
.vscode/
44+
**/.DS_STORE

.rubocop.yml

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# The behavior of RuboCop can be controlled via the .rubocop.yml
2+
# configuration file. It makes it possible to enable/disable
3+
# certain cops (checks) and to alter their behavior if they accept
4+
# any parameters. The file can be placed either in your home
5+
# directory or in some project directory.
6+
#
7+
# RuboCop will start looking for the configuration file in the directory
8+
# where the inspected file is and continue its way up to the root directory.
9+
#
10+
# See https://docs.rubocop.org/rubocop/configuration
11+
12+
# General
13+
AllCops:
14+
NewCops: enable
15+
SuggestExtensions: false
16+
17+
# Layout
18+
Layout/BlockAlignment:
19+
Enabled: true
20+
EnforcedStyleAlignWith: start_of_block
21+
22+
Layout/ClassStructure:
23+
Enabled: true
24+
25+
Layout/DotPosition:
26+
Enabled: true
27+
EnforcedStyle: leading
28+
29+
Layout/FirstArrayElementIndentation:
30+
Enabled: true
31+
EnforcedStyle: consistent
32+
33+
Layout/FirstHashElementIndentation:
34+
Enabled: true
35+
EnforcedStyle: consistent
36+
37+
Layout/HashAlignment:
38+
Enabled: true
39+
EnforcedColonStyle: key
40+
EnforcedLastArgumentHashStyle: always_inspect
41+
42+
Layout/LineEndStringConcatenationIndentation:
43+
Enabled: true
44+
EnforcedStyle: aligned
45+
46+
Layout/LineLength:
47+
Enabled: true
48+
Max: 120
49+
50+
Layout/MultilineArrayLineBreaks:
51+
Enabled: true
52+
53+
Layout/MultilineAssignmentLayout:
54+
Enabled: false
55+
56+
Layout/MultilineHashKeyLineBreaks:
57+
Enabled: true
58+
59+
Layout/MultilineMethodArgumentLineBreaks:
60+
Enabled: true
61+
62+
Layout/MultilineMethodCallIndentation:
63+
Enabled: true
64+
EnforcedStyle: indented_relative_to_receiver
65+
66+
Layout/MultilineOperationIndentation:
67+
Enabled: true
68+
EnforcedStyle: indented
69+
70+
Layout/ParameterAlignment:
71+
Enabled: true
72+
EnforcedStyle: with_first_parameter
73+
74+
Layout/RedundantLineBreak:
75+
Enabled: true
76+
InspectBlocks: false
77+
78+
Layout/SingleLineBlockChain:
79+
Enabled: false
80+
81+
Layout/SpaceBeforeBrackets:
82+
Enabled: true
83+
84+
Layout/TrailingEmptyLines:
85+
Enabled: true
86+
EnforcedStyle: final_newline
87+
88+
# Lint
89+
Lint/AmbiguousAssignment:
90+
Enabled: true
91+
92+
Lint/AmbiguousOperatorPrecedence:
93+
Enabled: true
94+
95+
Lint/AmbiguousRange:
96+
Enabled: true
97+
98+
# Metrics
99+
Metrics/AbcSize:
100+
Max: 20
101+
Exclude:
102+
- "test/**/*"
103+
104+
Metrics/ClassLength:
105+
Max: 150
106+
CountAsOne:
107+
- array
108+
- hash
109+
- heredoc
110+
Exclude:
111+
- "test/**/*"
112+
113+
Metrics/MethodLength:
114+
Max: 20
115+
CountAsOne:
116+
- array
117+
- hash
118+
- heredoc
119+
Exclude:
120+
- "test/**/*"
121+
122+
# Naming
123+
Naming/InclusiveLanguage:
124+
Enabled: true
125+
126+
Naming/VariableNumber:
127+
EnforcedStyle: snake_case
128+
129+
# Style
130+
Style/AndOr:
131+
EnforcedStyle: always
132+
133+
Style/ArrayCoercion:
134+
Enabled: true
135+
136+
Style/CollectionCompact:
137+
Enabled: true
138+
139+
Style/ConstantVisibility:
140+
Enabled: true
141+
IgnoreModules: true
142+
143+
Style/Documentation:
144+
Exclude:
145+
- "test/**/*"
146+
147+
Style/DocumentationMethod:
148+
Enabled: true
149+
Exclude:
150+
- "test/**/*"
151+
152+
Style/SelectByRegexp:
153+
Enabled: false
154+
155+
Style/SwapValues:
156+
Enabled: true
157+
158+
Style/TrailingCommaInArrayLiteral:
159+
EnforcedStyleForMultiline: comma

.yardopts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-o ./docs - LICENSE

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## Unreleased
8+
9+
N/A
10+
11+
## [1.0.0](https://github.com/clarkedb/grift/releases/tag/v1.0.0) - 2021-11-06
12+
13+
The first major version of Grift! 100% documentation and 100% code coverage.
14+
15+
### Added
16+
17+
* Spying on method
18+
* Mocking method return values
19+
* Mocking method implementation
20+
* Restricted methods that cannot be mocked
21+
* MiniTest Plugin to use hooks and clean up after tests
22+
* Documentation!
23+
24+
## [0.1.0](https://github.com/clarkedb/grift/releases/tag/v0.1.0) - 2021-10-12
25+
26+
The initial version of Grift. This was never intended for use and should be considered **deprecated**.

Gemfile

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1-
source "https://rubygems.org"
1+
# frozen_string_literal: true
22

3-
# Specify your gem's dependencies in grift.gemspec
3+
source 'https://rubygems.org'
4+
5+
# Grift's gem dependencies are defined in grift.gemspec
46
gemspec
57

6-
gem "minitest", "~> 5.0"
7-
gem "rake", "~> 12.0"
8+
gem 'rake', '>= 12.0'
9+
10+
group :development, :test do
11+
gem 'minitest', '>= 5.0'
12+
gem 'minitest-reporters', '>= 1.4.3'
13+
gem 'simplecov', '>= 0.21.2'
14+
end
15+
16+
group :development, :lint do
17+
gem 'rubocop'
18+
gem 'rubocop-minitest'
19+
gem 'rubocop-packaging', '>= 0.5'
20+
gem 'rubocop-performance', '>= 1.0'
21+
end

0 commit comments

Comments
 (0)