terraspace 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/terraspace/app.rb +0 -1
- data/lib/terraspace/booter.rb +18 -2
- data/lib/terraspace/version.rb +1 -1
- metadata +2 -3
- data/lib/terraspace/app/hooks.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02ed3895b8039e7424e31139ce9f8e20c5d4a60142e8d3da64b5a68ce9e52004
|
4
|
+
data.tar.gz: 14617bab09a51e8229a209536585b5ff460355ac2c13cef26dd067b37a878cc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 742c92857e31d85b66e7e232b14facd1745d9a35347e4634732670bd0b011937e4e46bcc7157e83cd9db10025a325004a6b391d21688b1e86c3bacf1ff8e429b
|
7
|
+
data.tar.gz: c3010333589ed88a15541a563cde963ae6d9e500acf519911966636563dadb9c698db9cb933945bf243d838d45b8c1fdf151f0602c887d9cbea09250069c3fa5
|
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.2] - 2021-03-05
|
7
|
+
- [#90](https://github.com/boltops-tools/terraspace/pull/90) Boot hooks: new and improved boot hooks interface
|
8
|
+
- remove old config.hooks.on_boot
|
9
|
+
|
6
10
|
## [0.6.1] - 2021-03-04
|
7
11
|
- [#89](https://github.com/boltops-tools/terraspace/pull/89) rename option to enable_names.expansion
|
8
12
|
|
data/lib/terraspace/app.rb
CHANGED
@@ -29,7 +29,6 @@ module Terraspace
|
|
29
29
|
config.build.clean_cache = nil # defaults to /full/path/to/.terraspace-cache
|
30
30
|
config.bundle = ActiveSupport::OrderedOptions.new
|
31
31
|
config.bundle.logger = ts_logger
|
32
|
-
config.hooks = Hooks.new
|
33
32
|
config.init = ActiveSupport::OrderedOptions.new
|
34
33
|
config.init.mode = "auto" # auto, never, always
|
35
34
|
config.log = ActiveSupport::OrderedOptions.new
|
data/lib/terraspace/booter.rb
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
module Terraspace
|
2
2
|
module Booter
|
3
3
|
def boot
|
4
|
+
run_hooks
|
4
5
|
Terraspace::Bundle.require # load plugins
|
5
6
|
load_plugin_default_configs
|
6
|
-
Terraspace.config # load project config
|
7
|
-
Terraspace::App::Hooks.run_hook(:on_boot)
|
8
7
|
Terraspace::App::Inits.run_all
|
9
8
|
set_plugin_cache!
|
10
9
|
end
|
@@ -24,6 +23,23 @@ module Terraspace
|
|
24
23
|
dir
|
25
24
|
end
|
26
25
|
|
26
|
+
# Special boot hooks run super early, even before plugins are loaded.
|
27
|
+
# Useful for setting env vars and other early things.
|
28
|
+
#
|
29
|
+
# config/boot.rb
|
30
|
+
# config/boot/dev.rb
|
31
|
+
#
|
32
|
+
def run_hooks
|
33
|
+
run_hook
|
34
|
+
run_hook(Terraspace.env)
|
35
|
+
end
|
36
|
+
|
37
|
+
def run_hook(env=nil)
|
38
|
+
name = env ? "boot/#{env}" : "boot"
|
39
|
+
path = "#{Terraspace.root}/config/#{name}.rb"
|
40
|
+
require path if File.exist?(path)
|
41
|
+
end
|
42
|
+
|
27
43
|
extend self
|
28
44
|
end
|
29
45
|
end
|
data/lib/terraspace/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terraspace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -461,7 +461,6 @@ files:
|
|
461
461
|
- lib/terraspace/all/runner.rb
|
462
462
|
- lib/terraspace/all/summary.rb
|
463
463
|
- lib/terraspace/app.rb
|
464
|
-
- lib/terraspace/app/hooks.rb
|
465
464
|
- lib/terraspace/app/inits.rb
|
466
465
|
- lib/terraspace/autoloader.rb
|
467
466
|
- lib/terraspace/booter.rb
|
data/lib/terraspace/app/hooks.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
class Terraspace::App
|
2
|
-
class Hooks
|
3
|
-
class_attribute :hooks
|
4
|
-
self.hooks = {}
|
5
|
-
|
6
|
-
def on_boot(&block)
|
7
|
-
self.class.hooks[:on_boot] = block
|
8
|
-
end
|
9
|
-
|
10
|
-
class << self
|
11
|
-
def run_hook(name)
|
12
|
-
name = name.to_sym
|
13
|
-
hook = hooks[name]
|
14
|
-
hook.call if hook
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|