parse_packwerk 0.10.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/parse_packwerk.rb +11 -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: f97fa90aa6c1081358322fcbce578b4a133305216312ec90cd27cd990bf16575
|
4
|
+
data.tar.gz: 497321cf3cddc44fc099244ca9b2481beff586a9ad82a0482971977e368dcce7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db897c18973474fac686a1ed2bf60882fea2ddb28e41c419199e30c08d76598b185ec2e44600ece0421d19f4a44bdb8d3348ca6cfd6ef59c99a7f1cacb2e087d
|
7
|
+
data.tar.gz: 6a5ccf2ff287f334fc404b7c2064c2f10c6d43fd91a84e8fc641e1f9360b526fb9829e6ad4ab44761c54b8effaedec9ca3468f493cc3680d9b7883c02345cb67
|
data/lib/parse_packwerk.rb
CHANGED
@@ -39,6 +39,17 @@ module ParsePackwerk
|
|
39
39
|
Configuration.fetch
|
40
40
|
end
|
41
41
|
|
42
|
+
sig { params(file_path: T.any(Pathname, String)).returns(T.nilable(Package)) }
|
43
|
+
def self.package_from_path(file_path)
|
44
|
+
path_string = file_path.to_s
|
45
|
+
@package_from_path = T.let(@package_from_path, T.nilable(T::Hash[String, Package]))
|
46
|
+
@package_from_path ||= {}
|
47
|
+
@package_from_path[path_string] ||= T.must(begin
|
48
|
+
matching_package = all.find { |package| path_string.start_with?("#{package.name}/") || path_string == package.name }
|
49
|
+
matching_package || find(ROOT_PACKAGE_NAME)
|
50
|
+
end)
|
51
|
+
end
|
52
|
+
|
42
53
|
sig { params(package: ParsePackwerk::Package).void }
|
43
54
|
def self.write_package_yml!(package)
|
44
55
|
FileUtils.mkdir_p(package.directory)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parse_packwerk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusto Engineers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sorbet-runtime
|