tapioca 0.11.2 → 0.11.4

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: f19238941e4e663cef8326fc3cd46a9e9fb80b19130b676509d17e9081881fea
4
- data.tar.gz: aa1db65b32badf4df8937a9d6566ac409b788cc746c714b40f5f7f0098cd062c
3
+ metadata.gz: 97f174e338dbb90c09c1771832fa2ac9883a7bd0ed12a63db26d43d99f899c67
4
+ data.tar.gz: 4bd1517cba1b4e7883f828250a647ba1ec9eadf00a4065994a74418d100f1029
5
5
  SHA512:
6
- metadata.gz: ba99ab5d35eb0d88cd671370bfbee1e73b72e1a6828c083915c32ed36d7142291b93b79d9258cca9a7bd7d41fcf31770f00865c12c0fe5395cba0d439b9bd850
7
- data.tar.gz: 93d5fa3abba74e8919415d494bf47416a36721f4689d5ce893831b39cf4a8f00ca1f9d9c3500fcd70fa574fe2230d9aca6f743bf4c9642817ce969bbbdb6c431
6
+ metadata.gz: e07bc3e08067de7327b0a05dff6fbe07ad9cf488cc57bc23111ee8a0834276b508ee90f0f0613224241eefe2d3f15abd0f9abb16387754e35fa89229dd7a25f1
7
+ data.tar.gz: edce4b934a9f58ae032c93f1585c50f7dd845045503d03333ba437b8fd1d4c5105d488bf032ae7005080de74005bed22ede14c21896267cd6e5437745bf00d90
@@ -343,6 +343,8 @@ module Tapioca
343
343
  #{set_color("RBI files are out-of-date. In your development environment, please run:", :green)}
344
344
  #{set_color("`#{default_command(command)}`", :green, :bold)}
345
345
  #{set_color("Once it is complete, be sure to commit and push any changes", :green)}
346
+ If you don't observe any changes after running the command locally, ensure your database is in a good
347
+ state e.g. run `bin/rails db:reset`
346
348
 
347
349
  #{set_color("Reason:", :red)}
348
350
  #{reasons}
@@ -69,10 +69,10 @@ module Tapioca
69
69
  "::String"
70
70
  when ActiveRecord::Type::Serialized
71
71
  serialized_column_type(column_type)
72
- when defined?(ActiveRecord::ConnectionAdapters::PostgreSQL) &&
72
+ when defined?(ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Hstore) &&
73
73
  ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Hstore
74
74
  "T::Hash[::String, ::String]"
75
- when defined?(ActiveRecord::ConnectionAdapters::PostgreSQL) &&
75
+ when defined?(ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Array) &&
76
76
  ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Array
77
77
  "T::Array[#{type_for_activerecord_value(column_type.subtype)}]"
78
78
  else
data/lib/tapioca/dsl.rb CHANGED
@@ -2,6 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "rbi"
5
+ require "spoom"
5
6
 
6
7
  require "tapioca"
7
8
  require "tapioca/runtime/reflection"
@@ -105,14 +105,13 @@ module Tapioca
105
105
  sig { returns([T::Enumerable[Spec], T::Array[String]]) }
106
106
  def materialize_deps
107
107
  deps = definition.locked_gems.dependencies.values
108
- missing_specs = T::Array[String].new
109
- materialized_dependencies = if definition.resolve.method(:materialize).arity == 1 # Support bundler >= v2.2.25
110
- md = definition.resolve.materialize(deps)
111
- missing_spec_names = md.missing_specs.map(&:name)
112
- missing_specs = T.cast(md.missing_specs.map { |spec| "#{spec.name} (#{spec.version})" }, T::Array[String])
113
- md.to_a.reject { |spec| missing_spec_names.include?(spec.name) }
114
- else
115
- definition.resolve.materialize(deps, missing_specs)
108
+ materialized_dependencies = definition.resolve.materialize(deps)
109
+ missing_spec_names = materialized_dependencies.missing_specs.map(&:name).to_set
110
+ missing_specs = materialized_dependencies.missing_specs.map do |spec|
111
+ "#{spec.name} (#{spec.version})"
112
+ end
113
+ materialized_dependencies = materialized_dependencies.to_a.reject do |spec|
114
+ missing_spec_names.include?(spec.name)
116
115
  end
