tapioca 0.11.7 → 0.11.8

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: 68b1a51d995ed5925df2983b0fdc55ef14bdfb828780077035048f1a6305ad74
4
- data.tar.gz: 9689fa2965d90459e47618b2d41df0e24acdb9599d3552205ed973fa37126c9b
3
+ metadata.gz: 2e1d35be8426874dde08ba495772d5076d85167f24fa5cfa16b59f424ca3c820
4
+ data.tar.gz: ce7b53d0399658d9ecfdcda6e42f030b2316bfcd75c3c02ee018dbab966bce30
5
5
  SHA512:
6
- metadata.gz: 78cfdeb935bd82157c0f98344af6e131f5c5d0b256076ac69b1518f044f08ace764cfe7efe153928c7209a451ce194ae7d2ac82cebf68c1aed937b3016ba6cb3
7
- data.tar.gz: d51e8ca0aafb1764efa553387d2569aec765c0eb6d5ac8344843b131d75fa6b2daa5bca6daa4304229eb6313ef244752fb1ec66c2c10d5868ee8983174bf5f3e
6
+ metadata.gz: 6dd882c66362cc1666f9e89a9634c38b3131fba7a10b0c5fabe19f5675e98adf308132b07c09b3f62d3035f4fc7ab05f36693de13cb74701324aee3933c43234
7
+ data.tar.gz: 74f78ab7a8d5f284b4a1efbcb7eaf098d609294b3c201e227890d3f1276a5c689ee528b5a610a8a4039eaf549c1e0655c71da04631d62b174a16baf23e312bf4
@@ -58,7 +58,7 @@ module Tapioca
58
58
  # value will be `[]`. But, we want those gems to be loaded for our
59
59
  # purposes as well, so we return `nil` in those cases, instead, which
60
60
  # means `require: true`.
61
- return nil if value == []
61
+ return if value == []
62
62
 
63
63
  value
64
64
  end
@@ -98,7 +98,7 @@ module Tapioca
98
98
  def fetch_index(repo_uri, repo_number:)
99
99
  say("Retrieving index from central repository#{repo_number ? " ##{repo_number}" : ""}... ", [:blue, :bold])
100
100
  content = fetch_file(repo_uri, CENTRAL_REPO_INDEX_PATH)
101
- return nil unless content
101
+ return unless content
102
102
 
103
103
  index = RepoIndex.from_json(content)
104
104
  say("Done", :green)
@@ -221,7 +221,7 @@ module Tapioca
221
221
 
222
222
  sig { params(gem_name: String, contents: T::Array[String]).returns(T.nilable(String)) }
223
223
  def merge_files(gem_name, contents)
224
- return nil if contents.empty?
224
+ return if contents.empty?
225
225
 
226
226
  rewriter = RBI::Rewriters::Merge.new(keep: RBI::Rewriters::Merge::Keep::NONE)
227
227
 
@@ -260,16 +260,16 @@ module Tapioca
260
260
 
261
261
  sig { params(repo_uri: String).returns(T.nilable(String)) }
262
262
  def token_for(repo_uri)
263
- return nil unless @netrc_info
263
+ return unless @netrc_info
264
264
 
265
265
  host = URI(repo_uri).host
266
- return nil unless host
266
+ return unless host
267
267
 
268
268
  creds = @netrc_info[host]
269
- return nil unless creds
269
+ return unless creds
270
270
 
271
271
  token = creds.to_a.last
272
- return nil unless token
272
+ return unless token
273
273
 
274
274
  "token #{token}"
275
275
  end
@@ -250,27 +250,21 @@ module Tapioca
250
250
  value_type = type_of(value)
251
251
  type = "Google::Protobuf::Map[#{key_type}, #{value_type}]"
252
252
 
253
- default_args = [key.type.inspect, value.type.inspect]
254
- default_args << value_type if [:enum, :message].include?(value.type)
255
-
256
253
  Field.new(
257
254
  name: descriptor.name,
258
255
  type: type,
259
256
  init_type: "T.nilable(T.any(#{type}, T::Hash[#{key_type}, #{value_type}]))",
260
- default: "Google::Protobuf::Map.new(#{default_args.join(", ")})",
257
+ default: "T.unsafe(nil)",
261
258
  )
262
259
  else
263
260
  elem_type = type_of(descriptor)
264
261
  type = "Google::Protobuf::RepeatedField[#{elem_type}]"
265
262
 
266
- default_args = [descriptor.type.inspect]
267
- default_args << elem_type if [:enum, :message].include?(descriptor.type)
268
-
269
263
  Field.new(
270
264
  name: descriptor.name,
271
265
  type: type,
272
266
  init_type: "T.nilable(T.any(#{type}, T::Array[#{elem_type}]))",
273
- default: "Google::Protobuf::RepeatedField.new(#{default_args.join(", ")})",
267
+ default: "T.unsafe(nil)",
274
268
  )
275
269
  end
276
270
  else
@@ -31,8 +31,8 @@ module Tapioca
31
31
 
32
32
  sig { params(options: T::Hash[Symbol, T.untyped]).returns(T.nilable(String)) }
33
33
  def netrc_file(options)
34
- return nil if options[:auth]
35
- return nil unless options[:netrc]
34
+ return if options[:auth]
35
+ return unless options[:netrc]
36
36
 
37
37
  options[:netrc_file] || ENV["TAPIOCA_NETRC_FILE"] || File.join(ENV["HOME"].to_s, ".netrc")
38
38
  end
@@ -29,7 +29,9 @@ module Tapioca
29
29
 
30
30
  module Forking
31
31
  extend T::Sig
32
- include Kernel
32
+ extend T::Helpers
33
+
34
+ requires_ancestor { Kernel }
33
35
 
34
36
  sig { params(_blk: T.untyped).returns(String) }
35
37
  def run_in_isolation(&_blk)
@@ -72,7 +74,10 @@ module Tapioca
72
74
 
73
75
  module Subprocess
74
76
  extend T::Sig
75
- include Kernel
77
+ extend T::Helpers
78
+
79
+ requires_ancestor { Kernel }
80
+
76
81
  ORIG_ARGV = T.let(ARGV.dup, T::Array[T.untyped]) unless defined?(ORIG_ARGV)
77
82
 
78
83
  # Crazy H4X to get this working in windows / jruby with
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Tapioca
5
- VERSION = "0.11.7"
5
+ VERSION = "0.11.8"
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.7
4
+ version: 0.11.8
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-06-23 00:00:00.000000000 Z
14
+ date: 2023-07-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -283,7 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
283
283
  - !ruby/object:Gem::Version
284
284
  version: '0'
285
285
  requirements: []
286
- rubygems_version: 3.4.14
286
+ rubygems_version: 3.4.16
287
287
  signing_key:
288
288
  specification_version: 4
289
289
  summary: A Ruby Interface file generator for gems, core types and the Ruby standard