rbs 3.1.2 → 3.1.3

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: 7b7971d4b64c169d220fe2c0895630a36ebc6505b68689fba0660be24bcd24c0
4
- data.tar.gz: 2f6b8a68c5817d25c3ba179eb3965751f0b406c7dcf2d0812fe41d96bbac6e7c
3
+ metadata.gz: 3eecea95d764201e888ed754df209a3c948d8f703bc31453f53dcef86690ac35
4
+ data.tar.gz: 43d8c75f856ca9d9790b5ef451407dc9a9ea21c8dec48708cc425633f1faaa2a
5
5
  SHA512:
6
- metadata.gz: 4647a2dce17379807dae65a355d0fb2174d18062dbeb98d51c0c06f125d19d665ff32e3528c7326925ba11abed838b0ffff35e3708a25931fa1c4ea8c25d5eae
7
- data.tar.gz: 68e20554c2941971aa99015343ef59768a653ed23fc0d6b59eeb64223dff56e8c0aa61846402f28d5f8f9e5ce33763e116cdf08cb8ca9dcfb07177d1eeab9d68
6
+ metadata.gz: 7ae9f227f01d1ffe6ec4a8653eac72a83394300e8674d70694ee31abdc2bea71371d07652c9557e5721a352ecb7b063b9373b8589ab9caa2e1513a71809fb790
7
+ data.tar.gz: ae92f774b5f1f1992cb2f6f364205e10e6044e761e68fee7356f1836e352c4f5519d1039fe2ecdd14dc88e70d0f8a276da52775f171def6214f0db9e29a23541
data/CHANGELOG.md CHANGED
@@ -2,33 +2,41 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 3.1.3 (2023-07-31)
6
+
7
+ ### Library changes
8
+
9
+ #### rbs collection
10
+
11
+ * Generate gem specific sources in lockfile (Backport [#1402](https://github.com/ruby/rbs/pull/1402))
12
+
5
13
  ## 3.1.2 (2023-07-27)
6
14
 
7
15
  ⚠️ Note that this patch level release may report additional validation errors that is caused by fix of type name resolution ([#1373](https://github.com/ruby/rbs/pull/1373)).
8
16
 
9
17
  ### Library changes
10
18
 
11
- * Make `TypeNameResolver` more compatible with Ruby ([#1373](https://github.com/ruby/rbs/pull/1373))
12
- * Fix module alias normalizations ([#1393](https://github.com/ruby/rbs/pull/1393))
19
+ * Make `TypeNameResolver` more compatible with Ruby (Backport [#1373](https://github.com/ruby/rbs/pull/1373))
20
+ * Fix module alias normalizations (Backport [#1393](https://github.com/ruby/rbs/pull/1393))
13
21
 
14
22
  ## 3.1.1 (2023-07-18)
15
23
 
16
24
  ### Signature updates
17
25
 
18
- * Removed `GC.verify_transient_heap_internal_consistency` ([#1374](https://github.com/ruby/rbs/pull/1374))
26
+ * Removed `GC.verify_transient_heap_internal_consistency` (Backport [#1374](https://github.com/ruby/rbs/pull/1374))
19
27
 
20
28
  ### Library changes
21
29
 
22
- * Relax rdoc version requirement in RDoc plugin ([#1333](https://github.com/ruby/rbs/pull/1333))
30
+ * Relax rdoc version requirement in RDoc plugin (Backport [#1333](https://github.com/ruby/rbs/pull/1333))
23
31
 
24
32
  #### rbs collection
25
33
 
26
- * Spec may be missing when rbs_collection.yaml declares dependency ([#1378](https://github.com/ruby/rbs/pull/1378))
34
+ * Spec may be missing when rbs_collection.yaml declares dependency (Backport [#1378](https://github.com/ruby/rbs/pull/1378))
27
35
 
28
36
  ### Miscellaneous
29
37
 
30
- * Handle connection error with Resolv_test.rb ([#1356](https://github.com/ruby/rbs/pull/1356))
31
- * Fix broken CI ([#1353](https://github.com/ruby/rbs/pull/1353))
38
+ * Handle connection error with Resolv_test.rb (Backport [#1356](https://github.com/ruby/rbs/pull/1356))
39
+ * Fix broken CI (Backport [#1353](https://github.com/ruby/rbs/pull/1353))
32
40
 
33
41
  ## 3.1.0 (2023-04-26)
34
42
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbs (3.1.2)
4
+ rbs (3.1.3)
5
5
 
6
6
  PATH
7
7
  remote: test/assets/test-gem
@@ -20,7 +20,7 @@ module RBS
20
20
  end
21
21
  end
22
22
 
23
- attr_reader :config, :lockfile, :definition, :existing_lockfile, :gem_hash
23
+ attr_reader :config, :lockfile, :definition, :existing_lockfile, :gem_hash, :gem_entries
24
24
 
25
25
  def self.generate(config:, definition:, with_lockfile: true)
26
26
  generator = new(config: config, definition: definition, with_lockfile: with_lockfile)
@@ -31,6 +31,11 @@ module RBS
31
31
  def initialize(config:, definition:, with_lockfile:)
32
32
  @config = config
33
33
 
34
+ @gem_entries = config.gems.each.with_object({}) do |entry, hash| #$ Hash[String, gem_entry?]
35
+ name = entry["name"]
36
+ hash[name] = entry
37
+ end
38
+
34
39
  lockfile_path = Config.to_lockfile_path(config.config_path)
35
40
  lockfile_dir = lockfile_path.parent
36
41
 
@@ -58,15 +63,13 @@ module RBS
58
63
  end
59
64
 
60
65
  def generate
61
- ignored_gems = config.gems.select {|gem| gem["ignore"] }.map {|gem| gem["name"] }.to_set
62
-
63
66
  config.gems.each do |gem|
64
67
  if Sources::Stdlib.instance.has?(gem["name"], nil) || gem.dig("source", "type") == "stdlib"
65
- unless ignored_gems.include?(gem["name"])
68
+ unless gem.fetch("ignore", false)
66
69
  assign_stdlib(name: gem["name"], from_gem: nil)
67
70
  end
68
71
  else
69
- assign_gem(name: gem["name"], version: gem["version"], ignored_gems: ignored_gems, src_data: gem["source"])
72
+ assign_gem(name: gem["name"], version: gem["version"])
70
73
  end
71
74
  end
72
75
 
@@ -76,7 +79,7 @@ module RBS
76
79
  end
77
80
 
78
81
  if spec = gem_hash[dep.name]
79
- assign_gem(name: dep.name, version: spec.version, ignored_gems: ignored_gems, src_data: nil, skip: dep.source.is_a?(Bundler::Source::Gemspec))
82
+ assign_gem(name: dep.name, version: spec.version, skip: dep.source.is_a?(Bundler::Source::Gemspec))
80
83
  end
81
84
  end
82
85
 
@@ -91,8 +94,12 @@ module RBS
91
94
  end
92
95
  end
93
96
 
94
- private def assign_gem(name:, version:, src_data:, ignored_gems:, skip: false)
95
- return if ignored_gems.include?(name)
97
+ private def assign_gem(name:, version:, skip: false)
98
+ entry = gem_entries[name]
99
+ src_data = entry&.fetch("source", nil)
100
+ ignored = entry&.fetch("ignore", false)
101
+
102
+ return if ignored
96
103
  return if lockfile.gems.key?(name)
97
104
 
98
105
  unless skip
@@ -136,7 +143,7 @@ module RBS
136
143
  if spec = gem_hash.fetch(name, nil)
137
144
  spec.dependencies.each do |dep|
138
145
  if dep_spec = gem_hash[dep.name]
139
- assign_gem(name: dep.name, version: dep_spec.version, src_data: nil, ignored_gems: ignored_gems)
146
+ assign_gem(name: dep.name, version: dep_spec.version)
140
147
  end
141
148
  end
142
149
  else
data/lib/rbs/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RBS
4
- VERSION = "3.1.2"
4
+ VERSION = "3.1.3"
5
5
  end
@@ -22,6 +22,9 @@ module RBS
22
22
  # A hash table to look up a spec from name of the gem
23
23
  attr_reader gem_hash: Hash[String, Bundler::LazySpecification]
24
24
 
25
+ # A hash table to look up a gem entry in collection config from the name of the gem
26
+ attr_reader gem_entries: Hash[String, gem_entry?]
27
+
25
28
  def self.generate: (config: Config, definition: Bundler::Definition, ?with_lockfile: boolish) -> Lockfile
26
29
 
27
30
  def initialize: (config: Config, definition: Bundler::Definition, with_lockfile: boolish) -> void
@@ -38,7 +41,7 @@ module RBS
38
41
  #
39
42
  # * If `skip:` is true, it skips adding the gem, but adds it's dependencies.
40
43
  #
41
- def assign_gem: (name: String, version: String?, src_data: Sources::source_entry?, ignored_gems: Set[String], ?skip: bool) -> void
44
+ def assign_gem: (name: String, version: String?, ?skip: bool) -> void
42
45
 
43
46
  def assign_stdlib: (name: String, from_gem: String?) -> void
44
47
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-27 00:00:00.000000000 Z
11
+ date: 2023-07-31 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: RBS is the language for type signatures for Ruby and standard library
14
14
  definitions.