-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
230 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,27 @@ | ||
--- | ||
template: overrides/main.html | ||
--- | ||
<style> | ||
/* Navigation sidebar */ | ||
.md-nav--primary { | ||
display: none; | ||
width: 0; | ||
overflow: hidden; | ||
} | ||
|
||
# Versions timeline | ||
/* Table of contents sidebar */ | ||
.md-nav--secondary { | ||
display: none; | ||
width: 0; | ||
overflow: hidden; | ||
} | ||
|
||
<div id="chartdiv"></div> | ||
#timeline { | ||
width: 1100px; | ||
} | ||
</style> | ||
|
||
# Timeline of Ruby releasess | ||
|
||
<div id="timeline"></div> | ||
|
||
---- | ||
|
||
(Last updated on 2023-09-20 20:13:59 +0200) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,86 @@ | ||
window.onload = function () { | ||
var container = document.getElementById('timeline'); | ||
|
||
if (container) { | ||
removeSidebars(); | ||
|
||
google.charts.load('current', {'packages':['timeline']}); | ||
google.charts.setOnLoadCallback(drawChart); | ||
} | ||
|
||
function removeSidebars() { | ||
const sidebarsPrimary = document.querySelectorAll('.md-sidebar.md-sidebar--primary'); | ||
const sidebarsSecondary = document.querySelectorAll('.md-sidebar.md-sidebar--secondary'); | ||
|
||
sidebarsPrimary.forEach(box => { | ||
box.remove(); | ||
}); | ||
|
||
sidebarsSecondary.forEach(box => { | ||
box.remove(); | ||
}); | ||
} | ||
|
||
function getChartRows() { | ||
return mapDateParams(<%= ruby_versions.map do |rb| | ||
[*rb['minors']].map do |minor| | ||
[ | ||
"Ruby #{rb['version']}", | ||
minor['version'], | ||
(if ruby_cve[minor['version']] && !ruby_cve[minor['version']].empty? | ||
ruby_cve[minor['version']].map { |cve_entry| cve_entry['title'] }.join('<br') | ||
else | ||
rb['changes'].map { |ch| ch['summary'] }.join('<br>') | ||
end), | ||
minor['release_date'], | ||
minor['end_date'] != '' ? minor['end_date'] : Date.today.to_s | ||
] | ||
end | ||
end.flatten(1).to_json %>) | ||
}; | ||
|
||
function mapDateParams(list) { | ||
return list.map(function(el) { | ||
return [ | ||
el[0], | ||
el[1], | ||
el[2], | ||
new Date(el[3]), | ||
new Date(el[4]) | ||
]; | ||
}); | ||
} | ||
|
||
function drawChart() { | ||
var container = document.getElementById('timeline'); | ||
if (container) { | ||
var chart = new google.visualization.Timeline(container); | ||
var dataTable = new google.visualization.DataTable(); | ||
|
||
console.log('getChartRows()'); | ||
console.dir(getChartRows()); | ||
|
||
dataTable.addColumn({ type: 'string', id: 'Ruby major version' }); | ||
dataTable.addColumn({ type: 'string', id: 'Ruby version' }); | ||
dataTable.addColumn({ type: 'string', role: 'tooltip', 'p': {'html': true}}); | ||
dataTable.addColumn({ type: 'date', id: 'Start' }); | ||
dataTable.addColumn({ type: 'date', id: 'End' }); | ||
dataTable.addRows(getChartRows()); | ||
|
||
var options = { | ||
tooltip: { isHtml: true }, | ||
timeline: { | ||
// groupByRowLabel: false | ||
colorByRowLabel: true, | ||
rowLabelStyle: { fontSize: 10 }, barLabelStyle: { fontSize: 10 } | ||
}, | ||
height: 1000, | ||
enableInteractivity: true, | ||
backgroundColor: '#ffd', | ||
avoidOverlappingGridLines: true | ||
}; | ||
|
||
chart.draw(dataTable, options); | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<style> | ||
/* Navigation sidebar */ | ||
.md-nav--primary { | ||
display: none; | ||
width: 0; | ||
overflow: hidden; | ||
} | ||
|
||
/* Table of contents sidebar */ | ||
.md-nav--secondary { | ||
display: none; | ||
width: 0; | ||
overflow: hidden; | ||
} | ||
|
||
#timeline { | ||
width: 1100px; | ||
} | ||
</style> | ||
|
||
# Timeline of Ruby releasess | ||
|
||
<div id="timeline"></div> | ||
|
||
---- | ||
|
||
(Last updated on <%= Time.now.to_s %>) |