Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration capabilities using ENV vars #15881

Merged

Conversation

manmorjim
Copy link
Contributor

@manmorjim manmorjim commented Sep 29, 2020

@manmorjim manmorjim changed the title Reading ENV vars defined within the app_config Configuration capabilities using ENV vars Sep 30, 2020
@manmorjim manmorjim marked this pull request as ready for review September 30, 2020 16:31
@manmorjim manmorjim requested a review from thedae September 30, 2020 16:31
def db_config
@@db_config ||= YAML.load(File.read(db_config_file)).freeze
@@db_config ||= begin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[rubocop] reported by reviewdog 🐶
Style/ClassVars: Replace class var @@db_config with a class instance var.

end

def app_config
@@app_config ||= YAML.load_file(app_config_file).freeze
@@app_config ||= begin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[rubocop] reported by reviewdog 🐶
Style/ClassVars: Replace class var @@app_config with a class instance var.

@manmorjim manmorjim force-pushed the chore/ch107871/configure-cartodb-project-with-environment branch from 99c9c70 to 8a08f89 Compare October 2, 2020 11:14
@@db_config ||= YAML.load(File.read(db_config_file)).freeze
@@db_config ||= begin
template = ERB.new File.new(db_config_file).read
YAML.load(template.result(binding)).freeze
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[rubocop] reported by reviewdog 🐶
Security/YAMLLoad: Prefer using YAML.safe_load over YAML.load.

@@app_config ||= YAML.load_file(app_config_file).freeze
@@app_config ||= begin
template = ERB.new File.new(app_config_file).read
YAML.load(template.result(binding)).freeze
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[rubocop] reported by reviewdog 🐶
Security/YAMLLoad: Prefer using YAML.safe_load over YAML.load.

else
File.join(config_files_root, 'config/database.yml')
end
"#{config_files_root}/config/#{ENV['RAILS_DATABASE_FILE'] || 'database.yml'}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Copy link
Contributor

@thedae thedae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome job, all these changes are improving the overall platform a lot!

@manmorjim manmorjim merged commit b54af33 into master Oct 5, 2020
@manmorjim manmorjim deleted the chore/ch107871/configure-cartodb-project-with-environment branch October 5, 2020 11:13
@thedae thedae mentioned this pull request Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants