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 +4 -4
- data/lib/bauble/cli/cli.rb +23 -9
- data/lib/bauble/cli/commands/destroy.rb +2 -0
- data/lib/bauble/cli/commands/preview.rb +2 -0
- data/lib/bauble/cli/commands/up.rb +2 -0
- data/lib/bauble/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4038e4ddfedbab693fec9a16352ab5b3d3bc4e82571f2347d0bb952f6119b9a2
|
4
|
+
data.tar.gz: 9e82f18102c93f287d3bd9426545228593ccb6a60ccf9245825705a179054a94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abe120d39d730f66ff2743d11860c5e9533409df7925a1bb4a9520566a74d3d04c88d02fadc04df27d5276ee30b620c611dd1e1d8b3fe16df37acdafd5d68bf3
|
7
|
+
data.tar.gz: 0c9f648605c6e0787fe4c2969b318b179c3c8395e54745ca43e8c15f7d5e84ed174f87daccfacc7c8d704c6b6fd4447d609533916295ce61dc26ba6361d633e4
|
data/lib/bauble/cli/cli.rb
CHANGED
@@ -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
|
data/lib/bauble/version.rb
CHANGED