stimpack 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stimpack/pack/configuration.rb +3 -4
- data/lib/stimpack/pack.rb +7 -1
- data/lib/stimpack/packs.rb +1 -1
- data/lib/stimpack/version.rb +1 -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: 8a182ce65cfc7f331c0b8aab98cb9f66f74e24b2892f07759b6fc0663d2ed9d2
|
4
|
+
data.tar.gz: cfbdf8284d0b3c054c2708bd69bfc0eb63341044e93ca064cf9971b17e391a06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dfc2c8a19b50159cddb6f5ace4a593e8f69d8719ee607c3994fed1b1541cfb639fa1bba1bb458eff632487cf65e84181899bd3c3343192ddd5f03abd6f8bd7a
|
7
|
+
data.tar.gz: 1c7f5dce375f55b6733ac771d86f3799aa408335e0d17b11cff6c9e7d47e7ff6d53ccd54c5f944419bad9a9eda2a0c2146c4048dcf26ff643e056119302fb66c
|
@@ -3,11 +3,10 @@
|
|
3
3
|
module Stimpack
|
4
4
|
class Pack
|
5
5
|
class Configuration
|
6
|
-
FILE = "package.yml"
|
7
6
|
KEY = "metadata"
|
8
7
|
|
9
|
-
def initialize(
|
10
|
-
@
|
8
|
+
def initialize(path)
|
9
|
+
@path = path
|
11
10
|
end
|
12
11
|
|
13
12
|
def engine
|
@@ -18,7 +17,7 @@ module Stimpack
|
|
18
17
|
private
|
19
18
|
|
20
19
|
def data
|
21
|
-
@data ||= YAML.load_file(@
|
20
|
+
@data ||= YAML.load_file(@path).fetch(KEY, {}).freeze
|
22
21
|
end
|
23
22
|
end
|
24
23
|
end
|
data/lib/stimpack/pack.rb
CHANGED
@@ -2,12 +2,18 @@
|
|
2
2
|
|
3
3
|
module Stimpack
|
4
4
|
class Pack
|
5
|
+
PACKAGE_FILE = "package.yml"
|
6
|
+
|
5
7
|
autoload :Configuration, "stimpack/pack/configuration"
|
6
8
|
|
7
9
|
attr_reader :name
|
8
10
|
attr_reader :path
|
9
11
|
attr_reader :engine
|
10
12
|
|
13
|
+
def self.create(path)
|
14
|
+
new(path) if path.join(PACKAGE_FILE).exist?
|
15
|
+
end
|
16
|
+
|
11
17
|
def initialize(path)
|
12
18
|
@path = path
|
13
19
|
@name = path.relative_path_from(Packs.root)
|
@@ -22,7 +28,7 @@ module Stimpack
|
|
22
28
|
end
|
23
29
|
|
24
30
|
def config
|
25
|
-
@config ||= Configuration.new(
|
31
|
+
@config ||= Configuration.new(path.join(PACKAGE_FILE))
|
26
32
|
end
|
27
33
|
|
28
34
|
private
|
data/lib/stimpack/packs.rb
CHANGED
@@ -14,7 +14,7 @@ module Stimpack
|
|
14
14
|
def resolve
|
15
15
|
# Gather all the packs under the root directory and create packs.
|
16
16
|
root.children.select(&:directory?).sort!.each do |path|
|
17
|
-
pack = Pack.
|
17
|
+
next unless pack = Pack.create(path)
|
18
18
|
@packs[pack.name] = pack
|
19
19
|
end
|
20
20
|
@packs.freeze
|
data/lib/stimpack/version.rb
CHANGED