Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/patch-release-version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
inputs:
MAJOR_VERSION:
type: choice
description: 'Major version (current)'
description: 'Major version'
options: ['7', '8']
MINOR_VERSION:
type: choice
description: 'Minor version (current)'
description: 'Minor version'
options: ['12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25']
PATCH_VERSION:
type: choice
Expand Down
6 changes: 2 additions & 4 deletions integtest/spec/all_books_change_detection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,14 @@ def self.build_one_book_then_two_books(
shared_examples 'toc and version drop down' do
shared_examples 'correct' do
context 'the version drop down' do
let(:master_current) { current == 'master' ? ' (current)' : '' }
let(:master_option) do
<<~HTML.strip
<option value="master"#{master_selected}>master#{master_current}</option>
<option value="master"#{master_selected}>master</option>
HTML
end
let(:foo_current) { current == 'foo' ? ' (current)' : '' }
let(:foo_option) do
<<~HTML.strip
<option value="foo"#{foo_selected}>foo#{foo_current}</option>
<option value="foo"#{foo_selected}>foo</option>
HTML
end
it 'contains all versions' do
Expand Down
16 changes: 8 additions & 8 deletions integtest/spec/all_books_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -625,14 +625,14 @@ def self.setup_example(repo, lang, hash)
context 'the live versions drop down' do
it 'contains only the live branches' do
expect(body).to include(<<~HTML.strip)
<select id="live_versions"><option value="master" selected>master</option><option value="0.10">0.10 (current)</option><option value="0.9_oldbutlive">0.9_oldbutlive</option><option value="other">other versions</option></select>
<select id="live_versions"><option value="master" selected>master</option><option value="0.10">0.10</option><option value="0.9_oldbutlive">0.9_oldbutlive</option><option value="other">other versions</option></select>
HTML
end
end
context 'the other versions drop down' do
it 'contains all branches' do
expect(body).to include(<<~HTML.strip)
<span id="other_versions">other versions: <select><option value="master" selected>master</option><option value="0.10">0.10 (current)</option><option value="0.9_oldbutlive">0.9_oldbutlive</option><option value="0.8_nonlive">0.8_nonlive</option></select>
<span id="other_versions">other versions: <select><option value="master" selected>master</option><option value="0.10">0.10</option><option value="0.9_oldbutlive">0.9_oldbutlive</option><option value="0.8_nonlive">0.8_nonlive</option></select>
HTML
end
end
Expand Down Expand Up @@ -662,14 +662,14 @@ def self.setup_example(repo, lang, hash)
context 'the live versions drop down' do
it 'contains only the live branches' do
expect(body).to include(<<~HTML.strip)
<select id="live_versions"><option value="0.10" selected>0.10 (current)</option><option value="0.9_oldbutlive">0.9_oldbutlive</option><option value="other">other versions</option></select>
<select id="live_versions"><option value="0.10" selected>0.10</option><option value="0.9_oldbutlive">0.9_oldbutlive</option><option value="other">other versions</option></select>
HTML
end
end
context 'the other versions drop down' do
it 'contains all branches' do
expect(body).to include(<<~HTML.strip)
<span id="other_versions">other versions: <select><option value="master">master</option><option value="0.10" selected>0.10 (current)</option><option value="0.9_oldbutlive">0.9_oldbutlive</option><option value="0.8_nonlive">0.8_nonlive</option></select>
<span id="other_versions">other versions: <select><option value="master">master</option><option value="0.10" selected>0.10</option><option value="0.9_oldbutlive">0.9_oldbutlive</option><option value="0.8_nonlive">0.8_nonlive</option></select>
HTML
end
end
Expand All @@ -695,14 +695,14 @@ def self.setup_example(repo, lang, hash)
context 'the live versions drop down' do
it 'contains only the live branches' do
expect(body).to include(<<~HTML.strip)
<select id="live_versions"><option value="0.10">0.10 (current)</option><option value="0.9_oldbutlive" selected>0.9_oldbutlive</option><option value="other">other versions</option></select>
<select id="live_versions"><option value="0.10">0.10</option><option value="0.9_oldbutlive" selected>0.9_oldbutlive</option><option value="other">other versions</option></select>
HTML
end
end
context 'the other versions drop down' do
it 'contains all branches' do
expect(body).to include(<<~HTML.strip)
<span id="other_versions">other versions: <select><option value="master">master</option><option value="0.10">0.10 (current)</option><option value="0.9_oldbutlive" selected>0.9_oldbutlive</option><option value="0.8_nonlive">0.8_nonlive</option></select>
<span id="other_versions">other versions: <select><option value="master">master</option><option value="0.10">0.10</option><option value="0.9_oldbutlive" selected>0.9_oldbutlive</option><option value="0.8_nonlive">0.8_nonlive</option></select>
HTML
end
end
Expand Down Expand Up @@ -734,14 +734,14 @@ def self.setup_example(repo, lang, hash)
context 'the live versions drop down' do
it 'contains the deprecated branch' do
expect(body).to include(<<~HTML.strip)
<select id="live_versions"><option value="0.10">0.10 (current)</option><option value="0.9_oldbutlive">0.9_oldbutlive</option><option value="0.8_nonlive" selected>0.8_nonlive</option><option value="other">other versions</option>
<select id="live_versions"><option value="0.10">0.10</option><option value="0.9_oldbutlive">0.9_oldbutlive</option><option value="0.8_nonlive" selected>0.8_nonlive</option><option value="other">other versions</option>
HTML
end
end
context 'the other versions drop down' do
it 'contains all branches' do
expect(body).to include(<<~HTML.strip)
<span id="other_versions">other versions: <select><option value="master">master</option><option value="0.10">0.10 (current)</option><option value="0.9_oldbutlive">0.9_oldbutlive</option><option value="0.8_nonlive" selected>0.8_nonlive</option></select>
<span id="other_versions">other versions: <select><option value="master">master</option><option value="0.10">0.10</option><option value="0.9_oldbutlive">0.9_oldbutlive</option><option value="0.8_nonlive" selected>0.8_nonlive</option></select>
HTML
end
end
Expand Down
21 changes: 6 additions & 15 deletions lib/ES/Book.pm
Original file line number Diff line number Diff line change
Expand Up @@ -202,21 +202,14 @@ sub build {
$latest = 0;

my $version = $self->branch_title($branch);
if ( $branch eq $self->current ) { # TODO: when "current" is a version, change this.
$toc->add_entry(
{ title => "$title: $version (current)",
url => "current/index.html"
}
);
$toc->add_entry(
{ title => "$title: $version",
url => "$version/index.html"
}
);
if ( $branch eq $self->current ) {
$rebuilding_current_branch = $building;
}
else {
$toc->add_entry(
{ title => "$title: $version",
url => "$version/index.html"
}
);
}
}
$pm->wait_all_children();
$self->_copy_branch_to_current if $rebuilding_current_branch;
Expand Down Expand Up @@ -372,7 +365,6 @@ sub _update_title_and_version_drop_downs {
$title .= '<option value="' . $version . '"';
$title .= ' selected' if $branch eq $b;
$title .= '>' . $version;
$title .= ' (current)' if $self->current eq $b; # TODO: change when "current" is a version
$title .= '</option>';
}
$title .= '<option value="other">other versions</option>' if $removed_any;
Expand All @@ -385,7 +377,6 @@ sub _update_title_and_version_drop_downs {
$title .= '<option value="' . $version . '"';
$title .= ' selected' if $branch eq $b;
$title .= '>' . $version;
$title .= ' (current)' if $self->current eq $b; # TODO: change when "current" is a version
$title .= '</option>';
}
$title .= '</select>';
Expand Down