rspec-sorbet 1.8.0 → 1.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/.devcontainer/devcontainer.json +5 -0
  3. data/.github/workflows/ci.yml +19 -51
  4. data/.gitignore +2 -1
  5. data/.rubocop.yml +16 -60
  6. data/CHANGELOG.md +53 -22
  7. data/Gemfile +15 -16
  8. data/README.md +16 -3
  9. data/Rakefile +3 -1
  10. data/bin/console +4 -3
  11. data/bin/rbi +6 -0
  12. data/bin/rspec +27 -0
  13. data/bin/rubocop +27 -0
  14. data/bin/setup +0 -2
  15. data/bin/tapioca +31 -0
  16. data/generate_require_files.rb +10 -10
  17. data/lib/rspec/all.rb +2 -2
  18. data/lib/rspec/sorbet/all.rb +2 -2
  19. data/lib/rspec/sorbet/doubles.rb +74 -13
  20. data/lib/rspec/sorbet/version.rb +1 -1
  21. data/lib/rspec/sorbet.rb +1 -1
  22. data/rspec-sorbet.gemspec +20 -18
  23. metadata +27 -84
  24. data/.reek.yml +0 -32
  25. data/.ruby-version +0 -1
  26. data/sorbet/config +0 -2
  27. data/sorbet/rbi/gems/activesupport.rbi +0 -1722
  28. data/sorbet/rbi/gems/ast.rbi +0 -48
  29. data/sorbet/rbi/gems/byebug.rbi +0 -1041
  30. data/sorbet/rbi/gems/coderay.rbi +0 -285
  31. data/sorbet/rbi/gems/concurrent-ruby.rbi +0 -1586
  32. data/sorbet/rbi/gems/docile.rbi +0 -32
  33. data/sorbet/rbi/gems/em-websocket.rbi +0 -225
  34. data/sorbet/rbi/gems/eventmachine.rbi +0 -489
  35. data/sorbet/rbi/gems/ffaker.rbi +0 -60
  36. data/sorbet/rbi/gems/guard.rbi +0 -397
  37. data/sorbet/rbi/gems/http_parser.rb.rbi +0 -37
  38. data/sorbet/rbi/gems/i18n.rbi +0 -133
  39. data/sorbet/rbi/gems/kwalify.rbi +0 -340
  40. data/sorbet/rbi/gems/listen.rbi +0 -324
  41. data/sorbet/rbi/gems/lumberjack.rbi +0 -300
  42. data/sorbet/rbi/gems/method_source.rbi +0 -64
  43. data/sorbet/rbi/gems/multi_json.rbi +0 -62
  44. data/sorbet/rbi/gems/nenv.rbi +0 -60
  45. data/sorbet/rbi/gems/notiffany.rbi +0 -215
  46. data/sorbet/rbi/gems/parallel.rbi +0 -82
  47. data/sorbet/rbi/gems/parser.rbi +0 -1846
  48. data/sorbet/rbi/gems/pry-byebug.rbi +0 -155
  49. data/sorbet/rbi/gems/pry.rbi +0 -1949
  50. data/sorbet/rbi/gems/rainbow.rbi +0 -118
  51. data/sorbet/rbi/gems/rake.rbi +0 -648
  52. data/sorbet/rbi/gems/rb-fsevent.rbi +0 -31
  53. data/sorbet/rbi/gems/rb-readline.rbi +0 -767
  54. data/sorbet/rbi/gems/reek.rbi +0 -1027
  55. data/sorbet/rbi/gems/regexp_parser.rbi +0 -913
  56. data/sorbet/rbi/gems/rexml.rbi +0 -605
  57. data/sorbet/rbi/gems/rspec-core.rbi +0 -1913
  58. data/sorbet/rbi/gems/rspec-expectations.rbi +0 -1123
  59. data/sorbet/rbi/gems/rspec-mocks.rbi +0 -1099
  60. data/sorbet/rbi/gems/rspec-support.rbi +0 -280
  61. data/sorbet/rbi/gems/rspec.rbi +0 -15
  62. data/sorbet/rbi/gems/rubocop-ast.rbi +0 -1053
  63. data/sorbet/rbi/gems/rubocop-rspec.rbi +0 -937
  64. data/sorbet/rbi/gems/rubocop.rbi +0 -6841
  65. data/sorbet/rbi/gems/ruby-progressbar.rbi +0 -305
  66. data/sorbet/rbi/gems/shellany.rbi +0 -29
  67. data/sorbet/rbi/gems/shoulda-matchers.rbi +0 -1848
  68. data/sorbet/rbi/gems/simplecov-html.rbi +0 -35
  69. data/sorbet/rbi/gems/simplecov.rbi +0 -361
  70. data/sorbet/rbi/gems/sqlite3.rbi +0 -354
  71. data/sorbet/rbi/gems/stackprof.rbi +0 -52
  72. data/sorbet/rbi/gems/thor.rbi +0 -32
  73. data/sorbet/rbi/gems/thread_safe.rbi +0 -82
  74. data/sorbet/rbi/gems/timecop.rbi +0 -98
  75. data/sorbet/rbi/gems/tzinfo.rbi +0 -406
  76. data/sorbet/rbi/gems/unicode-display_width.rbi +0 -17
  77. data/sorbet/rbi/hidden-definitions/errors.txt +0 -7275
  78. data/sorbet/rbi/hidden-definitions/hidden.rbi +0 -14595
  79. data/sorbet/rbi/sorbet-typed/lib/activesupport/>=6.0.0.rc1/activesupport.rbi +0 -23
  80. data/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +0 -1431
  81. data/sorbet/rbi/sorbet-typed/lib/minitest/all/minitest.rbi +0 -108
  82. data/sorbet/rbi/sorbet-typed/lib/rainbow/all/rainbow.rbi +0 -276
  83. data/sorbet/rbi/sorbet-typed/lib/rubocop/~>0.85/rubocop.rbi +0 -2072
  84. data/sorbet/rbi/sorbet-typed/lib/rubocop-rspec/~>1.39/rubocop-rspec.rbi +0 -398
  85. data/sorbet/rbi/todo.rbi +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b9dec091b4abda0048e4bf484b56811c33a08bfb7db3fc7ee8b94a03e23378c4
