packs 0.0.40 → 0.0.41
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ffe5dc9bf38dcea0c7eb2bf1091c5ea162d04a2a8551f2a4198d3b60acfe878
|
4
|
+
data.tar.gz: 2c74caaac69bcc7ad850c940f25254995333d4dcb144d779b6302872a1365cb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ba2df6056b91420e64b222c8a23e233634612bc0e1be4b249775892ce5be947523b1c9bd1665eadc5a9e7658e976be228912ec07ca55d64aa318eeb9fc39eab
|
7
|
+
data.tar.gz: 84235f58a2c5e5ddb106761bd4a2a312a6d3118af539f5f1ab9e09bc194f78dcc5f614b914450e6e6254c8f2b1e8989a265654a32b07b6e199ff25ce8f0a7559
|
@@ -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.41
|
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-03-
|
11
|
+
date: 2024-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bigdecimal
|