terraspace 0.3.5 → 0.3.6
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/terraspace/cli/logs.rb +2 -0
- data/lib/terraspace/cli/logs/tasks.rb +13 -1
- data/lib/terraspace/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 28bdb53824befd6a98263c63612db913c5496546ef751ed408500b4140ac57c4
|
|
4
|
+
data.tar.gz: fe844bdeb2dacfbecfa954a912bfa4ef3e5b4e6265d2eea697d072d8533b2fd5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7e01f4b80088de2c7a3f3f1c8ac81a401b4a999cbb3fbc4af78651ee8e1788246dcb8b889172b94ea5ff7a7932a4874f27e225f66dedac2603a5752a20fb383c
|
|
7
|
+
data.tar.gz: c0ca89b09e3d8ca3f36f6d2f513fedbaa29aad071af4c4c6e99c38438b8c2002582adaa49b2f7105becde5e2ac21785a7f5617b9c5fd1fd60ea25fbaadda7a54
|
data/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
|
5
5
|
|
|
6
|
+
## [0.3.6]
|
|
7
|
+
* #44 improve logs management commands: `terraspace logs remove` and `terraspace logs truncate`
|
|
8
|
+
|
|
6
9
|
## [0.3.5]
|
|
7
10
|
* #43 rename `terraform_output` helper to `output`. Keep `terraform_output` for backwards compatibility
|
|
8
11
|
* to_ruby natural interface to access output with full power of Ruby
|
data/lib/terraspace/cli/logs.rb
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
class Terraspace::CLI
|
|
2
2
|
class Logs < Terraspace::Command
|
|
3
|
+
class_option :yes, aliases: :y, type: :boolean, desc: "bypass are you sure prompt"
|
|
4
|
+
|
|
3
5
|
desc "truncate", "Truncates logs. IE: Keeps the files but removes contents and zero bytes the files."
|
|
4
6
|
long_desc Help.text("logs/truncate")
|
|
5
7
|
def truncate
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
class Terraspace::CLI::Logs
|
|
2
2
|
class Tasks
|
|
3
|
+
include Terraspace::Util::Sure
|
|
4
|
+
|
|
3
5
|
def initialize(options={})
|
|
4
6
|
@options = options
|
|
7
|
+
Terraspace.check_project!
|
|
5
8
|
end
|
|
6
9
|
|
|
7
10
|
def truncate
|
|
8
|
-
|
|
11
|
+
are_you_sure?("truncate")
|
|
9
12
|
log_files.each do |path|
|
|
10
13
|
File.open(path, "w").close # truncates files
|
|
11
14
|
end
|
|
12
15
|
end
|
|
13
16
|
|
|
14
17
|
def remove
|
|
18
|
+
are_you_sure?("remove")
|
|
15
19
|
puts "Removing all files in #{pretty_log_root}/" unless @options[:mute]
|
|
16
20
|
FileUtils.rm_rf(log_root)
|
|
17
21
|
FileUtils.mkdir_p(log_root)
|
|
@@ -28,5 +32,13 @@ class Terraspace::CLI::Logs
|
|
|
28
32
|
def log_root
|
|
29
33
|
Terraspace.config.log.root
|
|
30
34
|
end
|
|
35
|
+
|
|
36
|
+
def are_you_sure?(action)
|
|
37
|
+
message = <<~EOL.chomp
|
|
38
|
+
Will #{action} all the log files in #{pretty_log_root}/ folder
|
|
39
|
+
Are you sure?
|
|
40
|
+
EOL
|
|
41
|
+
sure?(message) # from Util::Sure
|
|
42
|
+
end
|
|
31
43
|
end
|
|
32
44
|
end
|
data/lib/terraspace/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: terraspace
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tung Nguyen
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-10-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|