4
- data.tar.gz: 90d696955efbfa611cf59e8ea5260d38c6e209db279f4dec329d3beef927becf
3
+ metadata.gz: 1e49df5d697e2d441b06483b44261e8edb5ac59b7003c5356d88d6be106db79e
4
+ data.tar.gz: 17aebafd7cd92d511915bced0d87279e8a0a271ba4ed593a7cdd465c5514c31c
5
5
  SHA512:
6
- metadata.gz: 49d3f9d8bf3467e4e5c08a8849180db0a86350573be2fd9502703e6036e3dcb2e7185bc63e162550c87c858c0eec07ed8b45371d11143c7b5ef5c8a19b306bdd
7
- data.tar.gz: 83828976655f48b64fe4c6957b2a41ca6323047296a0bdd3c4a6febbef3957c83ea6dc312ee9a1d4e08aa4284f5ae45fc556b64087ff99daf1fff5209566deb6
6
+ metadata.gz: 0d37e33a3218ebde8de313aa0707c690f1d06c28b04f552dcc6611d09334d52b73a4aeafc50b132fdc7c1266f1a430a2affffc17928857ecebdefa788e081fa6
7
+ data.tar.gz: 777a239771115649469b1eff69936a5bd64c1815915ee322300028864d44092481d94b637c0b778b85020a965b900af7d3414ab903dc0ee703cd4dfabc18c47d
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "Ruby",
3
+ "image": "mcr.microsoft.com/devcontainers/ruby:0-3.1",
4
+ "postCreateCommand": "bin/setup"
5
+ }
@@ -1,56 +1,24 @@
1
- ---
2
1
  name: Continuous Integration
