<commit_before>class DeployMetadata::Railtie < Rails::Railtie

  initializer "deploy_metadata" do

    def DeployMetadata.current
      {}.tap { |h|
        h["Instance started"] = Started.to_s
        h["App deployed"] = Deployed.to_s
        h["Current revision"] = Revision.to_s
      }
    end

    Started = DeployMetadata::Cache.new lambda {
      Time.now.strftime('%c')
    }

    Deployed = DeployMetadata::Cache.new lambda {
      Time.parse(Rails.root.split.last.to_s).in_time_zone('Pacific Time (US & Canada)').strftime('%c')
    }

    Revision = DeployMetadata::Cache.new lambda {
      version = nil
      [ Rails.root.join("../../shared/cached-copy/.git"), Rails.root.join(".git") ].each do |appdir|
        if Dir.exists?(appdir)
          version = `git --git-dir #{appdir} describe --all`.chomp
          break
        end
      end
      version
    }

  end

end<commit_msg>Show all times in Pacific, describe on tags<commit_after>class DeployMetadata::Railtie < Rails::Railtie

  initializer "deploy_metadata" do

    def DeployMetadata.current
      {}.tap { |h|
        h["Instance started"] = Started.to_s
        h["App deployed"] = Deployed.to_s
        h["Current revision"] = Revision.to_s
      }
    end

    Started = DeployMetadata::Cache.new lambda {
      Time.now.in_time_zone('Pacific Time (US & Canada)').strftime('%c')
    }

    Deployed = DeployMetadata::Cache.new lambda {
      Time.parse(Rails.root.split.last.to_s).in_time_zone('Pacific Time (US & Canada)').strftime('%c')
    }

    Revision = DeployMetadata::Cache.new lambda {
      version = nil
      [ Rails.root.join("../../shared/cached-copy/.git"), Rails.root.join(".git") ].each do |appdir|
        if Dir.exists?(appdir)
          version = `git --git-dir #{appdir} describe --tags`.chomp
          break
        end
      end
      version
    }

  end

end
{'fraction_non_alphanumeric': 0.14216738197424894, 'fraction_numerical': 0.0, 'mean_word_length': 2.4473197781885396, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1530637', 'n_tokens_mistral': 631, 'n_tokens_neox': 594, 'n_words': 119}