matt 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/matt/command.rb +26 -23
- data/lib/matt/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: d0d982bf8b24d2c37f18bc1db92ba7f7382402d33b2cda5d9e63e23c3074856d
|
4
|
+
data.tar.gz: b6fdeddbf7570e4424c69e16718900b91fac8dc051f4a04bb6c8fe9246c128d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23144f539ac737c3f89454076a96961f350c8eb642661346056bebdc37abed009af67b5454a97c2806f972a43b0d2a60ac8ffe5fa5dca6bd01fdc6b3faae9064
|
7
|
+
data.tar.gz: d9d12f0a4289ab2ff1b6ac99093d15d6a374d8415f9eed06d37318281e9d6130a7d1ce3aecd09289c82b105a0ade2746e727fcca8ab2da3371db599533553f29
|
data/lib/matt/command.rb
CHANGED
@@ -105,23 +105,20 @@ module Matt
|
|
105
105
|
end
|
106
106
|
|
107
107
|
def do_ping(argv)
|
108
|
-
which_ones =
|
109
|
-
configuration.datasources.to_h.values
|
110
|
-
else
|
111
|
-
argv.map{|arg| datasource_exists!(arg) }
|
112
|
-
end
|
108
|
+
which_ones = argv_to_xs(argv, :datasources)
|
113
109
|
which_ones.each do |d|
|
114
110
|
d.ping
|
115
111
|
end
|
116
112
|
end
|
117
113
|
|
118
114
|
def do_export(argv)
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
115
|
+
which_ones = argv_to_xs(argv, :measures)
|
116
|
+
which_ones.each do |m|
|
117
|
+
data = m.full_data.restrict(configuration.at_predicate)
|
118
|
+
(@to || m.exporters).each do |e|
|
119
|
+
exporter = exporter_exists!(e)
|
120
|
+
exporter.export(m, data)
|
121
|
+
end
|
125
122
|
end
|
126
123
|
end
|
127
124
|
|
@@ -190,25 +187,31 @@ module Matt
|
|
190
187
|
abort
|
191
188
|
end
|
192
189
|
|
193
|
-
def
|
194
|
-
|
195
|
-
return
|
196
|
-
puts_err "No such
|
190
|
+
def x_exists!(name, xs)
|
191
|
+
x = configuration.send(xs).send(name.to_sym)
|
192
|
+
return x if x
|
193
|
+
puts_err "No such #{xs[0...-1]} #{name}"
|
197
194
|
abort
|
198
195
|
end
|
199
196
|
|
197
|
+
def measure_exists!(name)
|
198
|
+
x_exists!(name, :measures)
|
199
|
+
end
|
200
|
+
|
200
201
|
def exporter_exists!(name)
|
201
|
-
|
202
|
-
return m if m
|
203
|
-
puts_err "No such exporter #{name}"
|
204
|
-
abort
|
202
|
+
x_exists!(name, :exporters)
|
205
203
|
end
|
206
204
|
|
207
205
|
def datasource_exists!(name)
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
206
|
+
x_exists!(name, :datasources)
|
207
|
+
end
|
208
|
+
|
209
|
+
def argv_to_xs(argv, xs)
|
210
|
+
if argv.empty?
|
211
|
+
configuration.send(xs).to_h.values
|
212
|
+
else
|
213
|
+
argv.map{|arg| x_exists!(arg, xs) }
|
214
|
+
end
|
212
215
|
end
|
213
216
|
|
214
217
|
def abort
|
data/lib/matt/version.rb
CHANGED