3
- on:
4
- push:
5
- branches-ignore:
6
- - refs/tags/*_staging
7
- - refs/tags/*_production
2
+
3
+ on: push
4
+
5
+ permissions:
6
+ contents: read
7
+
8
8
  jobs:
9
- build:
10
- runs-on: ubuntu-18.04
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ ruby-version: ['3.1']
11
14
  steps:
12
- - name: Checkout branch
13
- uses: actions/checkout@v2
14
- - name: Extract branch name
15
- shell: bash
16
- run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
17
- id: extract_branch
18
- - name: Install Linux dependencies
19
- run: sudo apt-get update -qq && sudo apt-get install -y libsqlite3-dev
15
+ - uses: actions/checkout@v3
20
16
  - name: Set up Ruby
21
- uses: actions/setup-ruby@v1
17
+ uses: ruby/setup-ruby@v1
22
18
  with:
23
- ruby-version: 2.6.6
24
- - name: Cache gems
25
- uses: actions/cache@v2
26
- with:
27
- path: vendor/bundle
28
- key: "${{ runner.OS }}-gem-cache-${{ hashFiles('**/rspec-sorbet.gemspec')
29
- }}"
30
- restore-keys: "${{ runner.OS }}-gem-cache-\n"
31
- - name: Install bundler
32
- run: (bundler -v | grep "2.1.4") || gem install bundler:2.1.4
33
- - name: Remove metrics from bundled gems
34
- run: bundle config set without 'metrics'
35
- - name: Install gems
36
- run: bundle install --jobs $(nproc) --retry 3 --path vendor/bundle
37
- - name: Create cache directory
38
- run: mkdir -p tmp/cache
39
- - name: Typecheck with Sorbet
40
- run: bundle exec srb tc . --ignore=/vendor
41
- - name: Run RSpec test suite
42
- run: bundle exec rspec spec
43
- env:
44
- METRICS: '1'
45
- - name: Post to Slack if build fails
46
- if: failure() && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/stable')
47
- uses: pullreminders/slack-action@master
48
- env:
49
- SLACK_BOT_TOKEN: "${{ secrets.SLACK_BOT_TOKEN }}"
50
- with:
51
- args: '{\"channel\":\"C33574SJJ\",\"text\":\"* ${{ github.repository }} BUILD
52
- FAILURE*\", \"attachments\": [{ \"fallback\": \"Failure summary\", \"color\":
53
- \"#ff0000\", \"fields\": [{\"title\": \"Branch\", \"value\":\"${{ steps.extract_branch.outputs.branch
54
- }}\"}, {\"title\": \"Who broke it\", \"value\":\"${{ github.actor }}\"},
55
- { \"title\": \"Build output\", \"value\": \"https://github.com/${{ github.repository
56
- }}/commit/${{ github.sha }}/checks\", \"short\": false }]}]}'
19
+ ruby-version: ${{ matrix.ruby-version }}
20
+ bundler-cache: true
21
+ - name: Run RSpec tests
22
+ run: bin/rspec
23
+ - name: Check for Rubocop offenses
24
+ run: bin/rubocop --format github
data/.gitignore CHANGED
@@ -12,9 +12,10 @@
12
12
  # rspec failure tracking
13
13
  .rspec_status
14
14
 
15
- /shell.nix
16
15
  /tags
17
16
 
18
17
  *.log
19
18
 
20
19
  .ruby-gemset
20
+ .direnv
21
+ .envrc
data/.rubocop.yml CHANGED
@@ -1,66 +1,22 @@
1
- ---
2
- Documentation:
3
- Enabled: false
4
- Rails:
5
- Enabled: true
1
+ inherit_gem:
2
+ rubocop-shopify: rubocop.yml
3
+ require: rubocop-rspec
4
+
6
5
  AllCops:
