<commit_before>require 'stackbuilder/stacks/namespace'
require 'stackbuilder/stacks/machine_def'

class Stacks::Services::QuantAppServer < Stacks::MachineDef
  def initialize(virtual_service, index)
    @virtual_service = virtual_service
    super(virtual_service.name + "-" + index)
  end

  def to_enc
    {
      'role::quantapp_server' => {
        'allowed_hosts' => @virtual_service.allowed_hosts,
        'environment'   => environment.name
      }
    }
  end
end<commit_msg>rpearce: Quant app servers should inhierit enc data from machine_def and then add stuff to it.<commit_after>require 'stackbuilder/stacks/namespace'
require 'stackbuilder/stacks/machine_def'

class Stacks::Services::QuantAppServer < Stacks::MachineDef
  def initialize(virtual_service, index)
    @virtual_service = virtual_service
    super(virtual_service.name + "-" + index)
  end

  def to_enc
    enc = super
    enc['role::quantapp_server'] = {
      'allowed_hosts' => @virtual_service.allowed_hosts,
      'environment'   => environment.name
    }
    enc
  end
end
{'fraction_non_alphanumeric': 0.1023696682464455, 'fraction_numerical': 0.0, 'mean_word_length': 4.052631578947368, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3515890', 'n_tokens_mistral': 326, 'n_tokens_neox': 318, 'n_words': 65}