aws_clim 1.0.3 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws_clim/version.rb +1 -1
- data/lib/aws_clim.rb +13 -2
- 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: e3984e158427ba0a677f007e42c46ffda1c74637c1a6c0dc6ec49d346cc1f1ef
|
4
|
+
data.tar.gz: 906c28423ee82bb94ec9d388ca15129ca1fa883d05aed2e86ea18775735044f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67d7f53dd0d0ab542a6f0f48e8e4b8a452930ba0bd6372fa1517fe0c5cefd83697fe93e2395726140379855104a2fd86c4d6d3feda5b5b5381a60189b5a6ef17
|
7
|
+
data.tar.gz: 1f7ec0b62eaee30de16f7b6bf7c5742361c1327e8ba4f0601692e6ffa8b44bfadd267eda3943f0a427070a0a7d94652533d4bfcd7fa14d93089ac0b391fe2e8a
|
data/lib/aws_clim/version.rb
CHANGED
data/lib/aws_clim.rb
CHANGED
@@ -330,6 +330,10 @@ class AwsClim
|
|
330
330
|
define_method service_name do |*ps|
|
331
331
|
execute(service_name, ps)
|
332
332
|
end
|
333
|
+
|
334
|
+
define_method "#{service_name}_help" do
|
335
|
+
execute(service_name, 'help').data
|
336
|
+
end
|
333
337
|
end
|
334
338
|
|
335
339
|
def execute(service, options)
|
@@ -338,7 +342,14 @@ class AwsClim
|
|
338
342
|
out, err, status = Open3.capture3(cmd)
|
339
343
|
|
340
344
|
if status.success?
|
341
|
-
|
345
|
+
data =
|
346
|
+
begin
|
347
|
+
JSON.parse(out, object_class: OpenStruct)
|
348
|
+
rescue JSON::ParserError => e
|
349
|
+
out
|
350
|
+
end
|
351
|
+
|
352
|
+
OpenStruct.new(success?: true, error?: false, data: data)
|
342
353
|
else
|
343
354
|
OpenStruct.new(success?: false, error?: true, data: err)
|
344
355
|
end
|
@@ -354,7 +365,7 @@ class AwsClim
|
|
354
365
|
format_option(option)
|
355
366
|
}.join(' ')
|
356
367
|
elsif options.is_a?(String)
|
357
|
-
"#{
|
368
|
+
"#{options}"
|
358
369
|
end
|
359
370
|
end
|
360
371
|
|