pears 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/lib/pears/commands.rb +4 -0
- data/lib/pears/subject.rb +13 -1
- data/lib/pears/version.rb +1 -1
- data/lib/pears.rb +6 -6
- 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: 10cdea0d2eb59b303dab2dac91edbe3a3f37d6bb833fcbccaf7176ab28cc6813
|
4
|
+
data.tar.gz: aef9803cf0c1c022fdb21615c0d76c228c3eabbaf160bd5742d6fee244315301
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12365453b2bbdb8fc612180dd3d7723811ff3068c8c78d46c2b957824ce44cc477438d76d5a2086d7c252772a2d3ea11101fbef44e0df56e70222c0e3e3adb2f
|
7
|
+
data.tar.gz: aefbc749ea3806cec18b20c948cf93253ac9d87c1de579c06a2ea757bbd8ddd8e1b0d483222e5dfe7e78160c264b735cb05387606c2687d9ddedab280fa9308c
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pears (0.
|
4
|
+
pears (0.3.1)
|
5
5
|
activesupport
|
6
6
|
dry-configurable (>= 0.13.0)
|
7
7
|
redis
|
@@ -9,7 +9,7 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (7.0.3)
|
12
|
+
activesupport (7.0.3.1)
|
13
13
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
14
|
i18n (>= 1.6, < 2)
|
15
15
|
minitest (>= 5.1)
|
@@ -20,9 +20,9 @@ GEM
|
|
20
20
|
dry-configurable (0.15.0)
|
21
21
|
concurrent-ruby (~> 1.0)
|
22
22
|
dry-core (~> 0.6)
|
23
|
-
dry-core (0.
|
23
|
+
dry-core (0.8.0)
|
24
24
|
concurrent-ruby (~> 1.0)
|
25
|
-
i18n (1.
|
25
|
+
i18n (1.12.0)
|
26
26
|
concurrent-ruby (~> 1.0)
|
27
27
|
minitest (5.16.2)
|
28
28
|
rake (13.0.6)
|
@@ -42,7 +42,7 @@ GEM
|
|
42
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
43
43
|
rspec-support (~> 3.10.0)
|
44
44
|
rspec-support (3.10.3)
|
45
|
-
tzinfo (2.0.
|
45
|
+
tzinfo (2.0.5)
|
46
46
|
concurrent-ruby (~> 1.0)
|
47
47
|
|
48
48
|
PLATFORMS
|
data/lib/pears/commands.rb
CHANGED
data/lib/pears/subject.rb
CHANGED
@@ -8,9 +8,11 @@ module Pears
|
|
8
8
|
include Enumerable
|
9
9
|
attr_reader :name
|
10
10
|
|
11
|
-
def initialize(name, *layers)
|
11
|
+
def initialize(name, *layers, loader: ->(builder){} )
|
12
12
|
@name = name
|
13
13
|
@layers = layers
|
14
|
+
@loader = loader
|
15
|
+
boot
|
14
16
|
end
|
15
17
|
|
16
18
|
def [](key)
|
@@ -48,8 +50,18 @@ module Pears
|
|
48
50
|
project.each(&block)
|
49
51
|
end
|
50
52
|
|
53
|
+
def reboot
|
54
|
+
purge
|
55
|
+
@layers = []
|
56
|
+
boot
|
57
|
+
end
|
58
|
+
|
51
59
|
private
|
52
60
|
|
61
|
+
def boot
|
62
|
+
@loader.call(Provider::Builder.new(self))
|
63
|
+
end
|
64
|
+
|
53
65
|
def layers
|
54
66
|
@layers
|
55
67
|
end
|
data/lib/pears/version.rb
CHANGED
data/lib/pears.rb
CHANGED
@@ -16,15 +16,15 @@ module Pears
|
|
16
16
|
end
|
17
17
|
|
18
18
|
# This is the main way of locating a subject.
|
19
|
-
def self.subject(name)
|
19
|
+
def self.subject(name, &block)
|
20
20
|
if subjects.any? { |sub| sub.name == name }
|
21
21
|
raise Pears::Error.new("subject name #{name} is already in use.")
|
22
22
|
end
|
23
23
|
|
24
|
-
Subject.new(name).tap
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
Subject.new(name, loader: block).tap { |sub| @subjects.push sub }
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.[](name)
|
28
|
+
subjects.find { |subject| subject.name == name }
|
29
29
|
end
|
30
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pears
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Kemp
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-configurable
|