gelauto 1.2.0 → 1.3.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: 12cc9a0a73a5ed28daf5df44cc9b0ece74b51ce1e28114b55f9868e956816420
4
- data.tar.gz: b77e3b82e0b89a84473dda0db7d20978926e879c25a3ee484d74af04d058edd4
3
+ metadata.gz: d8bc0cbf96338d28a4c1551f2fc2cf7e7cbea122ccbf1ecbcbe3904713d77293
4
+ data.tar.gz: 42e169f43e1d41de1ebd1d426dcd23358271aa3a658dc3d8d37288767223df13
5
5
  SHA512:
6
- metadata.gz: '04583e3ed26dd8537ca43b5c0beb8202f2ecc64a91e49b8e88b38c916ecb0ac2253894527332dd156344cc6056d10239b83932b241e28f575ace51aa069d7f8e'
7
- data.tar.gz: 8a60e3eb0ae8c43f9ba58625338bbeba9ff7bbba9e7569cedd218a332d976656c61306ac60c10ade2c09010d5e41d808493e0ca489633d21f424b8006376435a
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. In this example, we're going to be running an [RSpec](https://github.com/rspec/rspec) test suite.
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 all this for you. Simply add
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) { Gelauto.setup }
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
- Gelauto.each_absolute_path do |path|
9
- Gelauto.annotate_file(path)
10
- Gelauto::Logger.info("Annotated #{path}")
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
@@ -1,3 +1,3 @@
1
1
  module Gelauto
2
- VERSION = '1.2.0'
2
+ VERSION = '1.3.0'
3
3
  end
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.2.0
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-18 00:00:00.000000000 Z
11
+ date: 2019-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser