humidifier 3.1.0 → 3.2.0

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
  SHA256:
3
- metadata.gz: 70a3a43a433113df153ba4a97f549ac007299f91fb5c0a266dea0cbb70303712
4
- data.tar.gz: 1e81ad0413783a00d1c0067334319634ceac86185de55e73fbe2c747f237b328
3
+ metadata.gz: c9749be8bf3c40d687aa0bbfa621217d24602a6a5e699f73ca8d9976d832d434
4
+ data.tar.gz: 979e18cdd21419cefb86777023eb5b83141791e8e71c2ecbd61ec2923a978ac9
5
5
  SHA512:
6
- metadata.gz: 7626be05d2483a66ab1909fcf7bb515609fc5eb7fb404b648b10554af1501fb801c0625250258d2675ed056803acfc4a42d238f8ca1696447c1dc16165da795d
7
- data.tar.gz: 4f9d3167302db844968d433b12e82c8128f538fad1f27da6d0ecdcd8cd7398c5d8fd2fc36da15bf03bd1a2334b065307a4709e7f7e10aeb22e1198345da8d56f
6
+ metadata.gz: 85a581839598db66f812683d43593110d7e1c490d841796891f6afaf06fdc8d841bd5aad327829f18eb48db1317b74a01a5775e0d9802da1c8b5dc0437a6cbb2
7
+ data.tar.gz: 4482de13f30f23bec06908bbcb4f690831fea3e833b9d5d33ffa2e57d2b629d528f0106e5950aebf66af1bea32fad62baa785da811a0b798687f79feb1819591
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Build Status](https://travis-ci.org/localytics/humidifier.svg?branch=master)](https://travis-ci.org/localytics/humidifier)
4
4
  [![Gem Version](https://img.shields.io/gem/v/humidifier.svg?maxAge=3600)](https://rubygems.org/gems/humidifier)
5
5
 
6
- Humidifier allows you to build AWS CloudFormation (CFN) templates programmatically. CFN stacks and resources are represented as Ruby objects with accessors for all their supported properties. Stacks and resources have `to_cf` methods that allow you to quickly inspect what will be uploaded.
6
+ Humidifier is a ruby tool for managing [AWS CloudFormation](https://aws.amazon.com/cloudformation/) stacks. You can use it to build and manage stacks programmatically or you can use it as a command line tool to manage stacks through configuration files.
7
7
 
8
8
  - [Installation](#installation)
9
9
  - [Getting started](#getting-started)
@@ -17,7 +17,7 @@ module Humidifier
17
17
  stack_names_from(name).each do |stack_name|
18
18
  directory = Directory.new(stack_name)
19
19
 
20
- puts "Creating a changeset for #{directory.stack_name}"
20
+ puts "🛠 Creating a changeset for #{directory.stack_name}"
21
21
  directory.create_change_set
22
22
  end
23
23
  end
@@ -32,7 +32,7 @@ module Humidifier
32
32
  stack_names_from(name).each do |stack_name|
33
33
  directory = Directory.new(stack_name, prefix: options[:prefix])
34
34
 
35
- puts "Deploying #{directory.stack_name}"
35
+ puts "🚀 Deploying #{directory.stack_name}"
36
36
  directory.deploy(options[:wait], parameters_from(parameters))
37
37
  end
38
38
  end
@@ -40,12 +40,16 @@ module Humidifier
40
40
  desc 'display [stack] [?pattern]',
41
41
  'Display the CloudFormation JSON for a given stack'
42
42
  def display(name, pattern = nil)
43
- puts Directory.new(name, pattern: pattern && /#{pattern}/i).to_cf
43
+ directory = Directory.new(name, pattern: pattern && /#{pattern}/i)
44
+
45
+ puts "📄 Displaying #{directory.stack_name}"
46
+ puts directory.to_cf
44
47
  end
45
48
 
46
49
  desc 'stacks', 'List the stacks known to Humidifier'
47
50
  def stacks
48
- puts Humidifier.config.stack_names.sort
51
+ puts '🗒 Listing stacks'
52
+ puts Humidifier.config.stack_names.sort.map { |name| "- #{name}" }
49
53
  end
50
54
 
51
55
  desc 'upload [?stack]', 'Upload one or all stacks to S3'
@@ -55,7 +59,7 @@ module Humidifier
55
59
  stack_names_from(name).each do |stack_name|
56
60
  directory = Directory.new(stack_name)
57
61
 
58
- puts "Uploading #{directory.stack_name}"
62
+ puts "📬 Uploading #{directory.stack_name}"
59
63
  directory.upload
60
64
  end
61
65
  end
@@ -65,7 +69,7 @@ module Humidifier
65
69
  def validate(name = nil)
66
70
  authorize
67
71
 
68
- print 'Validating... '
72
+ print '🔍 Validating... '
69
73
 
70
74
  valid =
71
75
  stack_names_from(name).all? do |stack_name|
@@ -75,7 +79,7 @@ module Humidifier
75
79
  puts valid ? 'Valid.' : 'Invalid.'
76
80
  end
77
81
 
78
- no_commands do
82
+ no_commands do # rubocop:disable Metrics/BlockLength
79
83
  def authorize
80
84
  return unless options[:aws_profile]
81
85
 
@@ -90,13 +94,23 @@ module Humidifier
90
94
  end
91
95
  end
92
96
 
97
+ def prelude
98
+ command = @_invocations.values.dig(0, 0)
99
+ command = command ? "#{command} " : ''
100
+ puts "\033[1mhumidifier #{command}v#{VERSION}\033[0m"
101
+ end
102
+
93
103
  def safe_execute
104
+ prelude
105
+ start = Time.now.to_f
94
106
  yield
95
107
  rescue Error => error
96
108
  raise error if options[:debug]
97
109
 
98
110
  puts error.message
99
111
  exit 1
112
+ else
113
+ puts '✨ Done in %.2fs.' % (Time.now.to_f - start)
100
114
  end
101
115
 
102
116
  def stack_names_from(name)
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Humidifier
4
- # Gem version
5
- VERSION = '3.1.0'
4
+ VERSION = '3.2.0'
6
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: humidifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Localytics