<commit_before>#
# Copyright 2016 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name "rust"
default_version "1.12.0"

license "Apache-2.0"
license_file "LICENSE-APACHE"

# Nightly releases use a slighty different URL and TARBALL naming convention
if version =~ /\d{4}-\d{2}-\d{2}/
  relative_path_template = "rust-nightly-%{arch}-%{host_triple}"
  url_template = "https://static.rust-lang.org/dist/#{version}/rust-nightly-%{arch}-%{host_triple}.tar.gz"
else
  relative_path_template = "rust-#{version}-%{arch}-%{host_triple}"
  url_template = "https://static.rust-lang.org/dist/rust-#{version}-%{arch}-%{host_triple}.tar.gz"
end

# Default architecture is x86_64
arch = "x86_64"

if windows?
  host_triple = "pc-windows-gnu"

  if windows_arch_i386?
    arch = "i686"

    version "1.12.0" do
      source sha256: "1662a0a706b71402a358f36b9d2415983bf96e491b61eece2f56744c12ca9e24",
             url: url_template % { host_triple: host_triple, arch: arch }
    end

    version "1.9.0" do
      source sha256: "df2dfd8a455769c183f764b109786fb96ecd6af2a10912e86342d9d4df16ea82",
             url: url_template % { host_triple: host_triple, arch: arch }
    end

    version "1.8.0" do
      source sha256: "5cc8049edcd2d350d621227fdc52b19bf9668bcad4a39868dabbcc69a9a50aef",
             url: url_template % { host_triple: host_triple, arch: arch }
    end

    version "2015-10-03" do
      source md5: "e56f92d70db368027f01c4d9fe69ec9f",
             url: url_template % { host_triple: host_triple, arch: arch }
    end
  else
    version "1.9.0" do
      source sha256: "0b052f2c7541dd10ad7ea61402a6a4381acbac4bb43feef6bd8ee89c5d815412",
             url: url_template % { host_triple: host_triple, arch: arch }
    end

    version "1.8.0" do
      source sha256: "f07fbab9b9ab87c3337fbf9bb078420b4a9ba769b2f03009db9732a081d0f436",
             url: url_template % { host_triple: host_triple, arch: arch }
    end

    version "2015-10-03" do
      source md5: "25ae6f2624a02fde12d515779a238658",
             url: url_template % { host_triple: host_triple, arch: arch }
    end
  end

elsif mac_os_x?
  host_triple = "apple-darwin"

  version "1.12.0" do
    source sha256: "a4d3a19acc1d7a5f1fa42b52c17f72f19edac594612de9b54128477d4ee2f5e5",
           url: url_template % { host_triple: host_triple, arch: arch }
  end<commit_msg>[rust] use sha for tar.gz not binary packages<commit_after>#
# Copyright 2016 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name "rust"
default_version "1.12.0"

license "Apache-2.0"
license_file "LICENSE-APACHE"

# Nightly releases use a slighty different URL and TARBALL naming convention
if version =~ /\d{4}-\d{2}-\d{2}/
  relative_path_template = "rust-nightly-%{arch}-%{host_triple}"
  url_template = "https://static.rust-lang.org/dist/#{version}/rust-nightly-%{arch}-%{host_triple}.tar.gz"
else
  relative_path_template = "rust-#{version}-%{arch}-%{host_triple}"
  url_template = "https://static.rust-lang.org/dist/rust-#{version}-%{arch}-%{host_triple}.tar.gz"
end

# Default architecture is x86_64
arch = "x86_64"

if windows?
  host_triple = "pc-windows-gnu"

  if windows_arch_i386?
    arch = "i686"

    version "1.12.0" do
      source sha256: "15f5e3d41984afc14be7858d88ee9de0945352ab0df6e2954a1a872dad4ed343",
             url: url_template % { host_triple: host_triple, arch: arch }
    end

    version "1.9.0" do
      source sha256: "df2dfd8a455769c183f764b109786fb96ecd6af2a10912e86342d9d4df16ea82",
             url: url_template % { host_triple: host_triple, arch: arch }
    end

    version "1.8.0" do
      source sha256: "5cc8049edcd2d350d621227fdc52b19bf9668bcad4a39868dabbcc69a9a50aef",
             url: url_template % { host_triple: host_triple, arch: arch }
    end

    version "2015-10-03" do
      source md5: "e56f92d70db368027f01c4d9fe69ec9f",
             url: url_template % { host_triple: host_triple, arch: arch }
    end
  else
    version "1.12.0" do
      source sha256: "66bf7cd73400f1046a971870735f5aad17d1b12a3b93f7c6d8fdb4b381d31365",
             url: url_template % { host_triple: host_triple, arch: arch }
    end

    version "1.9.0" do
      source sha256: "0b052f2c7541dd10ad7ea61402a6a4381acbac4bb43feef6bd8ee89c5d815412",
             url: url_template % { host_triple: host_triple, arch: arch }
    end

    version "1.8.0" do
      source sha256: "f07fbab9b9ab87c3337fbf9bb078420b4a9ba769b2f03009db9732a081d0f436",
             url: url_template % { host_triple: host_triple, arch: arch }
    end

    version "2015-10-03" do
      source md5: "25ae6f2624a02fde12d515779a238658",
             url: url_template % { host_triple: host_triple, arch: arch }
    end
  end

elsif mac_os_x?
  host_triple = "apple-darwin"

  version "1.12.0" do
    source sha256: "608c4530dcbd2e29c9600a0743b1a83a62556c9525385a7e1a7ba4aa1467a132",
           url: url_template % { host_triple: host_triple, arch: arch }
  end
{'fraction_non_alphanumeric': 0.10067340067340068, 'fraction_numerical': 0.12946127946127947, 'mean_word_length': 3.6523101018010964, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '3358589', 'n_tokens_mistral': 2619, 'n_tokens_neox': 2255, 'n_words': 499}