rspec-sorbet-types 0.1.0 → 0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a22cc57159bb8fcf6011e4f526f04da73e7cb0c6a0f8ba2be14b2fda79f1a516
4
- data.tar.gz: 7d4cd90ee0792e2b7bd2c8aa64348b8ec2006f57133774d5d6606518a93b3604
3
+ metadata.gz: 38115893c2185828951d0b6afce7710c0a9999999a6abec57496f1e97a9723b9
4
+ data.tar.gz: e9fb71bee0b47caae7500716f2e3c45d888e010607272a520c92916391a2bce6
5
5
  SHA512:
6
- metadata.gz: 4f8dea02beb1c65684aa54552cbfa96b8d7335d1da3f36c866b6fba677f88e9debe451f836c633e4053700768de559449266599bb42e9974b641f8034744245f
7
- data.tar.gz: 80b33d85703d7b9ebdcc0e8f37c8f3ce7718af361413a2491731895fa6c44825634a5a2e17318ed65a3950c77b156d75c3361cc925b82034d3732799a0e962db
6
+ metadata.gz: 99b1a3ee08b1a3b24d1c04c6e2349c00ee8005eb88de4e58546b8fc77b607278fa2aadb7e1fed4b9c7d03253703591c11b3dbb767de0d52eae225484c39a6b4d
7
+ data.tar.gz: 27af9e068c9ff987364d5bb8d65aaf43e35af38651520d6a4a426d9defe0a94677a1e4d0c42a023ce441f4262b389904673297add2ba93ae67192a1e83c37cff
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ module RSpec
5
+ module Sorbet
6
+ module Types
7
+ VERSION_STRING = "0.3.0"
8
+ end
9
+ end
10
+ end
@@ -1,2 +1,6 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
1
4
  require "sorbet-runtime"
2
5
  require_relative "types/sig"
6
+ require_relative "types/version"
@@ -21,16 +21,31 @@ module Tapioca
21
21
 
22
22
  private
23
23
 
24
+ sig { void }
25
+ def add_spec_dir_to_load_path!
26
+ $LOAD_PATH.unshift(spec_dir)
27
+ end
28
+
24
29
  sig { void }
25
30
  def require_spec_files!
26
- Dir.glob(spec_glob).each do |file|
27
- require(file)
31
+ Dir.glob(spec_glob, base: spec_dir).each do |path|
32
+ require(strip_rb_suffix(path))
28
33
  end
29
34
  end
30
35
 
36
+ sig { returns(String) }
37
+ def spec_dir
38
+ ENV["SORBET_RSPEC_DIR"] || File.join(Dir.pwd, "spec")
39
+ end
40
+
31
41
  sig { returns(String) }
32
42
  def spec_glob
33
- ENV["SORBET_RSPEC_GLOB"] || File.join(".", "spec", "**", "*.rb")
43
+ ENV["SORBET_RSPEC_GLOB"] || File.join("**", "*.rb")
44
+ end
45
+
46
+ sig { params(path: T.any(String, Pathname)).returns(String) }
47
+ def strip_rb_suffix(path)
48
+ path.sub(/\.rb$/, "").to_s
34
49
  end
35
50
  end
36
51
 
@@ -38,6 +53,7 @@ module Tapioca
38
53
  ENV["SORBET_RSPEC_TYPES_COMPILING"] = "1"
39
54
 
40
55
  # Load all spec files during compiler definition
56
+ add_spec_dir_to_load_path!
41
57
  require_spec_files!
42
58
 
43
59
  sig { override.void }
data/rbi/rspec-core.rbi CHANGED
@@ -6,11 +6,11 @@ module RSpec
6
6
  sig do
7
7
  params(
8
8
  args: T.untyped,
9
- example_group_block: T.proc.bind(T.class_of(RSpec::Core::ExampleGroup)).void,
9
+ example_group_block: T.proc.bind(T.class_of(RSpec::Core::ExampleGroup)).void
10
10
  ).void
11
11
  end
12
-
13
- def describe(*args, &example_group_block); end
12
+ def describe(*args, &example_group_block)
13
+ end
14
14
  end
15
15
  end
16
16
 
@@ -22,46 +22,46 @@ class RSpec::Core::ExampleGroup
22
22
  sig do
23
23
  params(
24
24
  all_args: T.untyped,
25
- block: T.proc.bind(RSpec::Core::ExampleGroup).void,
25
+ block: T.proc.bind(RSpec::Core::ExampleGroup).void
26
26
  ).void
27
27
  end
28
-
29
- def it(*all_args, &block); end
28
+ def it(*all_args, &block)
29
+ end
30
30
 
31
31
  sig do
32
32
  params(
33
33
  all_args: T.untyped,
34
- block: T.proc.bind(RSpec::Core::ExampleGroup).void,
34
+ block: T.proc.bind(RSpec::Core::ExampleGroup).void
35
35
  ).void
36
36
  end
37
-
38
- def specify(*all_args, &block); end
37
+ def specify(*all_args, &block)
38
+ end
39
39
 
40
40
  sig do
41
41
  params(
42
42
  args: T.untyped,
43
- block: T.proc.bind(RSpec::Core::ExampleGroup).void,
43
+ block: T.proc.bind(RSpec::Core::ExampleGroup).void
44
44
  ).void
45
45
  end
46
-
47
- def before(*args, &block); end
46
+ def before(*args, &block)
47
+ end
48
48
 
49
49
  sig do
50
50
  params(
51
51
  args: T.untyped,
52
- block: T.proc.bind(RSpec::Core::ExampleGroup).void,
52
+ block: T.proc.bind(RSpec::Core::ExampleGroup).void
53
53
  ).void
54
54
  end
55
-
56
- def after(*args, &block); end
55
+ def after(*args, &block)
56
+ end
57
57
 
58
58
  sig do
59
59
  params(
60
60
  args: T.untyped,
61
- block: T.proc.bind(RSpec::Core::ExampleGroup).void,
61
+ block: T.proc.bind(RSpec::Core::ExampleGroup).void
62
62
  ).void
63
63
  end
64
-
65
- def around(*args, &block); end
64
+ def around(*args, &block)
65
+ end
66
66
  end
67
67
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-sorbet-types
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hongli Lai
@@ -62,14 +62,15 @@ extra_rdoc_files: []
62
62
  files:
63
63
  - lib/rspec/sorbet/types.rb
64
64
  - lib/rspec/sorbet/types/sig.rb
65
+ - lib/rspec/sorbet/types/version.rb
65
66
  - lib/tapioca/dsl/compilers/rspec.rb
66
67
  - rbi/rspec-core.rbi
67
- homepage: https://github.com/FooBarWidget/sorbet-rspec
68
+ homepage: https://github.com/FooBarWidget/rspec-sorbet-types
68
69
  licenses:
69
70
  - MIT
70
71
  metadata:
71
- homepage_uri: https://github.com/FooBarWidget/sorbet-rspec
72
- source_code_uri: https://github.com/FooBarWidget/sorbet-rspec
72
+ homepage_uri: https://github.com/FooBarWidget/rspec-sorbet-types
73
+ source_code_uri: https://github.com/FooBarWidget/rspec-sorbet-types
73
74
  post_install_message:
74
75
  rdoc_options: []
75
76
  require_paths:
@@ -85,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
86
  - !ruby/object:Gem::Version
86
87
  version: '0'
87
88
  requirements: []
88
- rubygems_version: 3.5.3
89
+ rubygems_version: 3.5.22
89
90
  signing_key:
90
91
  specification_version: 4
91
92
  summary: Sorbet integration for RSpec