diff options
author | Sarah German <sgerman@gitlab.com> | 2022-10-01 08:28:02 +0300 |
---|---|---|
committer | David O'Regan <doregan@gitlab.com> | 2022-10-01 08:28:02 +0300 |
commit | 1284380196bca81375fecb71400e09798a5c0578 (patch) | |
tree | c1e8993599202ba97f638dd618f723826d624faa /lib | |
parent | e6dfcbc18d36c2ecc976460a68b0ab24f9225481 (diff) |
Remove unused Version-related functions
Diffstat (limited to 'lib')
-rw-r--r-- | lib/helpers/versions.rb | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/lib/helpers/versions.rb b/lib/helpers/versions.rb index 7ec7fe11..ea98b966 100644 --- a/lib/helpers/versions.rb +++ b/lib/helpers/versions.rb @@ -5,18 +5,6 @@ module Nanoc::Helpers STABLE_VERSIONS_REGEX = %r{^\d{1,2}\.\d{1,2}$}.freeze # - # Set the active class based on CI_COMMIT_REF_NAME and exclude if on - # the archives page, otherwise we would end up with two active links. - # - def active_dropdown(selection) - if archives? - active_class if selection == 'archives' - elsif selection == ENV['CI_COMMIT_REF_NAME'] - active_class - end - end - - # # Determines whether or not to display the version banner on the frontend. # # Note: We only want the banner to display on production. @@ -35,20 +23,6 @@ module Nanoc::Helpers end # - # Check if we are on the /archives page - # - def archives? - @item.identifier.to_s.split('/')[1] == 'archives' - end - - # - # Define the active CSS class - # - def active_class - %( class="active") - end - - # # Stable versions regexp # # At most two digits for major and minor numbers. @@ -57,45 +31,5 @@ module Nanoc::Helpers version.match?(STABLE_VERSIONS_REGEX) end - def data_versions - @items['/_data/versions.yaml'] - end - - def next_version - latest_stable = data_versions[:online].first - latest_major, latest_minor = latest_stable.split('.') - _, last_minor = data_versions[:last_before_new_major].first.split('.') - - # - # If the minor version of the latest online version - # is equal to last_minor, bump the major version - # and set patch to 0. This is for the case where a new - # major version is the next version to be released. - # - if latest_minor == last_minor - "#{latest_major.to_i + 1}.0" - else - "#{latest_major}.#{latest_minor.to_i + 1}" - end - end - - def dotcom - "GitLab.com (#{next_version}-pre)" - end - - def version_dropdown_title - return 'Archives' if archives? - return 'Versions' unless production? - - if ENV['CI_COMMIT_REF_NAME'] == ENV['CI_DEFAULT_BRANCH'] - dotcom - else - ENV['CI_COMMIT_REF_NAME'] - end - end - - def display_previous_versions? - !omnibus? - end end end |