ec2ssh 4.0.0 → 5.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3ea6bd5f9d58e822861e9bcdb35c18df8da80bbc3273a8645483bac6d1d53cf
4
- data.tar.gz: d5326d28bfbc630696d42c692dc90e3eae03a0240bece33f6893ac0584f3763d
3
+ metadata.gz: 392df01c5d38c8c1dc5589258e885cd348646467303abc15cf346101e4a9d441
4
+ data.tar.gz: b9eb640b664ef6701e50754ff4cf3b3082c66d3132b94350f8a4eb398b764ace
5
5
  SHA512:
6
- metadata.gz: d22a8bcdc6c4317c09d2b36aee3aaf0a06b5f7412f7e318f40579fb5d6bdeaa3f24d10eaea0a294e253c31ee1e23f2719c5f66bdf20dc46da8931addf471f69c
7
- data.tar.gz: 53d4f48c7a7a3dbbbd48d0f0382dfe0715c7af1750b978b9e14183d16adc4bbfaff8872ab65ed2c5ced36debe570682f34c94cb8824735fa800a29ac349f2cea
6
+ metadata.gz: 331921d24eace17e5ebdfc94aec1c231e7ebd4e7b9fe1619b7e1c28b8f2fd288109530ea3a54eb3d830141d04f35ef43c777d9d4c2071080aaf745bac3b93dcf
7
+ data.tar.gz: 224f8d90beb435c656c0d50ae1edff0684ace90f4aa9d7a75c1c62f75bfc3aedee1a590deecb5d93f07d42d4c401775c9a892eee86643b169a13493b5473d46e
@@ -1,8 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2
4
- - 2.3
5
- - 2.4.0
3
+ - 2.4
4
+ - 2.5
5
+ - 2.6
6
+ - 2.7
6
7
  - ruby-head
7
8
  script: 'bundle exec rspec spec'
8
9
  before_install: gem install bundler -v 1.14.3
@@ -1,4 +1,13 @@
1
1
  # Change Log
