Sha256: 74bea91febb0d053e2addc78d2b40fff10c52c0644eac1001710c7c6a48b1b7d

Contents?: true

Size: 611 Bytes

Versions: 16

Compression:

Stored size: 611 Bytes

Contents

module AlephExecutables
  class ImportEnvFile
    ENV_YML = 'env.yml'
    # if a env.yml exists in the config path, try to write an .env file
    def self.execute!(config_path, rails_env = 'development')
      env_yaml_path = File.join(config_path, ENV_YML)
      return nil unless File.exists?(File.expand_path(env_yaml_path))

      env_writer = EnvWriter.new(rails_env)
      env_data = YAML.load_file(env_yaml_path)

      env_writer.merge(aleph_config_path: config_path)
      env_data.each do |k, v|
        env_writer.merge({ k.downcase.to_sym => v })
      end
      env_writer.write!
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
aleph_analytics-0.4.9.pre.dev bin/executables/lib/import_env_file.rb
aleph_analytics-0.4.8 bin/executables/lib/import_env_file.rb
aleph_analytics-0.4.7 bin/executables/lib/import_env_file.rb
aleph_analytics-0.4.4 bin/executables/lib/import_env_file.rb
aleph_analytics-0.4.2 bin/executables/lib/import_env_file.rb
aleph_analytics-0.4.1 bin/executables/lib/import_env_file.rb
aleph_analytics-0.3.0 bin/executables/lib/import_env_file.rb
aleph_analytics-0.2.0 bin/executables/lib/import_env_file.rb
aleph_analytics-0.1.0 bin/executables/lib/import_env_file.rb
aleph_analytics-0.0.6 bin/executables/lib/import_env_file.rb
aleph_analytics-0.0.5 bin/executables/lib/import_env_file.rb
aleph_analytics-0.0.4 bin/executables/lib/import_env_file.rb
aleph_analytics-0.0.3 bin/executables/lib/import_env_file.rb
aleph_analytics-0.0.2 bin/executables/lib/import_env_file.rb
aleph_analytics-0.0.1.alpha bin/executables/lib/import_env_file.rb
aleph_analytics-0.0.0.alpha bin/executables/lib/import_env_file.rb