<commit_before>require 'rubygems'
require 'active_support'

module Deploy

  class Error

  end

  class << Error

    def not_implemented(method)
      new("The method:[#{method}] hasn't been implemented yet.")
    end

  end

  class Version

    attr_accessor :current_version, :deployed_by, :time_zone

    def initialize
      @deployed_time = Time.now
    end

    def load_from_url
      raise Error.not_implemented
    end

    def load_from_file
      raise Error.not_implemented
    end

    def store_to_file(filename)
      File.open(filename, 'w+') do |file|
        file.puts export
      end
    end

    def time_zone=(value = 'EST')
      Time.zone = value
      @deployed_time = Time.zone.now
    end

    def deployed_time
      @deployed_time
    end

    def export
      {
        :current_version => @current_version,
        :deployed_by => @deployed_by,
        :deployed_time => deployed_time
      }.to_yaml
    end

  end

end
<commit_msg>export with yaml!<commit_after>require 'rubygems'
require 'active_support'
require 'yaml'

module Deploy

  class Error

  end

  class << Error

    def not_implemented(method)
      new("The method:[#{method}] hasn't been implemented yet.")
    end

  end

  class Version

    attr_accessor :current_version, :deployed_by, :time_zone

    def initialize
      @deployed_time = Time.now
    end

    def load_from_url
      raise Error.not_implemented
    end

    def load_from_file
      raise Error.not_implemented
    end

    def store_to_file(filename)
      File.open(filename, 'w+') do |file|
        file.puts export
      end
    end

    def time_zone=(value = 'EST')
      Time.zone = value
      @deployed_time = Time.zone.now
    end

    def deployed_time
      @deployed_time
    end

    def to_h
      {
        :current_version => @current_version,
        :deployed_by => @deployed_by,
        :deployed_time => deployed_time
      }
    end

    def export
      YAML::dump(to_h)
    end

  end

end

{'fraction_non_alphanumeric': 0.07738693467336684, 'fraction_numerical': 0.0, 'mean_word_length': 2.3018242122719736, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '6573471', 'n_tokens_mistral': 672, 'n_tokens_neox': 635, 'n_words': 159}