2
+
3
+ ## 5.0.0
4
+ * Remove `--aws-key` option and add `--path` option in shellcomp (#56)
5
+ * Use aws-sdk v3 and stop using v2 (#54)
6
+ * Delete `rubyforge_project=` in gemspec (#51)
7
+ * Relax thor and highline versions (#49)
8
+ * CI against Ruby 2.5, 2.6 and 2.7 (#45, #55)
9
+ * Drop support outdated Ruby 2.2 and 2.3 (#59)
10
+
2
11
  ## 4.0.0
3
12
  * Use aws-sdk v2 and stop using v1 (#44)
4
13
  * Support AssumeRole with `~/.aws/credentials` (#44)
data/Gemfile CHANGED
@@ -6,7 +6,9 @@ gem 'rspec', '~> 3.0'
6
6
  gem 'rspec-its', '~> 1.0'
7
7
  gem 'guard-rspec', '~> 4.3'
8
8
  gem 'webmock', '~> 1.9'
9
- gem 'rb-fsevent', '~> 0.9.1'
9
+ gem 'rb-fsevent', '~> 0.10'
10
10
  gem 'timecop', '~> 0.5'
11
- gem 'fakefs', '~> 0.6.0', require: 'fakefs/safe'
11
+ gem 'fakefs', '~> 1.2', require: 'fakefs/safe'
12
12
  gem 'vcr', '~> 3.0'
13
+
14
+ gem 'rexml' if RUBY_VERSION >= '2.8.0'
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- [![Build Status](https://travis-ci.org/mirakui/ec2ssh.png?branch=master)](https://travis-ci.org/mirakui/ec2ssh)
1
+ [![Gem Version](https://badge.fury.io/rb/ec2ssh.svg)](https://badge.fury.io/rb/ec2ssh)
2
+ [![Build Status](https://travis-ci.org/mirakui/ec2ssh.svg?branch=master)](https://travis-ci.org/mirakui/ec2ssh)
2
3
 
3
4
  # Introduction
4
5
  ec2ssh is a ssh_config manager for Amazon EC2.
@@ -53,7 +54,7 @@ filters([
53
54
  ])
54
55
 
55
56
  # You can use methods of AWS::EC2::Instance and tag(key) method.
56
- # See https://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Instance.html
57
+ # See https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/EC2/Instance.html
57
58
  host_line <<END
58
59
  Host <%= tag('Name') %>.<%= placement.availability_zone %>
59
60
  HostName <%= public_dns_name || private_ip_address %>
@@ -124,8 +125,8 @@ Host db-server-1.ap-southeast-1
124
125
  Dotfile (`.ec2ssh`) format has been changed from 3.x.
125
126
 
126
127
  * A instance tag access I/F has been changed from `tags['Name']` to `tag('Name')`
127
- * `Aws::EC2::Instance` methods have been changed to AWS SDK v2
128
- * The `aws_keys` structure have benn changed
128
+ * `Aws::EC2::Instance` methods have been changed to AWS SDK v3
129
+ * The `aws_keys` structure has been changed
129
130
  * `aws_keys[profile_name][region] # => Aws::Credentials`
130
131
  * For example:
131
132
 
@@ -144,4 +145,4 @@ aws_keys(
144
145
  Use `zsh/_ec2ssh`.
145
146
 
146
147
  # License
147
- Copyright (c) 2019 Issei Naruta. ec2ssh is released under the MIT license.
148
+ Copyright (c) 2020 Issei Naruta. ec2ssh is released under the MIT license.
@@ -7,7 +7,7 @@ _ec2ssh() {
7
7
  prev=$3
8
8
 
9
9
  subcmds="help init remove update version"
10
- common_opts="--dotfile --verbose"
10
+ common_opts="--path --dotfile --verbose"
11
11
 
12
12
  # contextual completion
13
13
  case $prev in
@@ -21,11 +21,7 @@ _ec2ssh() {
21
21
  esac
22
22
  return 0
23
23
  ;;
24
- --aws-key)
25
- COMPREPLY=()
26
- return 0;
27
- ;;
28
- --dotfile)
24
+ --path | --dotfile)
29
25
  COMPREPLY=( $(compgen -o default -- "$cur"))
30
26
  return 0;
31
27
  ;;
@@ -35,9 +31,6 @@ _ec2ssh() {
35
31
  subcmd=${COMP_WORDS[1]}
36
32
 
37
33
  case $subcmd in
38
- update)
39
- COMPREPLY=( $(compgen -W "--aws-key $common_opts" -- "$cur") )
40
- ;;
41
34
  help)
42
35
  COMPREPLY=( $(compgen -W "$subcmds" $cur) )
43
36
  ;;
@@ -9,14 +9,15 @@ Gem::Specification.new do |s|
9
9
  s.authors = ["Issei Naruta"]
10
10
  s.email = ["mimitako@gmail.com"]
11
11
  s.homepage = "http://github.com/mirakui/ec2ssh"
12
+ s.license = "MIT"
12
13
  s.summary = %q{A ssh_config manager for AWS EC2}
13
14
  s.description = %q{ec2ssh is a ssh_config manager for AWS EC2}
14
- s.required_ruby_version = ">= 2.2.0"
15
+ s.required_ruby_version = ">= 2.4.0"
15
16
 
16
- s.rubyforge_project = "ec2ssh"
17
- s.add_dependency "thor", "~> 0.14"
18
- s.add_dependency "highline", "~> 1.6"
19
- s.add_dependency "aws-sdk", "~> 2"
17
+ s.add_dependency "thor", ">= 0.14", "< 2.0"
18
+ s.add_dependency "highline", ">= 1.6", "< 3.0"
19
+ s.add_dependency "aws-sdk-core", "~> 3"
20
+ s.add_dependency "aws-sdk-ec2", "~> 1"
20
21
 
21
22
  s.files = `git ls-files`.split("\n")
22
23
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -97,7 +97,7 @@ EOS
97
97
  def set_aws_logging
98
98
  if options.verbose
99
99
  require 'logger'
100
- require 'aws-sdk'
100
+ require 'aws-sdk-core'
101
101
  logger = ::Logger.new($stdout)
102
102
  logger.level = ::Logger::DEBUG
103
103
  ::Aws.config.update logger: logger
@@ -1,5 +1,5 @@
1
1
  require 'ec2ssh/exceptions'
2
- require 'aws-sdk'
2
+ require 'aws-sdk-core'
3
3
 
4
4
  module Ec2ssh
5
5
  class Dsl
@@ -1,4 +1,6 @@
1
- require 'aws-sdk'
1
+ require 'aws-sdk-core'
2
+ require 'aws-sdk-ec2'
3
+ require 'ec2ssh/exceptions'
2
4
 
3
5
  module Ec2ssh
4
6
  class Ec2Instances
@@ -1,3 +1,3 @@
1
1
  module Ec2ssh
2
- VERSION = '4.0.0'
2
+ VERSION = '5.0.0'
3
3
  end
@@ -42,14 +42,13 @@ describe 'aws-sdk compatibility' do
42
42
  it { expect(ins.client_token).to match /\A\w{18}\z/ }
43
43
  # it { expect(ins.cpu_options).to be_nil }
44
44
  it { expect(ins.ebs_optimized).to be_falsy }
45
- # it { expect(ins.elastic_gpu_associations).to be_nil }
45
+ it { expect(ins.elastic_gpu_associations).to be_nil }
46
46
  # it { expect(ins.elastic_inference_accelerator_associations).to be_nil }
47
- # it { expect(ins.ena_support).to be_falsy }
47
+ it { expect(ins.ena_support).to be_falsy }
48
48
  # it { expect(ins.hibernation_options).to be_nil}
49
49
  it { expect(ins.hypervisor).to be == 'xen' }
50
50
  it { expect(ins.iam_instance_profile).to have_attributes(arn: /\Aarn:aws:iam::\d+:instance-profile\/[\w\-]+\z/, id: /\A\w{21}\z/) }
51
51
  it { expect(ins.id).to match /\Ai-\w+\z/ }
52
- it { expect(ins.identifiers).to match(id: /\Ai-\w+\z/) }
53
52
  it { expect(ins.image).to be_a(Aws::EC2::Image) }
54
53
  it { expect(ins.image_id).to match /\Aami-\w+\z/ }
55
54
  it { expect(ins.instance_id).to match /\Ai-\w+\z/ }
@@ -57,7 +56,7 @@ describe 'aws-sdk compatibility' do
57
56
  it { expect(ins.instance_type).to match /\A[trmci][1248]\.\w+\z/ }
58
57
  it { expect(ins.kernel_id).to be_nil }
59
58
  it { expect(ins.key_name).to match /\A.+\.pem\z/ }
60
- # it { expect(ins.key_pair).to be_a(Aws::EC2::KeyPairInfo) }
59
+ it { expect(ins.key_pair).to be_a(Aws::EC2::KeyPairInfo) }
61
60
  it { expect(ins.launch_time).to be_a(Time) }
62
61
  # it { expect(ins.licenses).to all have_attributes(license_configuration_arn: '') }
63
62
  it { expect(ins.monitoring).to have_attributes(state: 'disabled') }
@@ -3,40 +3,35 @@
3
3
  # main completion function
4
4
  _ec2ssh-init() {
5
5
  local ret
6
- _call_function ret __ec2ssh_noarg_cmd
6
+ _call_function ret __ec2ssh_common_cmd
7
7
  return $ret
8
8
  }
9
9
 
10
10
  _ec2ssh-remove() {
11
11
  local ret
12
- _call_function ret __ec2ssh_noarg_cmd
12
+ _call_function ret __ec2ssh_common_cmd
13
13
  return $ret
14
14
  }
15
15
 
16
16
  _ec2ssh-update() {
17
- local curcontext context state line
18
- declare -A opt_args
19
-
20
- integer ret=1
21
- _arguments -C -S \
22
- '--aws-key:aws key name' \
23
- '--dotfile:ec2ssh dotfile:_files' \
24
- '--verbose' && return
17
+ local ret
18
+ _call_function ret __ec2ssh_common_cmd
25
19
  return $ret
26
20
  }
27
21
 
28
22
  _ec2ssh-version() {
29
23
  local ret
30
- _call_function ret __ec2ssh_noarg_cmd
24
+ _call_function ret __ec2ssh_common_cmd
31
25
  return $ret
32
26
  }
33
27
 
34
- __ec2ssh_noarg_cmd() {
28
+ __ec2ssh_common_cmd() {
35
29
  local curcontext context state line
36
30
  declare -A opt_args
37
31
 
38
32
  integer ret=1
39
33
  _arguments -C -S \
34
+ '--path:ssh_config file:_files' \
40
35
  '--dotfile:ec2ssh dotfile:_files' \
41
36
  '--verbose' && return
42
37
  return $ret
@@ -49,6 +44,7 @@ _ec2ssh() {
49
44
  integer ret=1
50
45
 
51
46
  _arguments -C -S \
47
+ '--path:ssh_config file:_files' \
52
48
  '--dotfile:ec2ssh dotfile:_files' \
53
49
  '--verbose' \
54
50
  '(-): :->commands' \
metadata CHANGED
@@ -1,57 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ec2ssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Issei Naruta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-13 00:00:00.000000000 Z
11
+ date: 2020-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.14'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0.14'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: highline
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - "~>"
37
+ - - ">="
32
38
  - !ruby/object:Gem::Version
33
39
  version: '1.6'
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '3.0'
34
43
  type: :runtime
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
38
- - - "~>"
47
+ - - ">="
39
48
  - !ruby/object:Gem::Version
40
49
  version: '1.6'
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '3.0'
53
+ - !ruby/object:Gem::Dependency
54
+ name: aws-sdk-core
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '3'
60
+ type: :runtime
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: '3'
41
67
  - !ruby/object:Gem::Dependency
42
- name: aws-sdk
68
+ name: aws-sdk-ec2
43
69
  requirement: !ruby/object:Gem::Requirement
44
70
  requirements:
45
71
  - - "~>"
46
72
  - !ruby/object:Gem::Version
47
- version: '2'
73
+ version: '1'
48
74
  type: :runtime
49
75
  prerelease: false
50
76
  version_requirements: !ruby/object:Gem::Requirement
51
77
  requirements:
52
78
  - - "~>"
53
79
  - !ruby/object:Gem::Version
54
- version: '2'
80
+ version: '1'
55
81
  description: ec2ssh is a ssh_config manager for AWS EC2
56
82
  email:
57
83
  - mimitako@gmail.com
@@ -97,7 +123,8 @@ files:
97
123
  - spec/spec_helper.rb
98
124
  - zsh/_ec2ssh
99
125
  homepage: http://github.com/mirakui/ec2ssh
100
- licenses: []
126
+ licenses:
127
+ - MIT
101
128
  metadata: {}
102
129
  post_install_message:
103
130
  rdoc_options: []
@@ -107,14 +134,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
107
134
  requirements:
108
135
  - - ">="
109
136
  - !ruby/object:Gem::Version
110
- version: 2.2.0
137
+ version: 2.4.0
111
138
  required_rubygems_version: !ruby/object:Gem::Requirement
112
139
  requirements:
113
140
  - - ">="
114
141
  - !ruby/object:Gem::Version
115
142
  version: '0'
116
143
  requirements: []
117
- rubygems_version: 3.0.3
144
+ rubygems_version: 3.1.2
118
145
  signing_key:
119
146
  specification_version: 4
120
147
  summary: A ssh_config manager for AWS EC2