7
- Include:
8
- - app/**/*.rb
9
- - lib/**/*.rb
10
- - spec/**/*.rb
11
- Exclude:
12
- - app/assets/**/*
13
- - bin/**/*
14
- - client/node_modules/**/*
15
- - config/**/*
16
- - coverage/**/*
17
- - data/**/*
18
- - db/**/*
19
- - db_*/**/*
20
- - dw/**/*
21
- - log/**/*
22
- - phrase/**/*
23
- - public/**/*
24
- - tmp/**/*
25
- - vendor/**/*
26
- TargetRubyVersion: 2.5
27
- Metrics/LineLength:
28
- Max: 100
29
- Layout/MultilineMethodCallIndentation:
30
- EnforcedStyle: indented
31
- Style/PercentLiteralDelimiters:
32
- PreferredDelimiters:
33
- "%w": "[]"
34
- RSpec/ExampleLength:
35
- Enabled: false
36
- Max: 10
37
- RSpec/MultipleExpectations:
38
- Enabled: false
39
- Max: 10
40
- RSpec/NestedGroups:
41
- Enabled: false
42
- Max: 10
43
- RSpec/MessageExpectation:
6
+ NewCops: disable
7
+ SuggestExtensions: false
8
+
9
+ RSpec/LeakyConstantDeclaration:
44
10
  Enabled: false
45
- RSpec/MissingExampleGroupArgument:
46
- Enabled: false
47
- require:
48
- - rubocop-performance
49
- - rubocop-rspec
50
- - test_prof/rubocop
51
- Metrics/BlockLength:
52
- Enabled: false
53
- RSpec/MessageSpies:
54
- Enabled: false
55
- RSpec/ExpectInHook:
11
+
12
+ RSpec/ExampleLength:
56
13
  Enabled: false
57
- RSpec/AggregateFailures:
58
- Enabled: true
59
- Include:
60
- - spec/**/*.rb
61
- Rails/InverseOf:
14
+
15
+ RSpec/NamedSubject:
62
16
  Enabled: false
63
- Rails/Present:
17
+
18
+ RSpec/MultipleExpectations:
64
19
  Enabled: false
65
- Rails/TimeZone:
20
+
21
+ RSpec/VerifiedDoubles:
66
22
  Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,41 +1,72 @@
1
- 1.8.0
1
+ # Changelog
2
2
 
3
- * Fixed issues around union types referencing typed enumerables.
3
+ ## 1.9.2
4
4
 
