biran 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f486fa4aeeff2d2ec22b1a15a553fc044235c8f15b6c1f4e54e968ad5b1c648
4
- data.tar.gz: df47f776ed09799f9e71d8b3ddb5ad1c8cb80178326a987fe5231e5f6c2b030c
3
+ metadata.gz: 5889906b3c4456f766a2c5204bb4441e3add107cba9db0b1189ba12adb9a55ef
4
+ data.tar.gz: 41799ef23de8827c738b3e9cb0f584782fbab60759e2f742f32327e686fc09f9
5
5
  SHA512:
6
- metadata.gz: ca3af8fb137ff99fdbd6bab2682bf7c8d3231ad4914cb81eba76fa8533e04b35448dfdee22729888e4165e6039b8c36c68a603ddb72ad85b77ea48f7f840d30f
7
- data.tar.gz: 2a466ac6a681c5b64878bcb3bf145584cdfa95dcab0670e57d414525d56650683bab7e6d2513e323bcbf189735fec63d0d6bd8419dbc60b9620cec3ca7a8e1bf
6
+ metadata.gz: 7e06d5684a5c05f46fab522863f68f352f27b4eb176e26feaf5dc7fc31a696498103cb92f861fed51454fc269d04049ae2fabc986043bd9e7d4277852c429885
7
+ data.tar.gz: 02ae8db4a54fb74ccdbb17d1464a56ab6ec5180f5c8c0fd1d34ea6cc5e06aa9a461374d574b84d0185c4c922f965ab5496bbe1ea3fd238ac7699da3c4aae1b8e
@@ -11,11 +11,11 @@ module Biran
11
11
  shared_dir: configuration.shared_dir,
12
12
  base_dir: configuration.base_dir,
13
13
  use_capistrano: configuration.use_capistrano,
14
- db_config: configuration.db_config,
15
- secrets: configuration.secrets,
16
14
  bindings: configuration.bindings,
17
15
  vhost_public_dirname: configuration.vhost_public_dirname
18
- }
16
+ },
17
+ db_config: configuration.db_config,
18
+ secrets: configuration.secrets,
19
19
  }
20
20
  end
21
21
 
@@ -47,7 +47,11 @@ module Biran
47
47
 
48
48
  def local_config_file
49
49
  ENV['BIRAN_LOCAL_CONFIG_FILE'] ||
50
- File.join(app_shared_dir, configuration.config_dirname, configuration.local_config_filename)
50
+ File.join(app_shared_dir, configuration.config_dirname, local_config_filename)
51
+ end
52
+
53
+ def local_config_filename
54
+ ENV['BIRAN_LOCAL_CONFIG_FILENAME'] || app_config_defaults[:app][:local_config_filename] || configuration.local_config_filename
51
55
  end
52
56
 
53
57
  def vhost_public_dirname
@@ -55,15 +59,23 @@ module Biran
55
59
  end
56
60
 
57
61
  def db_config_override_file
58
- File.join(app_shared_dir, configuration.config_dirname, configuration.db_config_filename)
62
+ File.join(app_shared_dir, configuration.config_dirname, db_config_filename)
63
+ end
64
+
65
+ def db_config_filename
66
+ app_config_defaults[:app][:db_config_filename] || configuration.db_config_filename
59
67
  end
60
68
 
61
69
  def secrets_file
62
- File.join(configuration.base_path, configuration.config_dirname, configuration.secrets_filename)
70
+ File.join(configuration.base_path, configuration.config_dirname, secrets_filename)
71
+ end
72
+
73
+ def secrets_filename
74
+ app_config_defaults[:app][:secrets_filename] || configuration.secrets_filename
63
75
  end
64
76
 
65
77
  def default_db_config_file
66
- File.join(config_dir, configuration.db_config_filename)
78
+ File.join(config_dir, db_config_filename)
67
79
  end
68
80
 
69
81
  def use_capistrano?
@@ -53,8 +53,8 @@ module Biran
53
53
  }
54
54
 
55
55
  app_config.deep_merge! app_config_defaults
56
- app_config[:secrets].deep_merge! get_secret_contents(app_config)
57
- app_config[:db_config] = build_db_config
56
+ app_config[:secrets].deep_merge! get_secrets_content(app_config[:secrets_file_path])
57
+ app_config[:db_config].deep_merge! build_db_config
58
58
 
59
59
  app_config.deep_merge! local_config_file_contents
60
60
  end
@@ -103,12 +103,9 @@ module Biran
103
103
  @local_config_contents = process_config_file(local_config_file)
104
104
  end
105
105
 
106
- def get_secret_contents(app_config)
107
- secrets_file_contents = {}
108
- if File.exist? app_config[:secrets_file_path]
109
- secrets_file_contents = process_config_file app_config[:secrets_file_path]
110
- end
111
- secrets_file_contents
106
+ def get_secrets_content(secrets_file)
107
+ return {} unless File.exists? secrets_file
108
+ process_config_file secrets_file
112
109
  end
113
110
 
114
111
  def sanitize_config_files files_list
@@ -1,3 +1,3 @@
1
1
  module Biran
2
- VERSION = '0.1.10'
2
+ VERSION = '0.1.11'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biran
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - javierg
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-09-30 00:00:00.000000000 Z
13
+ date: 2020-04-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: railties