pec2 0.6.3 → 0.7.0

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: d68073713d2afa54a74a21dacb7c053408222bd4c954a82dfd719d385f04bc46
4
- data.tar.gz: e7e5a0d53e551c82008c2bddb65701e4067aa412bceb2e6be3ea817786e2035d
3
+ metadata.gz: 9aae3254890f35de4ab62acc17677af602abffd98fc94750f896ea583b244556
4
+ data.tar.gz: 29a0a05f43fc40628fc3922256847294873e58a4085e47ea805c7e30b2d36ded
5
5
  SHA512:
6
- metadata.gz: 1383b7b694915836ef9ba0b66a51f496d05c0190e54709823ba0538f8ad755db85f76442a603b1ce683792fb313ff9c088ca758c33c7f9cf7353f6127d98a2b3
7
- data.tar.gz: 57064f09a63ad1da242319622637b3f571d2aa86529421264c159d84cac9a5c3e02d24847b035939fb3d6fc4d5e98bbb1955d4ff89e03320109ecdb57b44e455
6
+ metadata.gz: 1b6a39f87cf00d4cd1a1e720a7275409c8304db83260646e3488c0b3baec394c369b321fe39a2f02f78ae98c83d732d56b9efa26010d4b56320961a887fc2382
7
+ data.tar.gz: ea605a802dd27d25631d3159951cd9206d3312ced4a6d5a3c77811e0e12a6ad6fc35d532d1709fc7787cbf4dd3ef55b448a796ec1d78cd772abeb40464e2f128
@@ -5,6 +5,7 @@ rvm:
5
5
  - 2.2.*
6
6
  - 2.3.3
7
7
  - 2.4.0
8
+ - 2.5.1
8
9
 
9
10
  gemfile:
10
11
  - Gemfile
@@ -2,4 +2,5 @@ require 'pec2/version'
2
2
  require 'pec2/constants'
3
3
  require 'pec2/ec2'
4
4
  require 'pec2/pssh'
5
+ require 'pec2/metadata'
5
6
  require 'pec2/cli'
@@ -1,4 +1,4 @@
1
- require 'aws-sdk'
1
+ require 'aws-sdk-ec2'
2
2
  require 'hashie/mash'
3
3
  require 'logger'
4
4
  require 'open-uri'
@@ -49,7 +49,7 @@ module Pec2
49
49
 
50
50
  def get_param(profile)
51
51
  param = {}
52
- region = if profile
52
+ if profile
53
53
  param[:profile] = profile
54
54
  else
55
55
  param[:region] = if ENV['AWS_REGION']
@@ -0,0 +1,24 @@
1
+ require 'open-uri'
2
+
3
+ module Pec2
4
+ class Metadata
5
+ class << self
6
+ def get_document
7
+ JSON.parse(get_metadata('/latest/dynamic/instance-identity/document/'))
8
+ end
9
+
10
+ def get_metadata(path)
11
+ begin
12
+ result = {}
13
+ ::Timeout.timeout(TIME_OUT) {
14
+ body = open('http://169.254.169.254' + path).read
15
+ return body
16
+ }
17
+ return result
18
+ rescue Timeout::Error => e
19
+ raise "not EC2 instance"
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,4 +1,4 @@
1
1
  module Pec2
2
2
  # pec2 version
3
- VERSION = "0.6.3"
3
+ VERSION = "0.7.0"
4
4
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.require_paths = ['lib']
19
19
 
20
20
  gem.add_dependency 'thor'
21
- gem.add_dependency 'aws-sdk', '~> 2.x'
21
+ gem.add_dependency 'aws-sdk-ec2'
22
22
  gem.add_dependency 'hashie'
23
23
  gem.add_dependency 'net-ssh'
24
24
  gem.add_dependency 'parallel'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pec2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - toyama0919
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-22 00:00:00.000000000 Z
11
+ date: 2018-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: aws-sdk
28
+ name: aws-sdk-ec2
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 2.x
33
+ version: '0'
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: 2.x
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: hashie
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -199,6 +199,7 @@ files:
199
199
  - lib/pec2/cli.rb
200
200
  - lib/pec2/constants.rb
201
201
  - lib/pec2/ec2.rb
202
+ - lib/pec2/metadata.rb
202
203
  - lib/pec2/pssh.rb
203
204
  - lib/pec2/version.rb
204
205
  - pec2.gemspec