packs 0.0.40 → 0.0.42
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 013625f1961cdc9ba674369e6039a17dcde8e2039a0b3e7283362d1c84ac6014
|
4
|
+
data.tar.gz: 7756ab964185ac8cdabd86be4964654970eaa8502685f8e7e4af017fe127ebd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ffe1c6dd9e30fcaf474a0ddad5df39a0da6f8a8373137dc05e7f009608427904bb1673b929bb53ccbc76bb1fc77a5c0f718ce620edf2cef5579718ff301a62b
|
7
|
+
data.tar.gz: 07a6c67e9739780b72c688499cafd70c4128a6f1bacc8472b140170ea466fad238d8566fd01998ff6d8098e3698d2216265c233459147cf840a147d57e8c6488
|
@@ -9,34 +9,38 @@ module Packs
|
|
9
9
|
const :destination_pathname, Pathname
|
10
10
|
const :destination_pack, ParsePackwerk::Package
|
11
11
|
|
12
|
-
sig { returns(
|
12
|
+
sig { returns(T.nilable(Packs::Pack)) }
|
13
13
|
def origin_pack
|
14
|
-
|
14
|
+
self.class.get_origin_pack(origin_pathname)
|
15
|
+
end
|
16
|
+
|
17
|
+
sig { params(origin_pathname: Pathname).returns(T.nilable(Packs::Pack)) }
|
18
|
+
def self.get_origin_pack(origin_pathname)
|
19
|
+
Packs.for_file(origin_pathname)
|
15
20
|
end
|
16
21
|
|
17
22
|
sig { params(origin_pathname: Pathname, new_package_root: Pathname).returns(Pathname) }
|
18
23
|
def self.destination_pathname_for_package_move(origin_pathname, new_package_root)
|
19
|
-
origin_pack =
|
20
|
-
|
21
|
-
if origin_pack.name == ParsePackwerk::ROOT_PACKAGE_NAME
|
22
|
-
new_package_root.join(origin_pathname).cleanpath
|
23
|
-
else
|
24
|
+
origin_pack = get_origin_pack(origin_pathname)
|
25
|
+
if origin_pack
|
24
26
|
Pathname.new(origin_pathname.to_s.gsub(origin_pack.name, new_package_root.to_s)).cleanpath
|
27
|
+
else
|
28
|
+
new_package_root.join(origin_pathname).cleanpath
|
25
29
|
end
|
26
30
|
end
|
27
31
|
|
28
32
|
sig { params(origin_pathname: Pathname).returns(Pathname) }
|
29
33
|
def self.destination_pathname_for_new_public_api(origin_pathname)
|
30
|
-
origin_pack =
|
31
|
-
if origin_pack
|
32
|
-
filepath_without_pack_name = origin_pathname.to_s
|
33
|
-
else
|
34
|
+
origin_pack = get_origin_pack(origin_pathname)
|
35
|
+
if origin_pack
|
34
36
|
filepath_without_pack_name = origin_pathname.to_s.gsub("#{origin_pack.name}/", '')
|
37
|
+
else
|
38
|
+
filepath_without_pack_name = origin_pathname.to_s
|
35
39
|
end
|
36
40
|
|
37
41
|
# We join the pack name with the rest of the path...
|
38
42
|
path_parts = filepath_without_pack_name.split('/')
|
39
|
-
Pathname.new(origin_pack
|
43
|
+
Pathname.new(origin_pack&.name || ParsePackwerk::ROOT_PACKAGE_NAME).join(
|
40
44
|
# ... keeping the "app" or "spec"
|
41
45
|
T.must(path_parts[0]),
|
42
46
|
# ... substituting "controllers," "services," etc. with "public"
|
@@ -15,7 +15,7 @@ module Packs
|
|
15
15
|
def after_move_files!(file_move_operations)
|
16
16
|
return if file_move_operations.empty?
|
17
17
|
|
18
|
-
origin_pack = T.must(file_move_operations.first).origin_pack
|
18
|
+
origin_pack = T.must(file_move_operations.first).origin_pack&.name || ParsePackwerk::ROOT_PACKAGE_NAME
|
19
19
|
destination_pack = T.must(file_move_operations.first).destination_pack.name
|
20
20
|
|
21
21
|
if self.class.ripgrep_enabled?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: packs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.42
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusto Engineers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bigdecimal
|
@@ -73,6 +73,9 @@ dependencies:
|
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 0.22.0
|
76
|
+
- - "<="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 0.23.0
|
76
79
|
type: :runtime
|
77
80
|
prerelease: false
|
78
81
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -80,6 +83,9 @@ dependencies:
|
|
80
83
|
- - ">="
|
81
84
|
- !ruby/object:Gem::Version
|
82
85
|
version: 0.22.0
|
86
|
+
- - "<="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 0.23.0
|
83
89
|
- !ruby/object:Gem::Dependency
|
84
90
|
name: rainbow
|
85
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -344,7 +350,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
344
350
|
- !ruby/object:Gem::Version
|
345
351
|
version: '0'
|
346
352
|
requirements: []
|
347
|
-
rubygems_version: 3.5.
|
353
|
+
rubygems_version: 3.5.9
|
348
354
|
signing_key:
|
349
355
|
specification_version: 4
|
350
356
|
summary: Provides CLI tools for working with ruby packs.
|