packs 0.0.3 → 0.0.4
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 +4 -4
- data/lib/packs/private/configuration.rb +7 -6
- data/lib/packs.rb +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7080a6fa5987fd5e6526b429e393cf5a8c0880f949dc5ebcd7a151479f1b3683
|
4
|
+
data.tar.gz: bd4c0fe1047832ba6ecd4277368f7b3effd5f1f97143155ff0f2b3f0d472816d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ee749052a37b250094beba396462274948e7a8964267eccbd76a256390a50af7ee3be33b1e1bf391ace03b2007175b51a35a4d99e6f3c407c354ff889ac2803
|
7
|
+
data.tar.gz: adeb079802b6711e84f6b9860d3d128aee2d805c801f09c26eeed9d8836e8216302c0d03abb7a2f201ee96556c0c717af294e270ea72cc4d67b68bb742286d2b
|
@@ -4,20 +4,21 @@ module Packs
|
|
4
4
|
module Private
|
5
5
|
class Configuration < T::Struct
|
6
6
|
extend T::Sig
|
7
|
+
CONFIGURATION_PATHNAME = T.let(Pathname.new('packs.yml'), Pathname)
|
8
|
+
|
7
9
|
DEFAULT_PACK_PATHS = T.let([
|
8
|
-
|
9
|
-
|
10
|
-
|
10
|
+
'packs/*',
|
11
|
+
'packs/*/*'
|
12
|
+
], T::Array[String])
|
11
13
|
|
12
14
|
prop :pack_paths, T::Array[String]
|
13
15
|
|
14
16
|
sig { returns(Configuration) }
|
15
17
|
def self.fetch
|
16
|
-
|
17
|
-
config_hash = configuration_path.exist? ? YAML.load_file('packs.yml') : {}
|
18
|
+
config_hash = CONFIGURATION_PATHNAME.exist? ? YAML.load_file(CONFIGURATION_PATHNAME) : {}
|
18
19
|
|
19
20
|
new(
|
20
|
-
pack_paths: pack_paths(config_hash)
|
21
|
+
pack_paths: pack_paths(config_hash)
|
21
22
|
)
|
22
23
|
end
|
23
24
|
|
data/lib/packs.rb
CHANGED
@@ -7,7 +7,6 @@ require 'packs/private'
|
|
7
7
|
|
8
8
|
module Packs
|
9
9
|
PACKAGE_FILE = T.let('package.yml'.freeze, String)
|
10
|
-
ROOTS = T.let(%w[packs components], T::Array[String])
|
11
10
|
|
12
11
|
class << self
|
13
12
|
extend T::Sig
|
@@ -45,6 +44,11 @@ module Packs
|
|
45
44
|
|
46
45
|
sig { params(blk: T.proc.params(arg0: Private::Configuration).void).void }
|
47
46
|
def configure(&blk)
|
47
|
+
# If packs.yml is being used, then ignore direct configuration.
|
48
|
+
# This is only a stop-gap to permit Stimpack users to more easily migrate
|
49
|
+
# to packs.yml
|
50
|
+
return if Private::Configuration::CONFIGURATION_PATHNAME.exist?
|
51
|
+
|
48
52
|
yield(config)
|
49
53
|
end
|
50
54
|
|