rbs-src 0.2.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -1
- data/README.md +2 -1
- data/Rakefile +1 -1
- data/Steepfile +0 -23
- data/lib/rbs/src/cli.rb +5 -5
- data/lib/rbs/src/command_runner.rb +17 -0
- data/lib/rbs/src/gem.rb +4 -1
- data/lib/rbs/src/version.rb +1 -1
- data/rbs_collection.lock.yaml +1 -41
- data/rbs_collection.yaml +0 -2
- data/sig/rbs/command_runner.rbs +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76ab3d8f7dcde911852a0703e6439f7d3169d96a232e75c7f59b96f82ab40f89
|
4
|
+
data.tar.gz: a0d55fd33ccdfe73ac01249761809ccbb8a5f0a0787b811bbc208c197c8219e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 790e7db58006f2d72714db5f74b50e7690184197da889bd2c0e02f3865f6ad9325a56c89d86c5904ea3971ac06254f810a2b3f0a62ec46fad085a5c8eda9ad0d
|
7
|
+
data.tar.gz: 4cfd4d0df57c79f8dd50c00299c003f603f564977714375113de22df482300b6364b43e6a0917f36a0c68411ffa735a76e0e4f4f85fffbf8aeb450bf2582ad17
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -54,7 +54,8 @@ target ... do
|
|
54
54
|
# Existing config...
|
55
55
|
|
56
56
|
# Add `#signature` call to support loading RBS files from symlinked directory
|
57
|
-
signature "sig/rbs-src
|
57
|
+
signature "sig/rbs-src/*/*.rbs"
|
58
|
+
signature "sig/rbs-src/*/[^_]*/**/*.rbs"
|
58
59
|
|
59
60
|
# Stop loading libraries through rbs-collection
|
60
61
|
disable_collection()
|
data/Rakefile
CHANGED
data/Steepfile
CHANGED
@@ -2,11 +2,9 @@ D = Steep::Diagnostic
|
|
2
2
|
|
3
3
|
target :lib do
|
4
4
|
signature "sig"
|
5
|
-
signature "sig/rbs-src/*/**/*.rbs"
|
6
5
|
|
7
6
|
check "lib" # Directory name
|
8
7
|
|
9
|
-
|
10
8
|
configure_code_diagnostics(D::Ruby.default) # `default` diagnostics setting (applies by default)
|
11
9
|
# configure_code_diagnostics(D::Ruby.strict) # `strict` diagnostics setting
|
12
10
|
# configure_code_diagnostics(D::Ruby.lenient) # `lenient` diagnostics setting
|
@@ -14,25 +12,4 @@ target :lib do
|
|
14
12
|
# configure_code_diagnostics do |hash| # You can setup everything yourself
|
15
13
|
# hash[D::Ruby::NoMethod] = :information
|
16
14
|
# end
|
17
|
-
|
18
|
-
library('abbrev')
|
19
|
-
library('date')
|
20
|
-
library('dbm')
|
21
|
-
library('json')
|
22
|
-
library('logger')
|
23
|
-
library('minitest')
|
24
|
-
library('monitor')
|
25
|
-
library('mutex_m')
|
26
|
-
library('optparse')
|
27
|
-
library('pathname')
|
28
|
-
library('pstore')
|
29
|
-
library('rbs:3.1.2')
|
30
|
-
library('rdoc')
|
31
|
-
library('securerandom')
|
32
|
-
library('singleton')
|
33
|
-
library('time')
|
34
|
-
library('tsort')
|
35
|
-
library('yaml')
|
36
|
-
|
37
|
-
disable_collection
|
38
15
|
end
|
data/lib/rbs/src/cli.rb
CHANGED
@@ -3,7 +3,7 @@ require "optparse"
|
|
3
3
|
module Rbs
|
4
4
|
module Src
|
5
5
|
class CLI
|
6
|
-
def self.start(argv)
|
6
|
+
def self.start(argv, stdout: STDOUT)
|
7
7
|
command = argv.shift
|
8
8
|
|
9
9
|
case command
|
@@ -45,7 +45,7 @@ module Rbs
|
|
45
45
|
rbs_prefix: rbs_prefix
|
46
46
|
)
|
47
47
|
|
48
|
-
runner = CommandRunner.new(stdout:
|
48
|
+
runner = CommandRunner.new(stdout: stdout)
|
49
49
|
|
50
50
|
runner.push "Setting up #{gem.name}-#{gem.version}" do
|
51
51
|
runner.push "Cloning git repository into #{gem.repository_root}" do
|
@@ -104,7 +104,7 @@ module Rbs
|
|
104
104
|
rbs_prefix: rbs_prefix
|
105
105
|
)
|
106
106
|
|
107
|
-
runner = CommandRunner.new(stdout:
|
107
|
+
runner = CommandRunner.new(stdout: stdout)
|
108
108
|
|
109
109
|
loader.each_gem do |gem, repo, commit|
|
110
110
|
runner.push "Setting up #{gem.name}-#{gem.version}" do
|
@@ -140,9 +140,9 @@ module Rbs
|
|
140
140
|
other_libs.sort_by! { _1[0] }
|
141
141
|
|
142
142
|
unless other_libs.empty?
|
143
|
-
runner.push "
|
143
|
+
runner.push "You have to load other libraries without rbs-collection:" do
|
144
144
|
if has_gem?("steep")
|
145
|
-
runner.puts "
|
145
|
+
runner.puts "Add the following lines in your Steepfile:"
|
146
146
|
|
147
147
|
other_libs.each do |name, version|
|
148
148
|
runner.puts " library('#{name}')"
|
@@ -37,6 +37,23 @@ module Rbs
|
|
37
37
|
raise status.inspect
|
38
38
|
end
|
39
39
|
end
|
40
|
+
|
41
|
+
def query!(*command, chdir: Pathname.pwd)
|
42
|
+
# @type var out: String
|
43
|
+
# @type var status: Process::Status
|
44
|
+
|
45
|
+
out, status = Open3.capture2e(*command, chdir: chdir)
|
46
|
+
|
47
|
+
unless status.success?
|
48
|
+
puts "🚨 Command failed: #{command.inspect} in #{chdir}..."
|
49
|
+
out.each_line do |line|
|
50
|
+
puts "| #{line}"
|
51
|
+
end
|
52
|
+
raise status.inspect
|
53
|
+
end
|
54
|
+
|
55
|
+
out
|
56
|
+
end
|
40
57
|
end
|
41
58
|
end
|
42
59
|
end
|
data/lib/rbs/src/gem.rb
CHANGED
@@ -25,7 +25,10 @@ module Rbs
|
|
25
25
|
|
26
26
|
def clone(runner, repository_url:, commit:)
|
27
27
|
runner.puts "git clone..."
|
28
|
-
runner.execute!("git", "clone", "--filter=blob:none", repository_url, repository_root.to_s)
|
28
|
+
runner.execute!("git", "clone", "--filter=blob:none", "--sparse", repository_url, repository_root.to_s)
|
29
|
+
dirs = runner.query!("git", "ls-tree", "-d", "--name-only", "-z", "HEAD", chdir: repository_root).split("\0")
|
30
|
+
dirs.delete(repository_dir.to_s)
|
31
|
+
runner.execute!("git", "sparse-checkout", "set", *dirs, repository_dir.join(name).to_s, chdir: repository_root)
|
29
32
|
if commit
|
30
33
|
runner.puts "git checkout..."
|
31
34
|
runner.execute!("git", "checkout", commit, chdir: repository_root)
|
data/lib/rbs/src/version.rb
CHANGED
data/rbs_collection.lock.yaml
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
sources:
|
3
3
|
- type: git
|
4
4
|
name: ruby/gem_rbs_collection
|
5
|
-
revision:
|
5
|
+
revision: '04470595f7a634757e160f61aafeb50536322bba'
|
6
6
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
7
7
|
repo_dir: gems
|
8
8
|
path: ".gem_rbs_collection"
|
@@ -11,38 +11,10 @@ gems:
|
|
11
11
|
version: '0'
|
12
12
|
source:
|
13
13
|
type: stdlib
|
14
|
-
- name: activesupport
|
15
|
-
version: '6.0'
|
16
|
-
source:
|
17
|
-
type: git
|
18
|
-
name: ruby/gem_rbs_collection
|
19
|
-
revision: aeede7258d020bfd509541e0c8075ce833292409
|
20
|
-
remote: https://github.com/ruby/gem_rbs_collection.git
|
21
|
-
repo_dir: gems
|
22
|
-
- name: concurrent-ruby
|
23
|
-
version: '1.1'
|
24
|
-
source:
|
25
|
-
type: git
|
26
|
-
name: ruby/gem_rbs_collection
|
27
|
-
revision: aeede7258d020bfd509541e0c8075ce833292409
|
28
|
-
remote: https://github.com/ruby/gem_rbs_collection.git
|
29
|
-
repo_dir: gems
|
30
|
-
- name: date
|
31
|
-
version: '0'
|
32
|
-
source:
|
33
|
-
type: stdlib
|
34
14
|
- name: dbm
|
35
15
|
version: '0'
|
36
16
|
source:
|
37
17
|
type: stdlib
|
38
|
-
- name: i18n
|
39
|
-
version: '1.10'
|
40
|
-
source:
|
41
|
-
type: git
|
42
|
-
name: ruby/gem_rbs_collection
|
43
|
-
revision: aeede7258d020bfd509541e0c8075ce833292409
|
44
|
-
remote: https://github.com/ruby/gem_rbs_collection.git
|
45
|
-
repo_dir: gems
|
46
18
|
- name: json
|
47
19
|
version: '0'
|
48
20
|
source:
|
@@ -83,18 +55,6 @@ gems:
|
|
83
55
|
version: '0'
|
84
56
|
source:
|
85
57
|
type: stdlib
|
86
|
-
- name: securerandom
|
87
|
-
version: '0'
|
88
|
-
source:
|
89
|
-
type: stdlib
|
90
|
-
- name: singleton
|
91
|
-
version: '0'
|
92
|
-
source:
|
93
|
-
type: stdlib
|
94
|
-
- name: time
|
95
|
-
version: '0'
|
96
|
-
source:
|
97
|
-
type: stdlib
|
98
58
|
- name: tsort
|
99
59
|
version: '0'
|
100
60
|
source:
|
data/rbs_collection.yaml
CHANGED
data/sig/rbs/command_runner.rbs
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbs-src
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
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-
|
11
|
+
date: 2023-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: rbs-src
|
14
14
|
email:
|