<commit_before><% title "#{@project} #{@version} on #{@project.platform_name} - Libraries" %>
<% description project_description(@project, @version) %>
<% if @version_count > 0 %>
  <% content_for :atom, auto_discovery_link_tag(:atom, project_versions_url({format: "atom"}.merge(@project.to_param))) %>
<% elsif @github_repository && @github_tags.length > 0 %>
  <% content_for :atom, auto_discovery_link_tag(:atom, project_tags_url({format: "atom"}.merge(@project.to_param))) %>
<% end %>

<% cache_if(logged_out?, [@project, @version, 'projects:show', 'v1'], :expires_in => 1.week) do %>
<div class="row">
  <div class='col-md-8'>
    <h1>
      <div class="pictogram pictogram-<%= @project.platform.downcase %>"></div>
      <%= @project %>
      <small>
        <% if @version %>
          <%= @version %>
        <% else %>
          <%= @project.latest_version %>
        <% end %>
      </small>
    </h1>
  </div>
  <div class='col-md-4'>
    <h1>
      <% if logged_in? %>
        <% if current_user.muted?(@project) %>
          <%= link_to unmute_project_path(@project.to_param), method: :delete, class: 'btn btn-danger tip', title: "Unmute #{@project.name}" do %>
            <i class='fa fa-microphone-slash'></i>
          <% end %>
        <% end %>
      <% end %>
      <% if logged_in? && current_user.subscribed_to?(@project) %>
        <%= link_to 'Unsubscribe from updates', subscription_path(current_user.subscribed_to?(@project)), method: :delete, class: 'btn btn-danger tip', title: 'Stop being notified of new releases of this library' %>
      <% elsif logged_in? %>
        <%= link_to 'Subscribe to Releases', subscribe_path(project_id: @project.id), class: 'tip btn btn-success', rel: 'nofollow', title: 'Get notified by email of new releases of this library' %>
      <% else %>
        <%= link_to 'Subscribe to Releases', subscribe_path(project_id: @project.id), class: 'tip btn btn-success', rel: 'nofollow', title: 'Login with GitHub to get notified by email of new releases' %>
      <% end %>
      <% if logged_in? && current_user.admin? %>
        <%= link_to 'Edit in Admin', admin_project_path(@project.id), class: 'btn btn-primary', rel: 'nofollow' %>
      <% end %>
    </h1>
  </div>
</div>

<div class='row'>
  <div class='col-md-8'>
    <% if @project.description.present? %>
    <p>
      <%= @project.description %>
    </p>
    <% end %>

    <% if @project.homepage.present? && @project.homepage != package_link(@project, @project.platform) %>
    <p>
      Homepage: <%= link_to(@project.homepage, sanitize_url(@project.homepage)) %>
    </p>
    <% end %>

    <p>
      Platform: <%= link_to @project.platform_name, platform_path(@project.platform.downcase) %>
    </p>

    <% if @project.language.present? %>
    <p>
      Language: <%= link_to @project.language, language_path(@project.language) %>
    </p>
    <% end %>

    <% if @project.normalized_licenses.present? %>
    <p>
      <%= 'License'.pluralize(@project.normalized_licenses.length) %>: <%= linked_licenses @project.normalized_licenses %>
    </p>
    <% end %>

    <% if @project.keywords_array.present? %>
    <p>
      Keywords: <%= linked_keywords @project.keywords_array %>
    </p>
    <% end %>

    <% if @project.repository_url.present? && @project.repository_url != @project.homepage %>
    <p>
      Repository: <%= link_to @project.repository_url, @project.repository_url %>
    </p>
    <% end %>

    <% if link = package_link(@project, @project.platform, @version.try(:number)) %>
    <p>
      View on registry: <%= link_to truncate(link, length: 70), link %>
    </p>
    <% end %>

    <% if link = documentation_url(@project.name, @project.platform, @version.try(:number) || @project.latest_version ) %>
    <p>
      Documentation: <%= link_to truncate(link, length: 70), link %>
    </p>
    <% end %>

    <% if install_instructions(@project, @project.platform, @version.try(:number)) %>
      <p>
        Install:
        <code>
          <%= install_instructions(@project, @project.platform, @version.try(:number)) %>
        </code>
      </p>
    <% end %>

    <% if @github_repository.present? && @github_repository.readme.present? %>
    <hr>
    <%== @github_repository.readme %>
    <% end %>

    <div class="row">
      <% cache("projects:#{@project.id}:dependents", :expires_in => 3.days) do  %>
        <% dependents = @project.dependent_projects(per_page: 10) %>
        <% dependent_repos = @project.dependent_repositories.open_source.limit(10) %>
        <% if dependent_repos.length > 0 || dependents.length > 0 || @dependencies.length > 0 %>
          <hr>
        <% end %>
        <% if dependent_repos.length > 0 || dependents.length > 0 %>
          <div class="col-md-6">
            <% if dependents.length > 0 %>
              <div>
                <h4>Dependent Projects</h4>
                <ul>
                  <% dependents.each do |project| %>
                  <li>
                    <%= link_to project.name, project_path(project.to_param) %>
                  </li>
                  <% end %>
                </ul>
                <%= link_to "See all dependent projects", project_dependents_path(@project.to_param) %>
              </div>
            <% end %>
            <% if dependent_repos.length > 0 %>
              <div>
                <h4>Dependent Repositories</h4>
                <ul>
                  <% dependent_repos.each do |repo| %>
                  <li>
                    <%= link_to repo.full_name, github_repository_path(repo.owner_name, repo.project_name) %>
                  </li>
                  <% end %>
                </ul>
                <%= link_to "See all dependent repositories", project_dependent_repos_path(@project.to_param) %>
              </div>
            <% end %>
          </div>
        <% end %>
      <% end %>

      <div class="col-md-6">
        <% if @dependencies.length > 0 %>
          <% @dependencies.group_by(&:kind).each do |kind, dependencies| %>
            <h4><%= kind.humanize unless kind == 'normal' %> Dependencies</h4>
            <ul>
              <% dependencies.each do |dependency| %>
                <li>
                  <%= link_to dependency.project_name, project_path(name: dependency.project_name, platform: dependency_platform(dependency.platform)) %>
                  <%= dependency.requirements %>
                </li>
              <% end %>
            </ul>
          <% end %>
        <% end %>
        <% if current_user %>
          <% your_dependent_repos = current_user.your_dependent_repos(@project) %>
          <% if your_dependent_repos.length > 0 %>
            <h4>Your Dependent Repositories</h4>
            <ul>
              <% your_dependent_repos.limit(10).each do |repo| %>
                <li>
                <%= link_to repo.full_name, github_repository_path(repo.owner_name, repo.project_name) %>
                </li>
              <% end %>
            </ul>
            <% if your_dependent_repos.count > 10 %><commit_msg>Show fork/lock icons next to dependent repo lists<commit_after><% title "#{@project} #{@version} on #{@project.platform_name} - Libraries" %>
