<commit_before># frozen_string_literal: true

class HashicorpFetcher

  def initialize(program, version)
    @program = program
    @prog_ucase = @program.upcase
    @prog_cap = @program.capitalize
    @version = version
  end

  def bin_dir
    "vendor/bin/#{@program}/#{@version}"
  end

  def bin_os
    'linux'
  end

  def bin_arch
    'amd64'<commit_msg>automatically figure out the platform and architecture for HashiCorp downloads<commit_after># frozen_string_literal: true

require 'ffi'

class HashicorpFetcher

  def initialize(program, version)
    @program = program
    @prog_ucase = @program.upcase
    @prog_cap = @program.capitalize
    @version = version
  end

  def bin_dir
    "vendor/bin/#{@program}/#{@version}"
  end

  def bin_os
    FFI::Platform.OS
  end

  def bin_arch
    arch = FFI::Platform.ARCH
    case arch
    when /x86_64|amd64/
      'amd64'
    when /i?86|x86/
      '386'
    else
      arch
    end
{'fraction_non_alphanumeric': 0.09584664536741214, 'fraction_numerical': 0.01810436634717785, 'mean_word_length': 2.983050847457627, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4108238', 'n_tokens_mistral': 345, 'n_tokens_neox': 323, 'n_words': 78}