wash 0.1.2 → 0.2.0
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/wash/entry.rb +24 -0
- data/lib/wash/method.rb +5 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 564995e2e64780be1da143efd49c1814123eae654acd381e245b6e59738104d4
|
4
|
+
data.tar.gz: 870a5691d24dfcf51dadd3b5b67e2fa963c58a45c8e362bd3a9d01ba57358467
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02245abc3f32840842da57d9238768a477b981af2ba1a485a9ca23d6baa1b5d22de1d856bb9b3d5daeba79e2ff6aad979f9d9242c05781858c84e8894d1691c5
|
7
|
+
data.tar.gz: 4dd768b920b3121d5652770111448bf1bf701366aa6745a3b9bcc42ea2248099107be84f2c4b0007840edaccc0049809dc5db12dea8e40a025fe2e13d7ef260d
|
data/lib/wash/entry.rb
CHANGED
@@ -108,6 +108,18 @@ module Wash
|
|
108
108
|
@description = description
|
109
109
|
end
|
110
110
|
|
111
|
+
# signal adds the given signal to the entry's list of supported signals. It is a helper
|
112
|
+
# for Entry schemas.
|
113
|
+
def signal(name, description)
|
114
|
+
add_signal_schema(name, '', description)
|
115
|
+
end
|
116
|
+
|
117
|
+
# signal_group adds the given signal group to the entry's list of supported signals. It is
|
118
|
+
# a helper for Entry schemas.
|
119
|
+
def signal_group(name, regex, description)
|
120
|
+
add_signal_schema(name, regex, description)
|
121
|
+
end
|
122
|
+
|
111
123
|
# meta_attribute_schema sets the meta attribute's schema to schema. It is a helper
|
112
124
|
# for Entry schemas.
|
113
125
|
#
|
@@ -166,6 +178,7 @@ module Wash
|
|
166
178
|
methods: methods,
|
167
179
|
singleton: @singleton,
|
168
180
|
description: @description,
|
181
|
+
signals: @signals,
|
169
182
|
meta_attribute_schema: @meta_attribute_schema,
|
170
183
|
metadata_schema: @metadata_schema,
|
171
184
|
}
|
@@ -211,6 +224,17 @@ module Wash
|
|
211
224
|
end
|
212
225
|
fields
|
213
226
|
end
|
227
|
+
|
228
|
+
def add_signal_schema(name, regex, description)
|
229
|
+
signal = {
|
230
|
+
name: name,
|
231
|
+
description: description
|
232
|
+
}
|
233
|
+
signal[:regex] = regex unless regex.empty?
|
234
|
+
|
235
|
+
@signals ||= []
|
236
|
+
@signals.push(signal)
|
237
|
+
end
|
214
238
|
end
|
215
239
|
|
216
240
|
# All entries have a name. Note that the name is always
|
data/lib/wash/method.rb
CHANGED
@@ -20,7 +20,9 @@ module Wash
|
|
20
20
|
unless block
|
21
21
|
block = lambda do |entry, *args|
|
22
22
|
result = entry.send(name, *args)
|
23
|
-
|
23
|
+
unless result == nil
|
24
|
+
Wash.send(:print_json, result)
|
25
|
+
end
|
24
26
|
end
|
25
27
|
end
|
26
28
|
@methods ||= {}
|
@@ -31,6 +33,8 @@ module Wash
|
|
31
33
|
method(:list)
|
32
34
|
method(:metadata)
|
33
35
|
method(:schema)
|
36
|
+
method(:delete)
|
37
|
+
method(:signal)
|
34
38
|
|
35
39
|
method(:read) do |entry, _|
|
36
40
|
STDOUT.print(entry.read)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A library for building Wash external plugins
|
14
14
|
email:
|
@@ -40,7 +40,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
requirements: []
|
43
|
-
|
43
|
+
rubyforge_project:
|
44
|
+
rubygems_version: 2.7.10
|
44
45
|
signing_key:
|
45
46
|
specification_version: 4
|
46
47
|
summary: A library for building Wash external plugins
|