awful 0.0.117 → 0.0.118

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: b587c9a39544b13cbd59286a8b35147d347bcdaf
4
- data.tar.gz: db1b38e95744d3dc1522e77c287daf16ac30fe86
3
+ metadata.gz: 09e5e40087f087c1a4093a20f44f5e9c6f119e55
4
+ data.tar.gz: c7f6ce10622d8587f98ea5ff628dfdede7afcc4d
5
5
  SHA512:
6
- metadata.gz: b4a249a548199a887f4e38f26a60ccb54469a1789bc93cd8039908bab3046f958e1296d91abb59d658ad5ef007691808b2b6768ae4940755895a4bae9542b25c
7
- data.tar.gz: b0e0fa6d37b458b806cccdfde83977f7073be04f5c31abaf4a52eb455f5e721c00a3416ec8f5dcc009bc19e3813dafb5774e97193a1d89d985865fc91f547389
6
+ metadata.gz: 13908719df01ce7c541fcb3305ed7238a0b1129e3691050176e929388d2039c39488a559fd03a5d2ab1e3ce71fb72909e519e6576ee110bb662bd6a6aa5d5348
7
+ data.tar.gz: 8baea9667e705b1ef53394cf6fb7d448b4bf9e2433ed21271eeb50853519359a829f4b8074d9cafa1eb2ea6f40ab1f2263de98706840f81ef48cdcfc6dfd26ea
data/lib/awful.rb CHANGED
@@ -6,14 +6,23 @@ require 'thor'
6
6
  require 'yaml'
7
7
  require 'erb'
8
8
 
9
+ ## our implementation of tap for switchable output
10
+ class Object
11
+ def output
12
+ yield self unless $awful_quiet
13
+ self
14
+ end
15
+ end
16
+
9
17
  module Awful
10
18
  class Cli < Thor
11
19
  class_option :env, aliases: '-e', default: nil, desc: 'Load environment variables from file'
12
- class_option :quiet, aliases: '-q', default: nil, desc: 'Quieten output'
20
+ class_option :quiet, aliases: '-q', type: :boolean, default: false, desc: 'Quieten output'
13
21
  class_option :region, default: nil, desc: 'Set region; can use AWS_REGION instead'
14
22
 
15
23
  def initialize(args = [], local_options = {}, config = {})
16
24
  super
25
+ $awful_quiet = options[:quiet] # turn off output
17
26
  ENV['AWS_REGION'] = options[:region] if options[:region] #cmdline override for region
18
27
  end
19
28
 
@@ -194,7 +194,7 @@ module Awful
194
194
  end
195
195
  end
196
196
 
197
- resources.tap do |resources|
197
+ resources.output do |resources|
198
198
  if options[:long]
199
199
  print_table resources.map { |r| [r.logical_resource_id, r.physical_resource_id, r.resource_type, color(r.resource_status), r.resource_status_reason] }
200
200
  else
data/lib/awful/sqs.rb CHANGED
@@ -32,7 +32,7 @@ module Awful
32
32
  if options[:long]
33
33
  queues.map do |queue|
34
34
  sqs.get_queue_attributes(queue_url: queue, attribute_names: attr).attributes
35
- end.tap do |list|
35
+ end.output do |list|
36
36
  print_table list.map { |q|
37
37
  [
38
38
  q['QueueArn'].split(':').last,
@@ -43,7 +43,7 @@ module Awful
43
43
  }
44
44
  end
45
45
  else
46
- queues.map { |q| q.split('/').last }.tap(&method(:puts))
46
+ queues.map { |q| q.split('/').last }.output(&method(:puts))
47
47
  end
48
48
  end
49
49
 
data/lib/awful/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = '0.0.117'
2
+ VERSION = '0.0.118'
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.117
4
+ version: 0.0.118
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ric Lister
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-07 00:00:00.000000000 Z
11
+ date: 2016-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler