ec2-host 0.0.5 → 0.0.6

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
  SHA1:
3
- metadata.gz: 39704c796daf1f299897478088023581da20e9e0
4
- data.tar.gz: 420dc9a3c497526a6c92b5333a7aed0d63c13968
3
+ metadata.gz: 02bef88973232ed12b815884d0ff5c5e38938921
4
+ data.tar.gz: 88e6ecc818e0afae83cc8b10de6671e3cd74b2aa
5
5
  SHA512:
6
- metadata.gz: 680a2aa0ece4db079131213fc885020972f77126589d59ab6bda67e499fad5ebd04fdae9d7f44d462996a11305cab77d6892fd7e2ce18034d9bfc1acc5c32b7d
7
- data.tar.gz: 79a0df038b0add1222c7317eea2c4da99ee633de7d2b47af409d726121acbd13d7b074a4c8e5de74e473e9a1a66508e3d0aa4a401335283703448b9711407fc0
6
+ metadata.gz: a3d2cc71f802293588dcd184dd1fd18a4f5de92fe57f3f1412b1bc2437258063a13b65ba4b953797e7cbb6963b2ed0967644d7211acf3f9b5a7a523bf6406717
7
+ data.tar.gz: c511301344134ef8bfabddf0686e8ac19e7cc2dddb85647875ade4bafe1653a2c85e8009f15d4e1a7f3bed4606984fc760372ee9e6204760a422def033ce2c11
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.0.6 (2015/08/10)
2
+
3
+ Enhancements:
4
+
5
+ * Add `--private-ip` (alias to `--ip`) and `--public-ip` options
6
+
1
7
  # 0.0.5 (2015/08/10)
2
8
 
3
9
  Changes:
data/README.md CHANGED
@@ -62,6 +62,8 @@ Options:
62
62
  --r1, --usage1, --u1, [--role1=one two three] # role1, the 1st part of role delimited by :
63
63
  --r2, --usage2, --u2, [--role2=one two three] # role2, the 2nd part of role delimited by :
64
64
  --r3, --usage3, --u3, [--role3=one two three] # role3, the 3rd part of role delimited by :
65
+ --ip, [--private-ip], [--no-private-ip] # show private ip address instead of hostname
66
+ [--public-ip], [--no-public-ip] # show public ip address instead of hostname
65
67
  -i, [--info], [--no-info] # show host info, not only hostname
66
68
  [--debug], [--no-debug] # debug mode
67
69
 
data/ec2-host.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "ec2-host"
3
- gem.version = '0.0.5'
3
+ gem.version = '0.0.6'
4
4
  gem.author = ['Naotoshi Seo']
5
5
  gem.email = ['sonots@gmail.com']
6
6
  gem.homepage = 'https://github.com/sonots/ec2-host'
data/lib/ec2/host/cli.rb CHANGED
@@ -30,6 +30,13 @@ class EC2
30
30
  Config.optional_options.each do |opt, tag|
31
31
  option opt, :type => :array, :desc => opt
32
32
  end
33
+ option :private_ip,
34
+ :aliases => %w[--ip],
35
+ :type => :boolean,
36
+ :desc => 'show private ip address instead of hostname'
37
+ option :public_ip,
38
+ :type => :boolean,
39
+ :desc => 'show public ip address instead of hostname'
33
40
  option :info,
34
41
  :aliases => %w[-i],
35
42
  :type => :boolean,
@@ -42,6 +49,14 @@ class EC2
42
49
  EC2::Host.new(condition).each do |host|
43
50
  $stdout.puts host.info
44
51
  end
52
+ elsif options[:private_ip]
53
+ EC2::Host.new(condition).each do |host|
54
+ $stdout.puts host.private_ip_address
55
+ end
56
+ elsif options[:public_ip]
57
+ EC2::Host.new(condition).each do |host|
58
+ $stdout.puts host.public_ip_address
59
+ end
45
60
  else
46
61
  EC2::Host.new(condition).each do |host|
47
62
  $stdout.puts host.hostname
@@ -53,7 +68,7 @@ class EC2
53
68
 
54
69
  def condition
55
70
  return @condition if @condition
56
- _condition = HashUtil.except(options, :info, :debug)
71
+ _condition = HashUtil.except(options, :info, :debug, :private_ip, :public_ip)
57
72
  @condition = {}
58
73
  _condition.each do |key, val|
59
74
  if tag = Config.optional_options[key.to_s]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ec2-host
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo