aly 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f4b613a0c93e9ea9f7a8bf871be047d304cd0bca3b74cf0087dd1a108669cab
4
- data.tar.gz: 7e903e4afbe0b1b634c83182efa9717de20a393a35685aaf18699ec565aee72e
3
+ metadata.gz: 710c187d9fac4262f8c0507ba0334d54b983dd1bcdf19248e5f4cb2d52cf707d
4
+ data.tar.gz: ef60807c9b0184da58027f9048da53845924aaa5edcc4beac8c43d6dd0dd9236
5
5
  SHA512:
6
- metadata.gz: d05f179882ed0090b7e2ab180c91c9ed01bbb101c3a9d169fc9b9ddf6ce1ade2892f8b01b27eaa3d342ddaadb60e797d06e45e91952e20861a498b46c3b72936
7
- data.tar.gz: 2502e19639d64471221a0693854a5a9bc67e2821284d94ce707dd04d3bb1ea3d0d1a423736ce0538379935ad99b4b27d2bf4a32330d7a56ca6a52666c8d619f2
6
+ metadata.gz: f366b47ab659a41bb3e1d9aa78045e281fb3330b02fa41f193ed83561d50c5b8f4aef313f9916549081e0126a3284797c7b715136accc76eea1714da1abc99a3
7
+ data.tar.gz: 985ea70ca8b61ec19d9ab78c1db6f7692c5f5e992116f7b18c92c15943d0474165685530c2898f93e7bc1de5637f090fdd9839b3a79ef40ce655a72300f60b14
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aly (0.3.3)
4
+ aly (0.3.4)
5
5
  terminal-table (~> 1.8.0)
6
6
  thor (~> 0.20.0)
7
7
 
data/lib/aly/app.rb CHANGED
@@ -18,7 +18,7 @@ end
18
18
  module Aly
19
19
  class App
20
20
  def start(options)
21
- send(options[:command], *options[:args], **options[:options])
21
+ send(options[:command], *options[:args], **(options[:options].transform_keys(&:to_sym)))
22
22
  end
23
23
 
24
24
  def ecs(*args, **options)
@@ -35,7 +35,7 @@ module Aly
35
35
  end
36
36
  end
37
37
 
38
- if options['full']
38
+ if options[:full]
39
39
  selected = selected.map do |row|
40
40
  {
41
41
  Id: row['InstanceId'],
@@ -48,7 +48,7 @@ module Aly
48
48
  }
49
49
  end
50
50
  puts selected.table&.to_s
51
- elsif options['detail']
51
+ elsif options[:detail]
52
52
  puts JSON.pretty_generate(selected)
53
53
  else
54
54
  selected = selected.map do |row|
@@ -77,7 +77,7 @@ module Aly
77
77
  end
78
78
 
79
79
 
80
- if options['detail']
80
+ if options[:detail]
81
81
  puts JSON.pretty_generate(selected)
82
82
  else
83
83
  net_intefraces = exec('ecs', 'DescribeNetworkInterfaces', '--pager', **options)['NetworkInterfaceSets']['NetworkInterfaceSet'].each_with_object({}) do |item, result|
@@ -203,7 +203,7 @@ module Aly
203
203
  puts listener_rules.table.to_s.gsub(/^/, ' ')
204
204
  puts
205
205
 
206
- if options['acl']
206
+ if options[:acl]
207
207
  acl_ids = listeners.flat_map { |listener| listener['AclIds'] || [] }.uniq
208
208
  unless acl_ids.empty?
209
209
  alc_entries = acl_ids.flat_map do |acl_id|
@@ -271,9 +271,9 @@ module Aly
271
271
  item['AllIPs'] = item['PrivateIP'] + item['PublicIP']
272
272
  end
273
273
 
274
- if options['full']
274
+ if options[:full]
275
275
  full_slb(selected, eips, **options)
276
- elsif options['detail']
276
+ elsif options[:detail]
277
277
  selected.each do |row|
278
278
  described_load_balancer_attributes = exec('slb', 'DescribeLoadBalancerAttribute', "--LoadBalancerId=#{row['LoadBalancerId']}", **options)
279
279
  row['BackendServers'] = described_load_balancer_attributes['BackendServers']['BackendServer']
@@ -500,7 +500,7 @@ module Aly
500
500
 
501
501
  def exec(command, sub_command, *args, **options)
502
502
  command = "aliyun #{command} #{sub_command} #{args.join(' ')}"
503
- command += " -p #{options['profile']}" if options['profile']
503
+ command += " -p #{options[:profile]}" if options[:profile]
504
504
  JSON.parse(`#{command}`)
505
505
  end
506
506
  end
data/lib/aly/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Aly
4
- VERSION = "0.3.3"
4
+ VERSION = "0.3.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Xiang