belt 0.2.2 → 0.2.4

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: abb5e5911478ca83dd713847cee268166ad284844fd08f48a20a5d18fc4e00d9
4
- data.tar.gz: e5f94569672c2f8755e663b569f4036fcf5a6e9ad7db8f13470fdc72c93485b2
3
+ metadata.gz: b99fa5db1ad085eaffe7967b3ebd767780190dfdab73f4715d12d57351b556c4
4
+ data.tar.gz: 1dd0a58fe2d7190214a3c88d936d0f868cba27264e469e9450e59a948fbef130
5
5
  SHA512:
6
- metadata.gz: 4eacccd50cc5e40c36f34cbb5fc58f81a71e5e7a84b01c9910312c17438a900e0d00c20caf2162226d290e8739109ecdb9319602272b5b2cf0de43566d6de166
7
- data.tar.gz: 1cd3c537f04c5d0e769a196ca334917558db9d82c9b3eec199656fb9fba53721b68020e5e23e54c9ea1339e0a7cfa977b21b500451d6f36766ef6209a6a94c72
6
+ metadata.gz: 7d9c381fc41b28b4302c17ce25f13bc09adaecfa9f593d1de03437ae0104bdca03b510dcd99578a0a7aa4f931e19e33b6b7426e3145582b25aad2ea3ead6c42c
7
+ data.tar.gz: 9d78f571938ce9236c3103decacb5078e10c9023c29000d0a817d5ac9c5f9cb07312eff1e54323a4cc96db66f13111cb51a87779a1fb4dc99dc656faa3bd2f5e
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'app_detection'
4
3
  require_relative 'env_resolver'
5
4
  require_relative 'terraform_command'
6
5
  require_relative '../inflector'
@@ -11,23 +10,12 @@ module Belt
11
10
  SCHEMA_FILE_CANDIDATES = ['config/schema.tf.rb', 'infrastructure/schema.tf.rb'].freeze
12
11
  MODULE_DIR = 'infrastructure/modules/app'
13
12
 
14
- include AppDetection
15
-
16
13
  def self.run(args)
17
- env = EnvResolver.resolve(args)
18
-
19
- if env.nil?
20
- puts 'Usage: belt setup tables [environment]'
21
- puts "\nReads schema.tf.rb and generates dynamodb.tf in the app module."
22
- puts 'You can also set BELT_ENV to skip the environment argument.'
23
- puts "\nExamples:"
24
- puts ' belt setup tables'
25
- puts ' belt setup tables dev'
26
- puts ' BELT_ENV=dev belt setup tables'
27
- exit 1
28
- end
14
+ # Environment argument accepted for backwards compatibility but unused —
15
+ # dynamodb.tf lives in infrastructure/modules/app and uses var.environment.
16
+ EnvResolver.resolve(args)
29
17
 
30
- new(env).run
18
+ new.run
31
19
  end
32
20
 
33
21
  # Automatically sync dynamodb.tf in the app module.
@@ -35,18 +23,15 @@ module Belt
35
23
  def self.sync_all_environments
36
24
  return unless schema_file_path
37
25
 
38
- # With the module approach, we only need to generate once into modules/app/
39
- new(nil, quiet: true).run
26
+ new(quiet: true).run
40
27
  end
41
28
 
42
29
  def self.schema_file_path
43
30
  SCHEMA_FILE_CANDIDATES.find { |f| File.exist?(f) }
44
31
  end
45
32
 
46
- def initialize(env, quiet: false)
47
- @env = env
33
+ def initialize(quiet: false)
48
34
  @quiet = quiet
49
- @app_name = detect_app_name
50
35
  end
51
36
 
52
37
  def run
@@ -163,7 +148,7 @@ module Belt
163
148
  end
164
149
 
165
150
  def table_name(model_name)
166
- "#{@app_name}-${var.environment}-#{Belt::Inflector.pluralize(model_name)}"
151
+ "${var.app_name}-${var.environment}-#{Belt::Inflector.pluralize(model_name)}"
167
152
  end
168
153
 
169
154
  # Minimal DSL parser for schema.tf.rb
data/lib/belt/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Belt
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: belt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stowzilla