gce-host 0.4.1 → 0.4.3

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: 5bc842166068d29ec9ba6970eff056ed3333ae34
4
- data.tar.gz: e5e56f13b34a5d751661422a16050a05fca708e8
3
+ metadata.gz: b9058278fe6965657e42e0852b083ecc42ab3b43
4
+ data.tar.gz: 7d6687397b875e5e477e94c45d4db37c1b1417d2
5
5
  SHA512:
6
- metadata.gz: 2fe1f3f1282e77a9355bee4acdbafc0922062270b337c1aff3cad438052a56b195427df5a1cdb16e0557cdccbba867cf4ed3e991f9dec1fc7922ef089e6331fc
7
- data.tar.gz: 2c9c1191eb1e5550e66a59db81c56d47da9e78831f03d0ccf07eb97a84e8208150eb329d1e9a3042062b6285df03c8638de79c19faf0215e062e101a38d35624
6
+ metadata.gz: 1dac786e7a247fa314955ed1a452e201e57696cf3ed0a0f8d07e8ba18e207392ddcb7a80736f1aadaae98d14231ad3e8838757d2fe809e703969e736044663fe
7
+ data.tar.gz: 57ed8dc3ed59addae4be3745bb671fb7fec1b17248b50af71efe8bb8ec46e1e86e7dff9ad0b065ac51a3275468b288723d109fb24dee3e24a7db3f3f87373eaf
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # 0.4.3 (2017/01/20)
2
+
3
+ Enhancements:
4
+
5
+ * cli: sort by hostname
6
+
7
+ # 0.4.2 (2016/12/08)
8
+
9
+ Enhancements:
10
+
11
+ * Support /etc/google/auth/application_default_credentials.json
12
+
1
13
  # 0.4.1 (2016/12/02)
2
14
 
3
15
  Fixes:
data/lib/gce/host/cli.rb CHANGED
@@ -97,7 +97,7 @@ class GCE
97
97
  end
98
98
 
99
99
  def run
100
- hosts = GCE::Host.new(condition)
100
+ hosts = GCE::Host.new(condition).sort_by {|host| host.hostname }
101
101
  if options[:info]
102
102
  hosts.each do |host|
103
103
  $stdout.puts host.info
@@ -23,11 +23,16 @@ class GCE
23
23
 
24
24
  def self.credentials_file
25
25
  # ref. https://developers.google.com/identity/protocols/application-default-credentials
26
- @credentials_file ||= File.expand_path(ENV['GOOGLE_APPLICATION_CREDENTIALS'] || config.fetch('GOOGLE_APPLICATION_CREDENTIALS', nil) || credentials_file_default)
26
+ @credentials_file ||= File.expand_path(ENV['GOOGLE_APPLICATION_CREDENTIALS'] || config.fetch('GOOGLE_APPLICATION_CREDENTIALS', nil) ||
27
+ (File.exist?(global_application_default_credentials_file) ? global_application_default_credentials_file : application_default_credentials_file))
27
28
  end
28
29
 
29
- def self.credentials_file_default
30
- @credentials_file_default ||= File.expand_path("~/.config/gcloud/application_default_credentials.json")
30
+ def self.application_default_credentials_file
31
+ @application_default_credentials_file ||= File.expand_path("~/.config/gcloud/application_default_credentials.json")
32
+ end
33
+
34
+ def self.global_application_default_credentials_file
35
+ @global_application_default_credentials_file ||= '/etc/google/auth/application_default_credentials.json'
31
36
  end
32
37
 
33
38
  def self.credentials
@@ -27,7 +27,7 @@ class GCE
27
27
  scope = "https://www.googleapis.com/auth/compute.readonly"
28
28
  client = Google::Apis::ComputeV1::ComputeService.new
29
29
  client.client_options.application_name = 'gce-host'
30
- client.client_options.application_name = GCE::Host::VERSION
30
+ client.client_options.application_version = GCE::Host::VERSION
31
31
  client.request_options.retries = Config.retries
32
32
  client.request_options.timeout_sec = Config.timeout_sec
33
33
  client.request_options.open_timeout_sec = Config.open_timeout_sec
@@ -1,5 +1,5 @@
1
1
  class GCE
2
2
  class Host
3
- VERSION = '0.4.1'
3
+ VERSION = '0.4.3'
4
4
  end
5
5
  end
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.4.1
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-02 00:00:00.000000000 Z
11
+ date: 2017-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-api-client