plugs 0.4.0 → 0.4.1
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/plugs.rb +11 -3
- data/lib/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 819e6b94b7d18042ac02651f7bba2343df9cf06ae0995b8ffa6117a7804da78d
|
|
4
|
+
data.tar.gz: a54bf7cf98c86de4252a5c3ef13daace7e55a9caea2084c9b30d4aeeda10c29f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: deec428d6c997e6913000451d6a5b2dade3dfa054a2d68f4b541650634ad1564d70bccb500932fde80c46c72cf0a69dccae448ce87e189fdab1d00b252cd13b3
|
|
7
|
+
data.tar.gz: 77a808b75ac1da073b2656492dafcb2dbb29bbe09dd6801f1783639a7f3c0b7c6f1a2770f9415932d429cacb0f64aea65a31958ff7c6c79dde1337d8bf3e4d43
|
data/lib/plugs.rb
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require_relative 'lazy'
|
|
3
4
|
require_relative 'plug'
|
|
4
5
|
require_relative 'sub_selector'
|
|
5
|
-
require_relative 'lazy'
|
|
6
6
|
|
|
7
7
|
module Plugs
|
|
8
8
|
attr_reader :plugs
|
|
@@ -16,8 +16,12 @@ module Plugs
|
|
|
16
16
|
self.class.new(plugs: SubSelector.sub_select(plugs:, keys:), keys:)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def
|
|
20
|
-
|
|
19
|
+
def key?(key)
|
|
20
|
+
!!@plugs[key]
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def +(new_plugs)
|
|
24
|
+
@plugs.merge!(new_plugs.plugs) { |_key, a_values, b_values| [*a_values, *b_values] }
|
|
21
25
|
|
|
22
26
|
self
|
|
23
27
|
end
|
|
@@ -63,6 +67,10 @@ module Plugs
|
|
|
63
67
|
new(plugs: SubSelector.sub_select(plugs:, keys:), keys:)
|
|
64
68
|
end
|
|
65
69
|
|
|
70
|
+
def key?(key)
|
|
71
|
+
!!plugs[key]
|
|
72
|
+
end
|
|
73
|
+
|
|
66
74
|
def to_a
|
|
67
75
|
plugs.values.flatten.map(&:result).map { |value| Lazy.unwrap(value) }
|
|
68
76
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: plugs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- maedi
|
|
@@ -10,7 +10,7 @@ cert_chain: []
|
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies: []
|
|
12
12
|
description: "Plugs are dependencies that are loosely coupled internally but externally
|
|
13
|
-
appear as one entity such as a feature, configuration or plugin.
|
|
13
|
+
appear as one entity such as a feature, configuration or plugin. \nA plug is reusable,
|
|
14
14
|
shareable and overridable.\n"
|
|
15
15
|
email:
|
|
16
16
|
- maediprichard@gmail.com
|
|
@@ -43,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
43
43
|
- !ruby/object:Gem::Version
|
|
44
44
|
version: '0'
|
|
45
45
|
requirements: []
|
|
46
|
-
rubygems_version: 4.0.
|
|
46
|
+
rubygems_version: 4.0.20
|
|
47
47
|
specification_version: 4
|
|
48
48
|
summary: Keep code loosely coupled. Keep features tightly coupled
|
|
49
49
|
test_files: []
|