bauble_core 0.5.0 → 0.5.1

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: b7034535f46acc0915d5b0af4bfb6010532fec91ece688550e52e48c07d82026
4
- data.tar.gz: faa95128a0a9ad6b1c5605dbdc679d95d614f02a618eb32fc5bd5cb8d69b5456
3
+ metadata.gz: 4038e4ddfedbab693fec9a16352ab5b3d3bc4e82571f2347d0bb952f6119b9a2
4
+ data.tar.gz: 9e82f18102c93f287d3bd9426545228593ccb6a60ccf9245825705a179054a94
5
5
  SHA512:
6
- metadata.gz: 0efa58c139a9177ada9f992803e2bf1e3bdf9c4d0230790b305286dc96722e9ebf8cf66360533f3e996b99531ddcb5fe91f3ac045cce907f464090b7f73ac8bb
7
- data.tar.gz: 37a17a1b8301e61cd494b997438ffb1630f8eddc9e2b8dd06fd89ff5f7ef8b5d2504341279bc839a8a65549b0710b586b5e1e9b457c5fd3bd3786db3125b0fb0
6
+ metadata.gz: abe120d39d730f66ff2743d11860c5e9533409df7925a1bb4a9520566a74d3d04c88d02fadc04df27d5276ee30b620c611dd1e1d8b3fe16df37acdafd5d68bf3
7
+ data.tar.gz: 0c9f648605c6e0787fe4c2969b318b179c3c8395e54745ca43e8c15f7d5e84ed174f87daccfacc7c8d704c6b6fd4447d609533916295ce61dc26ba6361d633e4
@@ -9,6 +9,7 @@ require_relative 'commands/destroy'
9
9
  require_relative 'commands/new'
10
10
  require_relative 'pulumi'
11
11
  require_relative '../application'
12
+ require_relative 'logger'
12
13
 
13
14
  module Bauble
14
15
  module Cli
@@ -21,19 +22,24 @@ module Bauble
21
22
 
22
23
  attr_accessor :app, :config
23
24
 
24
- def initialize(*args)
25
- super
26
- require_entrypoint
27
- @app = ObjectSpace.each_object(Bauble::Application).first
28
- raise 'No App instance found' unless @app
29
-
30
- build_config
31
- end
32
-
33
25
  def self.exit_on_failure?
34
26
  true
35
27
  end
36
28
 
29
+ no_commands do
30
+ def setup_app
31
+ require_entrypoint
32
+ @app = ObjectSpace.each_object(Bauble::Application).first
33
+
34
+ unless @app
35
+ Logger.error 'No Bauble::Application object found'
36
+ exit 1
37
+ end
38
+
39
+ build_config
40
+ end
41
+ end
42
+
37
43
  private
38
44
 
39
45
  def pulumi
@@ -60,10 +66,18 @@ module Bauble
60
66
  end
61
67
 
62
68
  def bauble_json
69
+ unless File.exist?('bauble.json')
70
+ Logger.error 'No bauble.json file found'
71
+ exit 1
72
+ end
63
73
  @bauble_json ||= JSON.parse(File.read('bauble.json'))
64
74
  end
65
75
 
66
76
  def require_entrypoint
77
+ unless bauble_json['entrypoint']
78
+ Logger.error 'No entrypoint found in bauble.json'
79
+ exit 1
80
+ end
67
81
  Kernel.require "#{Dir.pwd}/#{bauble_json['entrypoint']}"
68
82
  end
69
83
  end
@@ -19,6 +19,8 @@ module Bauble
19
19
  Logger.logo
20
20
  Logger.nl
21
21
 
22
+ setup_app
23
+
22
24
  # check for any stacks
23
25
  raise 'No stacks found' if @app.stacks.empty?
24
26
 
@@ -18,6 +18,8 @@ module Bauble
18
18
  def preview
19
19
  Logger.logo
20
20
 
21
+ setup_app
22
+
21
23
  # check for any stacks
22
24
  raise 'No stacks found' if @app.stacks.empty?
23
25
 
@@ -18,6 +18,8 @@ module Bauble
18
18
  def up
19
19
  Logger.logo
20
20
 
21
+ setup_app
22
+
21
23
  # check for any stacks
22
24
  raise 'No stacks found' if @app.stacks.empty?
23
25
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bauble
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bauble_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Hoegerl