awful 0.0.171 → 0.0.172

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5e271b33a82255cbcf89c429f453e6898f18f6f
4
- data.tar.gz: a5574862027dbbca488ecca8cda684afc67b2b8c
3
+ metadata.gz: 11f3cb0c491ac167ce83ba7326586888a905752f
4
+ data.tar.gz: c2801481c9b3c861b41ec6e4441bb9c853883c59
5
5
  SHA512:
6
- metadata.gz: cdb6f4c673893747db30f3737946427a0362c8c7bde149db3619aa325d83a0896b7cfbd8152dcce21f60c96a653b9444e22351a0efae24cbd00e5e87260cf9d1
7
- data.tar.gz: 7e834c77e5219254544e709d37a4d135b5b75b0a9a9249c3312572702b7144eff090dbda5585b98d8d8c23aee19704a80783c38babf4067f68b159e7203a26d6
6
+ metadata.gz: 8fb2c497bddc4ea72cd40ed37dd0bf08c824cd4acb44aba51120ff0768064ae029485ad194fc968e159403850a67d233cbd680bd82fb6ecf4b14c94730ac9b81
7
+ data.tar.gz: 8e89918143775690bdd23bca9060198e54c68916bdc20d048116a7c4544df8846f18f14732a59cffdcf6eb8b571e5bef440d9a852937df90c423c1c6c82e51b4
@@ -1,4 +1,4 @@
1
- require "awful/version"
1
+ require 'awful/version'
2
2
 
3
3
  require 'dotenv'
4
4
  require 'aws-sdk'
@@ -18,6 +18,7 @@ module Awful
18
18
  class Cli < Thor
19
19
  class_option :env, aliases: '-e', type: :string, default: nil, desc: 'Load environment variables from file'
20
20
  class_option :quiet, aliases: '-q', type: :boolean, default: false, desc: 'Quieten output'
21
+ class_option :yes, type: :boolean, default: false, desc: 'Always answer yes to prompts'
21
22
  class_option :region, type: :string, default: nil, desc: 'Set region; can use AWS_REGION instead'
22
23
 
23
24
  def initialize(args = [], local_options = {}, config = {})
@@ -27,6 +28,11 @@ module Awful
27
28
  end
28
29
 
29
30
  no_commands do
31
+ ## override thor yes? method to handle our yes option
32
+ def yes?(statement, color = nil)
33
+ options[:yes] ? say("#{statement} yes", color) : super(statement, color)
34
+ end
35
+
30
36
  def ec2
31
37
  @ec2 ||= Aws::EC2::Client.new
32
38
  end
@@ -78,15 +78,16 @@ module Awful
78
78
  end
79
79
 
80
80
  desc 'login [REGISTRIES]', 'run docker login for registry'
81
- method_option :email, aliases: '-E', type: :string, default: 'none', desc: 'Email for docker login command'
81
+ method_option :email, type: :string, default: nil, desc: 'Email for docker login command'
82
82
  method_option :print, aliases: '-p', type: :boolean, default: false, desc: 'Print docker login command instead of running it'
83
83
  def login(*registries)
84
84
  cmd = options[:print] ? :puts : :system
85
85
  registries = nil if registries.empty?
86
+ email = options[:email] ? "-e #{options[:email]}" : '' # -e deprecated as of 1.14, here for older docker clients
86
87
  ecr.get_authorization_token(registry_ids: registries).authorization_data.output do |auths|
87
88
  auths.each do |auth|
88
89
  user, pass = Base64.decode64(auth.authorization_token).split(':')
89
- send(cmd, "docker login -u #{user} -p #{pass} -e #{options[:email]} #{auth.proxy_endpoint}")
90
+ send(cmd, "docker login -u #{user} -p #{pass} #{email} #{auth.proxy_endpoint}")
90
91
  end
91
92
  end
92
93
  end
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = '0.0.171'
2
+ VERSION = '0.0.172'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.171
4
+ version: 0.0.172
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ric Lister
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-07 00:00:00.000000000 Z
11
+ date: 2017-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler