gce-host 0.1.0 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/example/example.conf +1 -1
- data/gce-host.gemspec +3 -1
- data/lib/gce/host/config.rb +2 -2
- data/lib/gce/host/host_data.rb +6 -2
- data/lib/gce/host/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: a53b02a45029bc391a5e91a76fe7a7a876c4c25a
|
4
|
+
data.tar.gz: 9aaf79efe08d1dd1aca249238a0b033eeafec1ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e842f07851050bdb5ef066d14163f24300a059ef1302851010d9dc201994ebd4310621e5fca21ad13aa69a1726e9813074060d9f5e0c5ae633718ce6578f0dae
|
7
|
+
data.tar.gz: 649c7dd20e39d3d13a297d99f6883848eb1fe66a9f9ff9706cb0a2086425f1211e6af092ec6561c9b4e6fd286d1b1ddbe4703808999ac3caa0c357e265c4e4d3
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
# 0.1.3 (2016/11/24)
|
2
|
+
|
3
|
+
Enhancements:
|
4
|
+
|
5
|
+
* Support ~ (home directory) in GCE_HOST_CONFIG_FILE and GOOGLE_CREDENTIAL_FILE
|
6
|
+
|
7
|
+
# 0.1.2 (2016/11/24)
|
8
|
+
|
9
|
+
yanked
|
10
|
+
|
11
|
+
# 0.1.1 (2016/11/24)
|
12
|
+
|
13
|
+
Enhancements:
|
14
|
+
|
15
|
+
* Add machine_type to show
|
16
|
+
|
1
17
|
# 0.1.0 (2016/11/18)
|
2
18
|
|
3
19
|
first version
|
20
|
+
|
data/example/example.conf
CHANGED
data/gce-host.gemspec
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
require_relative 'lib/gce/host/version'
|
2
|
+
|
1
3
|
Gem::Specification.new do |gem|
|
2
4
|
gem.name = "gce-host"
|
3
|
-
gem.version =
|
5
|
+
gem.version = GCE::Host::VERSION
|
4
6
|
gem.author = ['Naotoshi Seo']
|
5
7
|
gem.email = ['sonots@gmail.com']
|
6
8
|
gem.homepage = 'https://github.com/sonots/gce-host'
|
data/lib/gce/host/config.rb
CHANGED
@@ -11,7 +11,7 @@ class GCE
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.config_file
|
14
|
-
@config_file ||= ENV.fetch('GCE_HOST_CONFIG_FILE', '/etc/sysconfig/gce-host')
|
14
|
+
@config_file ||= File.expand_path(ENV.fetch('GCE_HOST_CONFIG_FILE', '/etc/sysconfig/gce-host'))
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.auth_method
|
@@ -19,7 +19,7 @@ class GCE
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.credential_file
|
22
|
-
@credential_file ||= ENV['GOOGLE_CREDENTIAL_FILE'] || config.fetch('GOOGLE_CREDENTIAL_FILE'
|
22
|
+
@credential_file ||= File.expand_path(ENV['GOOGLE_CREDENTIAL_FILE'] || config.fetch('GOOGLE_CREDENTIAL_FILE'))
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.project
|
data/lib/gce/host/host_data.rb
CHANGED
@@ -51,6 +51,10 @@ class GCE
|
|
51
51
|
instance.zone.split('/').last
|
52
52
|
end
|
53
53
|
|
54
|
+
def machine_type
|
55
|
+
instance.machine_type.split('/').last
|
56
|
+
end
|
57
|
+
|
54
58
|
def private_ip_address
|
55
59
|
instance.network_interfaces.first.network_ip
|
56
60
|
end
|
@@ -121,7 +125,6 @@ class GCE
|
|
121
125
|
params = {
|
122
126
|
"hostname" => hostname,
|
123
127
|
"roles" => roles,
|
124
|
-
"zone" => zone,
|
125
128
|
}
|
126
129
|
Config.optional_string_keys.each do |key|
|
127
130
|
field = StringUtil.underscore(key)
|
@@ -132,7 +135,8 @@ class GCE
|
|
132
135
|
params[field] = send(field)
|
133
136
|
end
|
134
137
|
params.merge!(
|
135
|
-
"
|
138
|
+
"zone" => zone,
|
139
|
+
"machine_type" => machine_type,
|
136
140
|
"private_ip_address" => private_ip_address,
|
137
141
|
"public_ip_address" => public_ip_address,
|
138
142
|
"creation_timestamp" => creation_timestamp,
|
data/lib/gce/host/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gce-host
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-api-client
|