def environment_names
      yaml_environments =
        Dir[File.join(environments_path, '*.yaml')] \
          .map { |f| File.basename(f, '.yaml').to_s.strip.downcase }

      rb_environments =
        [].map { |f| File.basename(f, '.rb').to_s.strip.downcase }

      duplicate_environments = yaml_environments & rb_environments
      duplicate_environments.each do |dup_env_name|
        warn_log "environment '#{dup_env_name}' found in both YAML and Ruby; skipping."
      end

      (yaml_environments + rb_environments - duplicate_environments).sort
    end
def environment_names
      yaml_environments =
        Dir[File.join(environments_path, '*.yaml')] \
          .map { |f| File.basename(f, '.yaml').to_s.strip.downcase }

      rb_environments =
        [].map { |f| File.basename(f, '.rb').to_s.strip.downcase }

      duplicate_environments = yaml_environments & rb_environments
      duplicate_environments.each do |dup_env_name|
        warn_log "environment '#{dup_env_name}' found in both YAML and Ruby; skipping."
      end

      (yaml_environments + rb_environments - duplicate_environments).sort
    end
TODO: Ruby DSL environments