117
116
  [materialized_dependencies, missing_specs]
118
117
  end
@@ -10,7 +10,7 @@ module Tapioca
10
10
  app_dir = to_realpath(app_dir)
11
11
  full_gem_path = to_realpath(full_gem_path)
12
12
 
13
- !gem_in_bundle_path?(full_gem_path) && path_in_dir?(full_gem_path, app_dir)
13
+ !gem_in_bundle_path?(full_gem_path) && !gem_in_ruby_path?(full_gem_path) && path_in_dir?(full_gem_path, app_dir)
14
14
  end
15
15
 
16
16
  sig { params(full_gem_path: String).returns(T::Boolean) }
@@ -18,6 +18,11 @@ module Tapioca
18
18
  path_in_dir?(full_gem_path, Bundler.bundle_path) || path_in_dir?(full_gem_path, Bundler.app_cache)
19
19
  end
20
20
 
21
+ sig { params(full_gem_path: String).returns(T::Boolean) }
22
+ def gem_in_ruby_path?(full_gem_path)
23
+ path_in_dir?(full_gem_path, RbConfig::CONFIG["rubylibprefix"])
24
+ end
25
+
21
26
  sig { params(path: T.any(String, Pathname)).returns(String) }
22
27
  def to_realpath(path)
23
28
  path_string = path.to_s
@@ -19,6 +19,8 @@ module Tapioca
19
19
 
20
20
  SORBET_PAYLOAD_URL = "https://github.com/sorbet/sorbet/tree/master/rbi"
21
21
 
22
+ SPOOM_CONTEXT = T.let(Spoom::Context.new("."), Spoom::Context)
23
+
22
24
  FEATURE_REQUIREMENTS = T.let(
23
25
  {
24
26
  # feature_name: ::Gem::Requirement.new(">= ___"), # https://github.com/sorbet/sorbet/pull/___
@@ -29,7 +31,7 @@ module Tapioca
29
31
 
30
32
  sig { params(sorbet_args: String).returns(Spoom::ExecResult) }
31
33
  def sorbet(*sorbet_args)
32
- Spoom::Sorbet.srb(sorbet_args.join(" "), sorbet_bin: sorbet_path, capture_err: true)
34
+ SPOOM_CONTEXT.srb(sorbet_args.join(" "), sorbet_bin: sorbet_path)
33
35
  end
34
36
 
35
37
  sig { returns(String) }
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Tapioca
5
- VERSION = "0.11.2"
5
+ VERSION = "0.11.4"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tapioca
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.11.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ufuk Kayserilioglu
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2023-03-10 00:00:00.000000000 Z
14
+ date: 2023-03-31 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 1.17.3
22
+ version: 2.2.25
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 1.17.3
29
+ version: 2.2.25
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: netrc
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -95,20 +95,20 @@ dependencies:
95
95
  requirements:
96
96
  - - "~>"
97
97
  - !ruby/object:Gem::Version
98
- version: 1.1.0
98
+ version: 1.2.0
99
99
  - - ">="
100
100
  - !ruby/object:Gem::Version
101
- version: 1.1.11
101
+ version: 1.2.0
102
102
  type: :runtime
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
106
  - - "~>"
107
107
  - !ruby/object:Gem::Version
108
- version: 1.1.0
108
+ version: 1.2.0
109
109
  - - ">="
110
110
  - !ruby/object:Gem::Version
111
- version: 1.1.11
111
+ version: 1.2.0
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: thor
114
114
  requirement: !ruby/object:Gem::Requirement
@@ -281,7 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
281
281
  - !ruby/object:Gem::Version
282
282
  version: '0'
283
283
  requirements: []
284
- rubygems_version: 3.3.3
284
+ rubygems_version: 3.4.9
285
285
  signing_key:
286
286
  specification_version: 4
287
287
  summary: A Ruby Interface file generator for gems, core types and the Ruby standard