5
- 1.7.0
5
+ - Rubocop offenses resolved
6
+ - Sorbet signatures added to `RSpec::Sorbet::Doubles`
7
+ - Added `RSpec::Sorbet.reset!` to restore handlers to previous state
8
+ - Added fix to prevent `SystemStackError` by keeping track of when handlers have been configured. (thanks [@alex-tan](https://github.com/alex-tan))
9
+ - Added logic to pass type error onwards to existing inline type error handler.
10
+ - Slimmed down Gem RBIs to minimum needed for `srb tc` to pass in development.
6
11
 
7
- * Added support `T.class_of`.
12
+ ## 1.9.1
8
13
 
9
- 1.6.0
14
+ - Support `T.nilable(T.class_of(...))` among others (thanks [@deecewan](https://github.com/deecewan))
10
15
 
11
- * Non-verifying double support improved.
16
+ ## 1.9.0
12
17
 
13
- 1.5.0
18
+ - Allow specification of a custom validation handler (thanks [@bmalinconico](https://github.com/bmalinconico))
14
19
 
15
- * Added support for `T.cast`.
20
+ ## 1.8.3
16
21
 
17
- 1.4.0
22
+ - Make sorbet a development dependency
18
23
 
19
- * Added support for `T.let` referencing `T.nilable` types.
24
+ ## 1.8.2
20
25
 
21
- 1.3.0
26
+ - Reduce gem size by excluding RBIs from gem build
22
27
 
23
- * Added ability to allow any kind of double (Class, Instance, Object).
24
- * `RSpec::Sorbet.allow_instance_doubles!` has been renamed to `RSpec::Sorbet.allow_doubles!`, an alias remains for backwards compatibility for the time being.
28
+ ## 1.8.1
25
29
 
26
- 1.2.1
30
+ - [BUGFIX] Fix processing T.let type mismatch messages when there are digits in module name
27
31
 
28
- * Fix call check when opts contains :message instead of :pretty_message.
32
+ ## 1.8.0
29
33
 
30
- 1.2.0
34
+ - Fixed issues around union types referencing typed enumerables.
31
35
 
32
- * Added support for verifying `T::Enumerable` types.
36
+ ## 1.7.0
33
37
 
34
- 1.1.0
38
+ - Added support `T.class_of`.
35
39
 
36
- * Add basic `instance_double` verification to help check the type of an instance double.
40
+ ## 1.6.0
37
41
 
38
- 1.0.0
42
+ - Non-verifying double support improved.
39
43
 
40
- * Initial release
41
- * Supports just allowing instance doubles for now
44
+ ## 1.5.0
45
+
46
+ - Added support for `T.cast`.
47
+
48
+ ## 1.4.0
49
+
50
+ - Added support for `T.let` referencing `T.nilable` types.
51
+
52
+ ## 1.3.0
53
+
54
+ - Added ability to allow any kind of double (Class, Instance, Object).
55
+ - `RSpec::Sorbet.allow_instance_doubles!` has been renamed to `RSpec::Sorbet.allow_doubles!`, an alias remains for backwards compatibility for the time being.
56
+
57
+ ## 1.2.1
58
+
59
+ - Fix call check when opts contains :message instead of :pretty_message.
60
+
61
+ ## 1.2.0
62
+
63
+ - Added support for verifying `T::Enumerable` types.
64
+
65
+ ## 1.1.0
66
+
67
+ - Add basic `instance_double` verification to help check the type of an instance double.
68
+
69
+ ## 1.0.0
70
+
71
+ - Initial release
72
+ - Supports just allowing instance doubles for now
data/Gemfile CHANGED
@@ -1,25 +1,24 @@
1
- source 'https://rubygems.org'
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
2
4
 
3
5
  # Specify your gem's dependencies in rspec-sorbet.gemspec
4
6
  gemspec
5
7
 
6
8
  group :development, :test do
7
- gem 'guard-livereload', require: false
8
- gem 'guard-rspec'
9
- gem 'pry-byebug'
10
- gem 'rb-fsevent', require: false
11
- gem 'rb-readline'
12
- gem 'reek'
13
- gem 'rspec'
14
- gem 'rubocop-rspec'
15
- gem 'rubocop'
16
- gem 'shoulda-matchers', require: false
17
- gem 'sqlite3'
18
- gem 'stackprof'
19
- gem 'timecop'
9
+ gem "guard-livereload", require: false
10
+ gem "guard-rspec"
11
+ gem "pry-byebug"
12
+ gem "rb-fsevent", require: false
13
+ gem "rspec"
14
+ gem "rubocop-rspec"
15
+ gem "rubocop-shopify"
16
+ gem "rubocop"
17
+ gem "stackprof"
18
+ gem "tapioca"
20
19
  end
21
20
 
22
21
  group :test do
23
- gem 'ffaker'
24
- gem 'simplecov'
22
+ gem "ffaker"
23
+ gem "rspec-github", require: false
25
24
  end
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ![rspec-sorbet](https://user-images.githubusercontent.com/2643026/63100456-02c12c00-bf6f-11e9-8430-630a27bc6e42.png)
2
2
 
3
- # RSpec Sorbet [![Gem Version](https://badge.fury.io/rb/rspec-sorbet.svg)](https://badge.fury.io/rb/rspec-sorbet) ![CI Badge](https://github.com/tricycle/rspec-sorbet/workflows/Continuous%20Integration/badge.svg)
3
+ # RSpec Sorbet [![Gem Version](https://badge.fury.io/rb/rspec-sorbet.svg)](https://badge.fury.io/rb/rspec-sorbet) ![CI Badge](https://github.com/samuelgiles/rspec-sorbet/workflows/Continuous%20Integration/badge.svg)
4
4
 
5
5
  A small gem consisting of helpers for using Sorbet & RSpec together.
6
6
 
@@ -19,7 +19,7 @@ require 'rspec/sorbet'
19
19
 
20
20
  Out of the box if you're using `instance_double`, `class_double` or `object_double` in your specs you'll encounter errors such as the following:
21
21
 
22
- ```
22
+ ```ruby
23
23
  TypeError:
24
24
  Parameter 'my_parameter': Expected type MyObject, got type RSpec::Mocks::InstanceVerifyingDouble with value #<InstanceDouble(MyObject) (anonymous)>
25
25
  Caller: /Users/samuelgiles/Documents/Projects/Clients/Bellroy/bellroy/spec/lib/checkout/use_cases/my_use_case.rb:9
@@ -33,4 +33,17 @@ RSpec::Sorbet.allow_doubles!
33
33
 
34
34
  ### `eq` matcher usage with `T::Struct`'s
35
35
 
36
- Using the [`eq` matcher](https://www.rubydoc.info/github/rspec/rspec-expectations/RSpec%2FMatchers:eq) to compare [`T::Struct`'s](https://sorbet.org/docs/tstruct) might not behave as you'd expect whereby two separate instances of the same struct class with identical attributes are not `==` out of the box. The standalone [sorbet-struct-comparable](https://github.com/tricycle/sorbet-struct-comparable) gem may be of interest if you are looking for a simple attribute based comparison that will help make the `eq` matcher behave as you expect.
36
+ Using the [`eq` matcher](https://www.rubydoc.info/github/rspec/rspec-expectations/RSpec%2FMatchers:eq) to compare [`T::Struct`'s](https://sorbet.org/docs/tstruct) might not behave as you'd expect whereby two separate instances of the same struct class with identical attributes are not `==` out of the box. The standalone [sorbet-struct-comparable](https://github.com/samuelgiles/sorbet-struct-comparable) gem may be of interest if you are looking for a simple attribute based comparison that will help make the `eq` matcher behave as you expect.
37
+
38
+ ### Specifying a custom validation handler
39
+
40
+ You can customise the handler of Sorbet validation errors if you so desire.
41
+
42
+
43
+ ```ruby
44
+ def handler(signature, opts)
45
+ raise MyCustomException, "The options were #{opts}"
46
+ end
47
+
48
+ T::Configuration.call_validation_error_handler = handler
49
+ ```
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
4
  require "rspec/core/rake_task"
3
5
 
4
6
  RSpec::Core::RakeTask.new(:spec)
5
7
 
6
- task :default => :spec
8
+ task default: :spec
data/bin/console CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- require 'bundler/setup'
4
- require 'rspec/sorbet'
4
+ require "bundler/setup"
5
+ require "rspec/sorbet"
5
6
 
6
7
  # You can add fixtures and/or initialization code here to make experimenting
7
8
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +11,5 @@ require 'rspec/sorbet'
10
11
  # require "pry"
11
12
  # Pry.start
12
13
 
13
- require 'irb'
14
+ require "irb"
14
15
  IRB.start(__FILE__)
data/bin/rbi ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bin/tapioca gems rspec-core rspec-expectations rspec-github rspec-support rspec
data/bin/rspec ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rspec' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
+
13
+ bundle_binstub = File.expand_path("bundle", __dir__)
14
+
15
+ if File.file?(bundle_binstub)
16
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
17
+ load(bundle_binstub)
18
+ else
19
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
+ end
22
+ end
23
+
24
+ require "rubygems"
25
+ require "bundler/setup"
26
+
27
+ load Gem.bin_path("rspec-core", "rspec")
data/bin/rubocop ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rubocop' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
+
13
+ bundle_binstub = File.expand_path("bundle", __dir__)
14
+
15
+ if File.file?(bundle_binstub)
16
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
17
+ load(bundle_binstub)
18
+ else
19
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
+ end
22
+ end
23
+
24
+ require "rubygems"
25
+ require "bundler/setup"
26
+
27
+ load Gem.bin_path("rubocop", "rubocop")
data/bin/setup CHANGED
@@ -4,5 +4,3 @@ IFS=$'\n\t'
4
4
  set -vx
5
5
 
6
6
  bundle install
7
-
8
- # Do any other automated setup that you need to do here
data/bin/tapioca ADDED
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'tapioca' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path(
13
+ "../../Gemfile",
14
+ Pathname.new(__FILE__).realpath,
15
+ )
16
+
17
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
18
+
19
+ if File.file?(bundle_binstub)
20
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
21
+ load(bundle_binstub)
22
+ else
23
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
24
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
25
+ end
26
+ end
27
+
28
+ require "rubygems"
29
+ require "bundler/setup"
30
+
31
+ load Gem.bin_path("tapioca", "tapioca")
@@ -1,35 +1,35 @@
1
1
  # typed: true
2
2
  # frozen_string_literal: true
3
3
 
4
- BASE_FOLDER_PATH = 'rspec'
4
+ BASE_FOLDER_PATH = "rspec"
5
5
 
6
6
  def directories_in(root)
7
7
  Dir.entries(root).sort.select do |entry|
8
8
  fully_qualified_entry = File.join(root, entry)
9
- File.directory?(fully_qualified_entry) && !['.', '..'].include?(entry.to_s)
9
+ File.directory?(fully_qualified_entry) && ![".", ".."].include?(entry.to_s)
10
10
  end
11
11
  end
12
12
 
13
13
  def files_in(root)
14
14
  Dir.entries(root).sort.reject do |entry|
15
15
  fully_qualified_entry = File.join(root, entry)
16
- File.directory?(fully_qualified_entry) || entry.to_s == 'all.rb' || entry[-3..-1] != '.rb'
16
+ File.directory?(fully_qualified_entry) || entry.to_s == "all.rb" || entry[-3..-1] != ".rb"
17
17
  end
18
18
  end
19
19
 
20
20
  def recursive_files_in(root)
21
- full_paths = Dir.glob(File.join(root, '**', '*')).sort.reject do |entry|
21
+ full_paths = Dir.glob(File.join(root, "**", "*")).sort.reject do |entry|
22
22
  fully_qualified_entry = File.join(root, entry)
23
- File.directory?(fully_qualified_entry) || entry[-7..-1] == '/all.rb' || entry[-3..-1] != '.rb'
23
+ File.directory?(fully_qualified_entry) || entry[-7..-1] == "/all.rb" || entry[-3..-1] != ".rb"
24
24
  end
25
25
 
26
- remove_path = root.split('/')[0..-2].join('/') + '/'
27
- full_paths.map { |full_path| full_path.gsub(remove_path, '') }
26
+ remove_path = root.split("/")[0..-2].join("/") + "/"
27
+ full_paths.map { |full_path| full_path.gsub(remove_path, "") }
28
28
  end
29
29
 
30
30
  def write_require_file(root, require_directories, require_files)
31
- require_file_path = File.join(root, 'all.rb')
32
- File.open(require_file_path, 'w') do |file|
31
+ require_file_path = File.join(root, "all.rb")
32
+ File.open(require_file_path, "w") do |file|
33
33
  file.write("# frozen_string_literal: true\n\n")
34
34
  file.write("# THIS FILE IS AUTOGENERATED AND SHOULD NOT BE MANUALLY MODIFIED\n\n")
35
35
  require_directories.each do |require_directory|
@@ -40,7 +40,7 @@ def write_require_file(root, require_directories, require_files)
40
40
  end
41
41
  end
42
42
 
43
- root = File.join(__dir__, 'lib', BASE_FOLDER_PATH)
43
+ root = File.join(__dir__, "lib", BASE_FOLDER_PATH)
44
44
  directories = directories_in(root)
45
45
  write_require_file(root, directories, files_in(root))
46
46
  directories.each do |directory|
data/lib/rspec/all.rb CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  # THIS FILE IS AUTOGENERATED AND SHOULD NOT BE MANUALLY MODIFIED
5
5
 
6
- require 'rspec/sorbet/all'
6
+ require "rspec/sorbet/all"
7
7
 
8
- require 'rspec/sorbet'
8
+ require "rspec/sorbet"
@@ -3,5 +3,5 @@
3
3
 
4
4
  # THIS FILE IS AUTOGENERATED AND SHOULD NOT BE MANUALLY MODIFIED
5
5
 
6
- require 'rspec/sorbet/doubles'
7
- require 'rspec/sorbet/version'
6
+ require "rspec/sorbet/doubles"
7
+ require "rspec/sorbet/version"