aly 0.3.3 → 0.3.5

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: 9e17e574eefcdeac07c99c182249e4da4e449a08139480a64a5d30b667a4ffb1
4
+ data.tar.gz: 83209f62fa8d701735844d64ed07806eadeb9d5d2924556e76020518e68a0a00
5
5
  SHA512:
6
- metadata.gz: d05f179882ed0090b7e2ab180c91c9ed01bbb101c3a9d169fc9b9ddf6ce1ade2892f8b01b27eaa3d342ddaadb60e797d06e45e91952e20861a498b46c3b72936
7
- data.tar.gz: 2502e19639d64471221a0693854a5a9bc67e2821284d94ce707dd04d3bb1ea3d0d1a423736ce0538379935ad99b4b27d2bf4a32330d7a56ca6a52666c8d619f2
6
+ metadata.gz: c7c05a554bac0300b9ef7388a75a5479647e18a597855011086cdcf6d04d7fd22e4d75b58003c7b9e322842558fc6c4cb3acc135c3ac4480f373c5daab017202
7
+ data.tar.gz: 047a5feb0d9c3d466a1ea35b6eeb3f15723812ad12e39dfb89b58f17898050b8916decec70a79a25a665f9a8ffd828856e620e8544093c95a1a29606091d3010
data/Gemfile CHANGED
@@ -5,6 +5,6 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in aly.gemspec
6
6
  gemspec
7
7
 
8
- gem "rake", "~> 13.0"
8
+ gem "rake", "~> 13.0.6"
9
9
 
10
- gem "rspec", "~> 3.0"
10
+ gem "rspec", "~> 3.12.0"
data/Gemfile.lock CHANGED
@@ -1,51 +1,52 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aly (0.3.3)
5
- terminal-table (~> 1.8.0)
6
- thor (~> 0.20.0)
4
+ aly (0.3.5)
5
+ terminal-table (~> 3.0.2)
6
+ thor (~> 1.2.1)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- byebug (10.0.2)
11
+ byebug (11.1.3)
12
12
  coderay (1.1.3)
13
- diff-lcs (1.4.4)
13
+ diff-lcs (1.5.0)
14
14
  method_source (1.0.0)
15
15
  pry (0.14.1)
16
16
  coderay (~> 1.1)
17
17
  method_source (~> 1.0)
18
- pry-byebug (3.6.0)
19
- byebug (~> 10.0)
20
- pry (~> 0.10)
18
+ pry-byebug (3.10.1)
19
+ byebug (~> 11.0)
20
+ pry (>= 0.13, < 0.15)
21
21
  rake (13.0.6)
22
- rspec (3.10.0)
23
- rspec-core (~> 3.10.0)
24
- rspec-expectations (~> 3.10.0)
25
- rspec-mocks (~> 3.10.0)
26
- rspec-core (3.10.1)
27
- rspec-support (~> 3.10.0)
28
- rspec-expectations (3.10.1)
22
+ rspec (3.12.0)
23
+ rspec-core (~> 3.12.0)
24
+ rspec-expectations (~> 3.12.0)
25
+ rspec-mocks (~> 3.12.0)
26
+ rspec-core (3.12.0)
27
+ rspec-support (~> 3.12.0)
28
+ rspec-expectations (3.12.1)
29
29
  diff-lcs (>= 1.2.0, < 2.0)
30
- rspec-support (~> 3.10.0)
31
- rspec-mocks (3.10.2)
30
+ rspec-support (~> 3.12.0)
31
+ rspec-mocks (3.12.1)
32
32
  diff-lcs (>= 1.2.0, < 2.0)
33
- rspec-support (~> 3.10.0)
34
- rspec-support (3.10.2)
35
- terminal-table (1.8.0)
36
- unicode-display_width (~> 1.1, >= 1.1.1)
37
- thor (0.20.3)
38
- unicode-display_width (1.8.0)
33
+ rspec-support (~> 3.12.0)
34
+ rspec-support (3.12.0)
35
+ terminal-table (3.0.2)
36
+ unicode-display_width (>= 1.1.1, < 3)
37
+ thor (1.2.1)
38
+ unicode-display_width (2.3.0)
39
39
 
40
40
  PLATFORMS
41
41
  x86_64-darwin-20
42
42
  x86_64-darwin-21
43
+ x86_64-darwin-22
43
44
 
44
45
  DEPENDENCIES
45
46
  aly!
46
- pry-byebug (~> 3.6.0)
47
- rake (~> 13.0)
48
- rspec (~> 3.0)
47
+ pry-byebug (~> 3.10.1)
48
+ rake (~> 13.0.6)
49
+ rspec (~> 3.12.0)
49
50
 
50
51
  BUNDLED WITH
51
- 2.2.3
52
+ 2.4.1
data/aly.gemspec CHANGED
@@ -23,8 +23,8 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ["lib"]
25
25
 
26
- spec.add_dependency 'thor', '~> 0.20.0'
27
- spec.add_dependency 'terminal-table', '~> 1.8.0'
26
+ spec.add_dependency 'thor', '~> 1.2.1'
27
+ spec.add_dependency 'terminal-table', '~> 3.0.2'
28
28
 
29
- spec.add_development_dependency "pry-byebug", "~> 3.6.0"
29
+ spec.add_development_dependency "pry-byebug", "~> 3.10.1"
30
30
  end
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.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
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.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Xiang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-22 00:00:00.000000000 Z
11
+ date: 2022-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.20.0
19
+ version: 1.2.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.20.0
26
+ version: 1.2.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: terminal-table
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.8.0
33
+ version: 3.0.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.8.0
40
+ version: 3.0.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pry-byebug
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 3.6.0
47
+ version: 3.10.1
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 3.6.0
54
+ version: 3.10.1
55
55
  description: A simple wrapper for aliyun cli
56
56
  email:
57
57
  - liuxiang921@gmail.com
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  requirements: []
98
- rubygems_version: 3.3.3
98
+ rubygems_version: 3.4.1
99
99
  signing_key:
100
100
  specification_version: 4
101
101
  summary: A simple wrapper for aliyun cli