gelauto 1.2.0 → 1.3.0
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 +4 -4
- data/README.md +20 -3
- data/lib/gelauto/rspec.rb +10 -4
- data/lib/gelauto/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8bc0cbf96338d28a4c1551f2fc2cf7e7cbea122ccbf1ecbcbe3904713d77293
|
4
|
+
data.tar.gz: 42e169f43e1d41de1ebd1d426dcd23358271aa3a658dc3d8d37288767223df13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c74d87844d920d0abc555b55f395d61ca0235fd34a4bbcc6eb449a76ee5b304f36a37cf40d8b74817b380162def7aa1224d813fbc0fc7e8f209644428423fbc4
|
7
|
+
data.tar.gz: 850a310b37004110ddbe9b78906c1524fd262cd8ae1c67c861172818231c930bcfd83ac57e9b394ef800ee255330e6b7f2a900bd5018026f78bc588ad68bb236
|
data/README.md
CHANGED
@@ -42,8 +42,9 @@ You can run Gelauto either via the command line or by adding it to your bundle.
|
|
42
42
|
|
43
43
|
First, install the gem by running `gem install gelauto`. That will make the `gelauto` executable available on your system.
|
44
44
|
|
45
|
-
Gelauto's only subcommand is `run`, which accepts a list of Ruby files to scan for methods and a command to run that will exercise your code.
|
45
|
+
Gelauto's only subcommand is `run`, which accepts a list of Ruby files to scan for methods and a command to run that will exercise your code.
|
46
46
|
|
47
|
+
In this example, we're going to be running an [RSpec](https://github.com/rspec/rspec) test suite.
|
47
48
|
Like most RSpec test suites, let's assume ours is stored in the `spec/` directory (that's the RSpec default too). Let's furthermore assume our code is stored in the `lib` directory. To run the test suite in `spec/` and add type definitions to our files in `lib/`, we might run the following command:
|
48
49
|
|
49
50
|
```bash
|
@@ -52,6 +53,12 @@ gelauto run --annotate $(find . -name '*.rb') -- bundle exec rspec spec/
|
|
52
53
|
|
53
54
|
You can also choose to run Gelauto with the `--rbi` flag, which will cause Gelauto to print results to standard output in [RBI format](https://sorbet.org/docs/rbi).
|
54
55
|
|
56
|
+
In this second example, we're going to be running a minitest test suite. Like most minitest suites, let's assume ours is stored in the `test/` directory (that's the Rails default too). To run the test suite in `test/`, we might run the following command:
|
57
|
+
|
58
|
+
```bash
|
59
|
+
gelauto run --annotate $(find . -name '*.rb') -- bundle exec rake test/
|
60
|
+
```
|
61
|
+
|
55
62
|
### Gelauto in your Bundle
|
56
63
|
|
57
64
|
If you would rather run Gelauto as part of your bundle, add it to your Gemfile like so:
|
@@ -102,13 +109,23 @@ end
|
|
102
109
|
|
103
110
|
#### RSpec Helper
|
104
111
|
|
105
|
-
Gelauto comes with a handy RSpec helper that can do
|
112
|
+
Gelauto comes with a handy RSpec helper that can do most of this for you. Simply add
|
106
113
|
|
107
114
|
```ruby
|
108
115
|
require 'gelauto/rspec'
|
109
116
|
```
|
110
117
|
|
111
|
-
to your spec_helper.rb, Rakefile, or wherever RSpec is configured.
|
118
|
+
to your spec_helper.rb, Rakefile, or wherever RSpec is configured. You'll also need to set the `GELAUTO_FILES` environment variable when running your test suite. For example:
|
119
|
+
|
120
|
+
```bash
|
121
|
+
GELAUTO_FILES=$(find ./lib -name *.rb) bundle exec rspec
|
122
|
+
```
|
123
|
+
|
124
|
+
Files can be separated by spaces, newlines, or commas. Finally, if you want Gelauto to annotate them, set `GELAUTO_ANNOTATE` to `true`, eg:
|
125
|
+
|
126
|
+
```bash
|
127
|
+
GELAUTO_FILES=$(find ./lib -name *.rb) GELAUTO_ANNOTATE=true bundle exec rspec
|
128
|
+
```
|
112
129
|
|
113
130
|
## How does it Work?
|
114
131
|
|
data/lib/gelauto/rspec.rb
CHANGED
@@ -1,13 +1,19 @@
|
|
1
1
|
require 'gelauto'
|
2
2
|
|
3
3
|
RSpec.configure do |config|
|
4
|
-
config.before(:suite)
|
4
|
+
config.before(:suite) do
|
5
|
+
Gelauto.paths += ENV.fetch('GELAUTO_FILES', '').split(/[\s\n,]/).map(&:strip)
|
6
|
+
Gelauto.setup
|
7
|
+
end
|
8
|
+
|
5
9
|
config.after(:suite) do
|
6
10
|
Gelauto.teardown
|
7
11
|
|
8
|
-
|
9
|
-
Gelauto.
|
10
|
-
|
12
|
+
if ENV['GELAUTO_ANNOTATE'] == 'true'
|
13
|
+
Gelauto.each_absolute_path do |path|
|
14
|
+
Gelauto.annotate_file(path)
|
15
|
+
Gelauto::Logger.info("Annotated #{path}")
|
16
|
+
end
|
11
17
|
end
|
12
18
|
end
|
13
19
|
end
|
data/lib/gelauto/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gelauto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Dutro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|