Skip to content

Commit 8ab6b66

Browse files
author
Ilya N. Zykin
committed
Change some paths
1 parent 624c684 commit 8ab6b66

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

kit/base/common_paths.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
class DeployKit
22
def kit_templates_path
3-
'__TEMPLATES__'
3+
"__ENV__/#{ app_env }/__TEMPLATES__"
44
end
55

66
def kit_configs_path
7-
'__ENV__'
7+
"__ENV__/#{ app_env }/__SETTINGS__"
88
end
99

1010
# COMMON PATHS

kit/base/configs.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ def config
55

66
def configs_load!
77
::Config.load_and_set_settings('')
8-
puts "#{ ::KIT_ROOT }/#{ kit_configs_path }/#{ app_env }/*.yml"
8+
puts "#{ ::KIT_ROOT }/#{ kit_configs_path }/*.yml"
99

10-
Dir["#{ ::KIT_ROOT }/#{ kit_configs_path }/#{ app_env }/*.yml"].each do |settings_file|
10+
Dir["#{ ::KIT_ROOT }/#{ kit_configs_path }/*.yml"].each do |settings_file|
1111
::Settings.add_source!(settings_file)
1212
puts ('Settings: LOAD FILE => `' + settings_file + '`').light_cyan
1313
end

kit/base/template_upload.rb

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
class DeployKit
22
def template_upload from, to, params = {}
3-
tmpl_file = ::KIT_ROOT + "/#{ kit_templates_path }/#{ app_env }/#{ from }"
4-
5-
unless File.exist? tmpl_file
6-
return log_output "File: #{ tmpl_file } doesn't exist"
7-
end
8-
3+
tmpl_file = ::KIT_ROOT + "/#{ kit_templates_path }/#{ from }"
4+
return log_output "File: #{ tmpl_file } doesn't exist" unless File.exist? tmpl_file
95
namespace = OpenStruct.new(params.merge({kit: self, config: config}))
10-
erb = File.read ::KIT_ROOT + "/#{ kit_templates_path }/#{ app_env }/#{ from }"
11-
res = ERB.new(erb).result(namespace.instance_eval { binding })
6+
7+
erb = File.read tmpl_file
8+
res = ERB.new(erb).result(namespace.instance_eval { binding })
129

1310
log_output(res)
1411

0 commit comments

Comments
 (0)