envirobly 1.8.1 → 1.9.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: 9f069dc6d95c23a6de8153725e9079eb5bbd4a5c1d7607e7617e1f8bd98c1acc
4
- data.tar.gz: 98dc46266dcf5fab8fb3b11da3ef5601b75038b4551c88002392696e0f07eb48
3
+ metadata.gz: 67a8f774fbb1618b3b2ed3401af23dd53a0455e3b2439cc540724c95566ee063
4
+ data.tar.gz: 27cf8de4722ce015fcf4be795212912e84319b4ce3a9ca7a293b5ecb01f9631a
5
5
  SHA512:
6
- metadata.gz: 1a3164960b7f76ae4ecbe36d3f12427750b550846a591fad82d3598668ce10e755c7b7886887ab71be327fbde4abf9a43b52e5d8d9b30fe3033f0065a28acf25
7
- data.tar.gz: 4399aef0cb3c883af5441e6e5cfcdf986f2712968a73dfe40baf34c7e017b355837d7b6478ed165c0f7d2a3308626c2ff82b5d33274f4fd91631e923af827b9c
6
+ metadata.gz: 5dc44c7ef4dc39dd1b80e71301309e749cadda497f03a5088c15d20c35af27d5e305751980e824b5503022115aa67afff4968c56c57c09560ec229c690f344af
7
+ data.tar.gz: 8deea030920fa4aacc0d0018e6eb2256c7c7982a2376aedbbcb58f0374e3d26d90a2352e80ec35defb65b3e1515f1c267a491b0d2c9a90f93b536387a39be38f
@@ -40,10 +40,10 @@ class Envirobly::Cli::Main < Envirobly::Base
40
40
  def validate
41
41
  Envirobly::AccessToken.new(shell:).require!
42
42
 
43
- configs = Envirobly::Config.new
43
+ config = Envirobly::Config.new
44
44
  api = Envirobly::Api.new
45
45
 
46
- params = { validation: configs.to_params }
46
+ params = { validation: { configs: config.configs } }
47
47
  api.validate_shape params
48
48
 
49
49
  say "Config is valid #{green_check}"
@@ -1,39 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dotenv"
4
-
5
3
  class Envirobly::Config
6
4
  DIR = ".envirobly"
7
5
  BASE = "deploy.yml"
8
- ENV_VARS = "env"
9
6
  OVERRIDES_PATTERN = /deploy\.([a-z0-9\-_]+)\.yml/i
10
7
 
11
8
  def initialize(dir = DIR)
12
9
  @dir = Pathname.new dir
13
10
  end
14
11
 
15
- def to_params
16
- {
17
- configs:,
18
- env_vars:
19
- }
20
- end
12
+ def configs
13
+ Dir.entries(@dir).map do |file|
14
+ path = File.join(@dir, file)
21
15
 
22
- private
23
- def configs
24
- Dir.entries(@dir).map do |file|
25
- path = File.join(@dir, file)
16
+ next unless File.file?(path) && config_file?(file)
26
17
 
27
- next unless File.file?(path) && config_file?(file)
28
-
29
- [ "#{DIR}/#{file}", File.read(path) ]
30
- end.compact.to_h
31
- end
32
-
33
- def env_vars
34
- Dotenv.parse @dir.join(ENV_VARS), overwrite: true
35
- end
18
+ [ "#{DIR}/#{file}", ERB.new(File.read(path)).result ]
19
+ end.compact.to_h
20
+ end
36
21
 
22
+ private
37
23
  def config_file?(file)
38
24
  file == BASE || file.match?(OVERRIDES_PATTERN)
39
25
  end
@@ -53,7 +53,7 @@ module Envirobly
53
53
  commit_time: @commit.time,
54
54
  commit_message: @commit.message,
55
55
  object_tree_checksum: @commit.object_tree_checksum,
56
- **@config.to_params
56
+ configs: @config.configs
57
57
  }
58
58
  }
59
59
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Envirobly
4
- VERSION = "1.8.1"
4
+ VERSION = "1.9.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: envirobly
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Starsi
@@ -65,20 +65,6 @@ dependencies:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
67
  version: '1.3'
68
- - !ruby/object:Gem::Dependency
69
- name: dotenv
70
- requirement: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: '3.1'
75
- type: :runtime
76
- prerelease: false
77
- version_requirements: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '3.1'
82
68
  - !ruby/object:Gem::Dependency
83
69
  name: activesupport
84
70
  requirement: !ruby/object:Gem::Requirement