<% description project_description(@project, @version) %>
<% if @version_count > 0 %>
  <% content_for :atom, auto_discovery_link_tag(:atom, project_versions_url({format: "atom"}.merge(@project.to_param))) %>
<% elsif @github_repository && @github_tags.length > 0 %>
  <% content_for :atom, auto_discovery_link_tag(:atom, project_tags_url({format: "atom"}.merge(@project.to_param))) %>
<% end %>

<% cache_if(logged_out?, [@project, @version, 'projects:show', 'v1'], :expires_in => 1.week) do %>
<div class="row">
  <div class='col-md-8'>
    <h1>
      <div class="pictogram pictogram-<%= @project.platform.downcase %>"></div>
      <%= @project %>
      <small>
        <% if @version %>
          <%= @version %>
        <% else %>
          <%= @project.latest_version %>
        <% end %>
      </small>
    </h1>
  </div>
  <div class='col-md-4'>
    <h1>
      <% if logged_in? %>
        <% if current_user.muted?(@project) %>
          <%= link_to unmute_project_path(@project.to_param), method: :delete, class: 'btn btn-danger tip', title: "Unmute #{@project.name}" do %>
            <i class='fa fa-microphone-slash'></i>
          <% end %>
        <% end %>
      <% end %>
      <% if logged_in? && current_user.subscribed_to?(@project) %>
        <%= link_to 'Unsubscribe from updates', subscription_path(current_user.subscribed_to?(@project)), method: :delete, class: 'btn btn-danger tip', title: 'Stop being notified of new releases of this library' %>
      <% elsif logged_in? %>
        <%= link_to 'Subscribe to Releases', subscribe_path(project_id: @project.id), class: 'tip btn btn-success', rel: 'nofollow', title: 'Get notified by email of new releases of this library' %>
      <% else %>
        <%= link_to 'Subscribe to Releases', subscribe_path(project_id: @project.id), class: 'tip btn btn-success', rel: 'nofollow', title: 'Login with GitHub to get notified by email of new releases' %>
      <% end %>
      <% if logged_in? && current_user.admin? %>
        <%= link_to 'Edit in Admin', admin_project_path(@project.id), class: 'btn btn-primary', rel: 'nofollow' %>
      <% end %>
    </h1>
  </div>
</div>

