<commit_before>
module Freightrain
  
  class FreightRegion

    def initialize(name, options)
      viewmodel_name = options[:viewmodel] || name
      @viewmodel = Freightrain[(viewmodel_name.to_s + "_view_model").to_sym]
      @container = name.to_s + "_region"
    end

    def viewmodel
      return @viewmodel
    end

    def on_show(view)
      p "#{@viewmodel.class.name} in #{view.class.name}"
      container = view.send(@container)
      view.class.wrap_container(container).plug_in(@viewmodel.show)
      p "end #{@viewmodel.class.name}"
    end

    def change(viewmodel, view)
      new_viewmodel = Freightrain[(viewmodel.to_s + "_view_model").to_sym]
      if new_viewmodel != @viewmodel
        p new_viewmodel
        @viewmodel = new_viewmodel
        container = view.send(@container)
        view.class.wrap_container(container).plug_in(@viewmodel.show)
      end
    end

  end

end<commit_msg>removed tracing<commit_after>
module Freightrain
  
  class FreightRegion

    def initialize(name, options)
      viewmodel_name = options[:viewmodel] || name
      @viewmodel = Freightrain[(viewmodel_name.to_s + "_view_model").to_sym]
      @container = name.to_s + "_region"
    end

    def viewmodel
      return @viewmodel
    end

    def on_show(view)
      container = view.send(@container)
      view.class.wrap_container(container).plug_in(@viewmodel.show)
    end

    def change(viewmodel, view)
      new_viewmodel = Freightrain[(viewmodel.to_s + "_view_model").to_sym]
      if new_viewmodel != @viewmodel
        @viewmodel = new_viewmodel
        container = view.send(@container)
        view.class.wrap_container(container).plug_in(@viewmodel.show)
      end
    end

  end

end
{'fraction_non_alphanumeric': 0.10338785046728972, 'fraction_numerical': 0.0, 'mean_word_length': 2.993006993006993, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6528258', 'n_tokens_mistral': 554, 'n_tokens_neox': 538, 'n_words': 103}