terraspace 0.6.21 → 0.6.22

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
  SHA256:
3
- metadata.gz: e846de537f7e1a415fa06437138b66342b39742d637843e0dd2ab0f8f308d884
4
- data.tar.gz: e3cac1d61f893d8864496f5a1b8af43e0b5ac142111a2869b077e92a6dd1802e
3
+ metadata.gz: 7a4ab50a302acfb8803dd00d42b67bee179e0524dc425866c6ed56d9a0ad2be5
4
+ data.tar.gz: d59bcf8434474bbbea0352cbcaf253b04112c3bdc8cb18b032fe56619dabf445
5
5
  SHA512:
6
- metadata.gz: bd9fed4ac9bb408d6284bc473966320700e076c3ed0e06461b93c612361527f629e19e88e13c54aba306af6cfe846d8e9aa2f7a408840216583364b5950ebb38
7
- data.tar.gz: 8a3672f6d5cf32f4e4ac44cfa28d4e0577a66e7c5982e66f2a0f2eab94ecdfdf6fda649714e8545353ad65f47c9eebc212a25ae36fa6b8753d11a0244f626964
6
+ metadata.gz: 8f658972433c8e00ee3363beebfa0d55940d0febba4e00562fa77f3bfede938a5fa851cb261f9879ab340348d65aee57c0d324e25b41a1ddaa86478eb7ff2923
7
+ data.tar.gz: 30f54a4f76034c01ed607564acdc4bcaac8f63adf85f120779dc212ec4e7615479a1a71a705f89deecc25dff38fd8e265fe9d8eb5e2b3f6347a4007b8f9e27ca
data/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
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.6.22] - 2021-12-16
7
+ - [#165](https://github.com/boltops-tools/terraspace/pull/165) check if file command is installed
8
+ - [#166](https://github.com/boltops-tools/terraspace/pull/166) add bundler as a dependency
9
+
6
10
  ## [0.6.21] - 2021-12-16
7
11
  - [#164](https://github.com/boltops-tools/terraspace/pull/164) Use Activesupport All
8
12
 
@@ -0,0 +1,35 @@
1
+ require "open3"
2
+
3
+ class Terraspace::Compiler::Strategy::Mod
4
+ class TextFile
5
+ include Terraspace::Util::Logging
6
+
7
+ def initialize(filename)
8
+ @filename = filename
9
+ end
10
+
11
+ @@already_reported = false
12
+ def check
13
+ unless file_installed?
14
+ return true if @@already_reported
15
+ logger.warn <<~EOL.color(:yellow)
16
+ WARN: The command 'file' is not installed.
17
+ Unable to check if files are text or binary files as a part of the Terraspace compile processing.
18
+ Assuming all files are not binary file.
19
+
20
+ Please install the file command to remove this warning message.
21
+ EOL
22
+ @@already_reported = true
23
+ return true
24
+ end
25
+ # Thanks: https://stackoverflow.com/questions/2355866/ruby-how-to-determine-if-file-being-read-is-binary-or-text
26
+ file_type, status = Open3.capture2e("file", @filename)
27
+ status.success? && file_type.include?("text")
28
+ end
29
+
30
+ private
31
+ def file_installed?
32
+ system("type file > /dev/null 2>&1")
33
+ end
34
+ end
35
+ end
@@ -1,5 +1,3 @@
1
- require "open3"
2
-
3
1
  module Terraspace::Compiler::Strategy
4
2
  class Mod < AbstractBase
5
3
  def run
@@ -16,10 +14,9 @@ module Terraspace::Compiler::Strategy
16
14
  "Terraspace::Compiler::Strategy::Mod::#{ext.camelize}".constantize rescue Mod::Pass
17
15
  end
18
16
 
19
- # Thanks: https://stackoverflow.com/questions/2355866/ruby-how-to-determine-if-file-being-read-is-binary-or-text
17
+ private
20
18
  def text_file?(filename)
21
- file_type, status = Open3.capture2e("file", filename)
22
- status.success? && file_type.include?("text")
19
+ TextFile.new(filename).check
23
20
  end
24
21
  end
25
22
  end
@@ -1,3 +1,3 @@
1
1
  module Terraspace
2
- VERSION = "0.6.21"
2
+ VERSION = "0.6.22"
3
3
  end
data/terraspace.gemspec CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "activesupport"
22
+ spec.add_dependency "bundler"
22
23
  spec.add_dependency "cli-format"
23
24
  spec.add_dependency "deep_merge"
24
25
  spec.add_dependency "dsl_evaluator"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terraspace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.21
4
+ version: 0.6.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: cli-format
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -614,6 +628,7 @@ files:
614
628
  - lib/terraspace/compiler/strategy/mod/base.rb
615
629
  - lib/terraspace/compiler/strategy/mod/pass.rb
616
630
  - lib/terraspace/compiler/strategy/mod/rb.rb
631
+ - lib/terraspace/compiler/strategy/mod/text_file.rb
617
632
  - lib/terraspace/compiler/strategy/mod/tf.rb
618
633
  - lib/terraspace/compiler/strategy/mod/tfvars.rb
619
634
  - lib/terraspace/compiler/strategy/tfvar.rb