Module: Terraspace::Core
Constant Summary collapse
- @@root =
nil
Instance Method Summary collapse
- #cache_root ⇒ Object
- #check_project! ⇒ Object
-
#config ⇒ Object
Generally, use the Terraspace.config instead of App.instance.config since it guarantees the load_project_config call.
- #configure(&block) ⇒ Object
- #env ⇒ Object
- #logger ⇒ Object
- #root ⇒ Object
-
#root=(v) ⇒ Object
allow testing frameworks to switch roots.
- #tmp_root ⇒ Object
Instance Method Details
#cache_root ⇒ Object
20 21 22 |
# File 'lib/terraspace/core.rb', line 20 def cache_root ENV['TS_CACHE_ROOT'] || config.build.cache_root || "#{root}/.terraspace-cache" end |
#check_project! ⇒ Object
46 47 48 49 50 |
# File 'lib/terraspace/core.rb', line 46 def check_project! return if File.exist?("#{Terraspace.root}/config/app.rb") logger.error "ERROR: It doesnt look like this is a terraspace project. Are you sure you are in a terraspace project?".color(:red) ENV['TS_TEST'] ? raise : exit(1) end |
#config ⇒ Object
Generally, use the Terraspace.config instead of App.instance.config since it guarantees the load_project_config call
35 36 37 38 |
# File 'lib/terraspace/core.rb', line 35 def config App.instance.load_project_config App.instance.config end |
#configure(&block) ⇒ Object
30 31 32 |
# File 'lib/terraspace/core.rb', line 30 def configure(&block) App.instance.configure(&block) end |
#env ⇒ Object
5 6 7 |
# File 'lib/terraspace/core.rb', line 5 def env ENV['TS_ENV'] || "dev" end |
#logger ⇒ Object
41 42 43 |
# File 'lib/terraspace/core.rb', line 41 def logger config.logger end |
#root ⇒ Object
11 12 13 |
# File 'lib/terraspace/core.rb', line 11 def root @@root ||= ENV['TS_ROOT'] || Dir.pwd end |
#root=(v) ⇒ Object
allow testing frameworks to switch roots
16 17 18 |
# File 'lib/terraspace/core.rb', line 16 def root=(v) @@root = v end |
#tmp_root ⇒ Object
25 26 27 |
# File 'lib/terraspace/core.rb', line 25 def tmp_root ENV['TS_TMP_ROOT'] || "/tmp/terraspace" end |