<div class='row'>
  <div class='col-md-8'>
    <% if @project.description.present? %>
    <p>
      <%= @project.description %>
    </p>
    <% end %>

    <% if @project.homepage.present? && @project.homepage != package_link(@project, @project.platform) %>
    <p>
      Homepage: <%= link_to(@project.homepage, sanitize_url(@project.homepage)) %>
    </p>
    <% end %>

    <p>
      Platform: <%= link_to @project.platform_name, platform_path(@project.platform.downcase) %>
    </p>

    <% if @project.language.present? %>
    <p>
      Language: <%= link_to @project.language, language_path(@project.language) %>
    </p>
    <% end %>

    <% if @project.normalized_licenses.present? %>
    <p>
      <%= 'License'.pluralize(@project.normalized_licenses.length) %>: <%= linked_licenses @project.normalized_licenses %>
    </p>
    <% end %>

    <% if @project.keywords_array.present? %>
    <p>
      Keywords: <%= linked_keywords @project.keywords_array %>
    </p>
    <% end %>

    <% if @project.repository_url.present? && @project.repository_url != @project.homepage %>
    <p>
      Repository: <%= link_to @project.repository_url, @project.repository_url %>
    </p>
    <% end %>

    <% if link = package_link(@project, @project.platform, @version.try(:number)) %>
    <p>
      View on registry: <%= link_to truncate(link, length: 70), link %>
    </p>
    <% end %>

    <% if link = documentation_url(@project.name, @project.platform, @version.try(:number) || @project.latest_version ) %>
    <p>
      Documentation: <%= link_to truncate(link, length: 70), link %>
    </p>
    <% end %>

    <% if install_instructions(@project, @project.platform, @version.try(:number)) %>
      <p>
        Install:
        <code>
          <%= install_instructions(@project, @project.platform, @version.try(:number)) %>
        </code>
      </p>
    <% end %>

    <% if @github_repository.present? && @github_repository.readme.present? %>
    <hr>
    <%== @github_repository.readme %>
    <% end %>

    <div class="row">
      <% cache("projects:#{@project.id}:dependents", :expires_in => 3.days) do  %>
        <% dependents = @project.dependent_projects(per_page: 10) %>
        <% dependent_repos = @project.dependent_repositories.open_source.limit(10) %>
        <% if dependent_repos.length > 0 || dependents.length > 0 || @dependencies.length > 0 %>
          <hr>
        <% end %>
        <% if dependent_repos.length > 0 || dependents.length > 0 %>
          <div class="col-md-6">
            <% if dependents.length > 0 %>
              <div>
                <h4>Dependent Projects</h4>
                <ul>
                  <% dependents.each do |project| %>
                  <li>
                    <%= link_to project.name, project_path(project.to_param) %>
                  </li>
                  <% end %>
                </ul>
                <%= link_to "See all dependent projects", project_dependents_path(@project.to_param) %>
              </div>
            <% end %>
            <% if dependent_repos.length > 0 %>
              <div>
                <h4>Dependent Repositories</h4>
                <ul>
                  <% dependent_repos.each do |repo| %>
                  <li>
                    <%= link_to repo.full_name, github_repository_path(repo.owner_name, repo.project_name) %>
                    <small>
                      <%= fa_icon("lock") if repo.private? %>
                      <%= fa_icon("code-fork") if repo.fork? %>
                    </small>
                  </li>
                  <% end %>
                </ul>
                <%= link_to "See all dependent repositories", project_dependent_repos_path(@project.to_param) %>
              </div>
            <% end %>
          </div>
        <% end %>
      <% end %>

      <div class="col-md-6">
        <% if @dependencies.length > 0 %>
          <% @dependencies.group_by(&:kind).each do |kind, dependencies| %>
            <h4><%= kind.humanize unless kind == 'normal' %> Dependencies</h4>
            <ul>
              <% dependencies.each do |dependency| %>
                <li>
                  <%= link_to dependency.project_name, project_path(name: dependency.project_name, platform: dependency_platform(dependency.platform)) %>
                  <%= dependency.requirements %>
                </li>
              <% end %>
            </ul>
          <% end %>
        <% end %>
        <% if current_user %>
          <% your_dependent_repos = current_user.your_dependent_repos(@project) %>
          <% if your_dependent_repos.length > 0 %>
            <h4>Your Dependent Repositories</h4>
            <ul>
              <% your_dependent_repos.limit(10).each do |repo| %>
                <li>
                  <%= link_to repo.full_name, github_repository_path(repo.owner_name, repo.project_name) %>
                  <small>
                    <%= fa_icon("lock") if repo.private? %>
                    <%= fa_icon("code-fork") if repo.fork? %>
                  </small>
                </li>
              <% end %>
            </ul>
            <% if your_dependent_repos.count > 10 %>
{'fraction_non_alphanumeric': 0.1670127353266888, 'fraction_numerical': 0.005952380952380952, 'mean_word_length': 2.21589138660138, 'pattern_counts': {'":': 0, '<': 357, '<?xml version=': 0, '>': 385, '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': '6252475', 'n_tokens_mistral': 4926, 'n_tokens_neox': 4295, 'n_words': 873}