ec2list 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/ec2list/command.rb +12 -20
- data/lib/ec2list/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9635dfff71696295a1ca4a44cfe0a3e56bab3907
|
4
|
+
data.tar.gz: 5906ee07921a8baeb1f69fb14b2888e4b473fec9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6e859f9a4827d6f6b83e561803edfc490072ca6930978b39eb2e0382191b69a4ea42deabd429b173ca3c33976e3224f57ef311690f01a8bfa5762505a62733e
|
7
|
+
data.tar.gz: d6ecf3b56b26946fa1db18a8caeec555a2a96c4398db2496f2376300df77f1b01f355d271e4e944a0a3ecf31bc87130a503f4079c588701b44575de3fb290957
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# ec2list
|
2
2
|
|
3
3
|
Show running instances on AWS EC2.
|
4
4
|
|
@@ -36,7 +36,7 @@ $ ec2list --profile PROFILE
|
|
36
36
|
|
37
37
|
## Contributing
|
38
38
|
|
39
|
-
1. Fork it ( http://github.com
|
39
|
+
1. Fork it ( http://github.com/a2ikm/ec2list/fork )
|
40
40
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
41
41
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
42
42
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/ec2list/command.rb
CHANGED
@@ -8,14 +8,11 @@ module Ec2list
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def run
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
return
|
11
|
+
AWS.memoize do
|
12
|
+
fetch_instances.each do |instance|
|
13
|
+
print_instance(instance)
|
14
|
+
end
|
16
15
|
end
|
17
|
-
|
18
|
-
print_instances(instances)
|
19
16
|
end
|
20
17
|
|
21
18
|
private
|
@@ -23,21 +20,16 @@ module Ec2list
|
|
23
20
|
def fetch_instances
|
24
21
|
AWS::EC2.new.
|
25
22
|
instances.
|
26
|
-
select { |instance| instance.status == :running }
|
27
|
-
to_a
|
23
|
+
select { |instance| instance.status == :running }
|
28
24
|
end
|
29
25
|
|
30
|
-
def
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
instance.private_ip_address,
|
38
|
-
instance.public_ip_address,
|
39
|
-
].join(",")
|
40
|
-
end
|
26
|
+
def print_instance(instance)
|
27
|
+
tags = instance.tags
|
28
|
+
puts [
|
29
|
+
tags[:Name],
|
30
|
+
instance.private_ip_address,
|
31
|
+
instance.public_ip_address,
|
32
|
+
].join("\t")
|
41
33
|
end
|
42
34
|
|
43
35
|
def build_options(argv)
|
data/lib/ec2list/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ec2list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masato Ikeda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws_config
|