Skip to content

Commit

Permalink
added timeline chart
Browse files Browse the repository at this point in the history
  • Loading branch information
kowal committed Sep 20, 2023
1 parent 117788b commit 92c1004
Show file tree
Hide file tree
Showing 10 changed files with 230 additions and 18 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


### Ruby 3.2

* :lock: **EOL** 2026-03-31
* Implementations: [MRI 3.2.2](https://www.ruby-lang.org/en/news/2023/03/30/ruby-3-2-2-released/)
* :gear: WASI based WebAssembly support
* :gear: Production-ready YJIT
Expand All @@ -18,7 +18,7 @@
* :gear: Bundler 2.4 now uses PubGrub resolver instead of Molinillo

### Ruby 3.1

* :lock: **EOL** 2025-03-31
* Implementations: [MRI 3.1.4](https://www.ruby-lang.org/en/news/2023/03/30/ruby-3-1-4-released/)
* :gear: YJIT: New experimental in-process JIT compiler :test_tube:
* :new: debug gem: A new debugger
Expand All @@ -28,7 +28,7 @@
* :arrows_counterclockwise: Updates in RBS / TypeProf

### Ruby 3.0

* :lock: **EOL** 2024-03-31
* Implementations: [MRI 3.0.6](https://www.ruby-lang.org/en/news/2023/03/30/ruby-3-0-6-released/)
* :gear: MJIT improvements
* :new: Ractor - Actor-model like concurrent abstraction :test_tube:
Expand Down
5 changes: 4 additions & 1 deletion data/ruby_versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
"version": "3.2",
"version_info": "3.2.0 (Dec 2022) - 3.2.2 (March 2023)",
"state": "Supported",
"eol": "2026-03-31",
"minors": [
{ "version": "3.2.2", "release_date": "2023-03-30", "end_date": "" },
{ "version": "3.2.1", "release_date": "2023-02-08", "end_date": "2023-03-30" },
{ "version": "3.2.0", "release_date": "2022-12-25", "end_date": "2022-02-08" }
{ "version": "3.2.0", "release_date": "2022-12-25", "end_date": "2023-02-08" }
],
"implementations": [
{
Expand Down Expand Up @@ -55,6 +56,7 @@
"version": "3.1",
"version_info": "3.1.0 (Dec 2020) - 3.1.4 (March 2023)",
"state": "Supported",
"eol": "2025-03-31",
"minors": [
{ "version": "3.1.4", "release_date": "2023-03-30", "end_date": "" },
{ "version": "3.1.3", "release_date": "2022-11-24", "end_date": "2023-03-30" },
Expand Down Expand Up @@ -114,6 +116,7 @@
"version": "3.0",
"version_info": "3.0.0 (Dec 2020) - 3.0.6 (March 2023)",
"state": "Security maintenance phase",
"eol": "2024-03-31",
"minors": [
{ "version": "3.0.6", "release_date": "2023-03-30", "end_date": "" },
{ "version": "3.0.5", "release_date": "2022-11-24", "end_date": "2023-03-30" },
Expand Down
70 changes: 70 additions & 0 deletions docs/docs/javascripts/charts-timeline.js

Large diffs are not rendered by default.

30 changes: 25 additions & 5 deletions docs/docs/timeline.md
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)
8 changes: 4 additions & 4 deletions docs/docs/versions-all.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@



## Ruby 3.2
## Ruby 3.2 <div class='icon-label eol' title='All maintenance ended on 2026-03-31'><div data-icon='ei-lock' data-size='s'></div></div>


### Ruby [3.2.2](https://www.ruby-lang.org/en/news/2023/03/30/ruby-3-2-2-released/) <div class='icon-label calendar' title='Released on 2023-03-30'><div data-icon='ei-calendar' data-size='s'></div></div>
Expand Down Expand Up @@ -30,7 +30,7 @@
----


## Ruby 3.1
## Ruby 3.1 <div class='icon-label eol' title='All maintenance ended on 2025-03-31'><div data-icon='ei-lock' data-size='s'></div></div>


### Ruby [3.1.4](https://www.ruby-lang.org/en/news/2023/03/30/ruby-3-1-4-released/) <div class='icon-label calendar' title='Released on 2023-03-30'><div data-icon='ei-calendar' data-size='s'></div></div>
Expand Down Expand Up @@ -73,7 +73,7 @@
----


## Ruby 3.0
## Ruby 3.0 <div class='icon-label eol' title='All maintenance ended on 2024-03-31'><div data-icon='ei-lock' data-size='s'></div></div>


### Ruby [3.0.6](https://www.ruby-lang.org/en/news/2023/03/30/ruby-3-0-6-released/) <div class='icon-label calendar' title='Released on 2023-03-30'><div data-icon='ei-calendar' data-size='s'></div></div>
Expand Down Expand Up @@ -579,4 +579,4 @@

----

(Last updated on 2023-09-19 23:11:27 +0200)
(Last updated on 2023-09-20 20:13:59 +0200)
8 changes: 4 additions & 4 deletions docs/docs/versions-latest.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@



## Ruby <a target='_blank' href="https://www.ruby-lang.org/en/news/2023/03/30/ruby-3-2-2-released/">3.2.2</a> <div class='icon-label calendar' title='Released on 2023-03-30'><div data-icon='ei-calendar' data-size='s'></div></div>
## Ruby <a target='_blank' href="https://www.ruby-lang.org/en/news/2023/03/30/ruby-3-2-2-released/">3.2.2</a> <div class='icon-label eol' title='All maintenance ended on 2026-03-31'><div data-icon='ei-lock' data-size='s'></div></div> <div class='icon-label calendar' title='Released on 2023-03-30'><div data-icon='ei-calendar' data-size='s'></div></div>

- <span class='badge badge-pill badge-dark'>Internals</span>
WASI based WebAssembly support
Expand All @@ -27,7 +27,7 @@



## Ruby <a target='_blank' href="https://www.ruby-lang.org/en/news/2023/03/30/ruby-3-1-4-released/">3.1.4</a> <div class='icon-label calendar' title='Released on 2023-03-30'><div data-icon='ei-calendar' data-size='s'></div></div>
## Ruby <a target='_blank' href="https://www.ruby-lang.org/en/news/2023/03/30/ruby-3-1-4-released/">3.1.4</a> <div class='icon-label eol' title='All maintenance ended on 2025-03-31'><div data-icon='ei-lock' data-size='s'></div></div> <div class='icon-label calendar' title='Released on 2023-03-30'><div data-icon='ei-calendar' data-size='s'></div></div>

- <span class='badge badge-pill badge-dark'>Internals</span>
YJIT: New experimental in-process JIT compiler (experimental)
Expand Down Expand Up @@ -67,7 +67,7 @@ foo(x:, y:) is syntax sugar for foo(x: x, y: y).</code>



## Ruby <a target='_blank' href="https://www.ruby-lang.org/en/news/2023/03/30/ruby-3-0-6-released/">3.0.6</a> <div class='icon-label calendar' title='Released on 2023-03-30'><div data-icon='ei-calendar' data-size='s'></div></div>
## Ruby <a target='_blank' href="https://www.ruby-lang.org/en/news/2023/03/30/ruby-3-0-6-released/">3.0.6</a> <div class='icon-label eol' title='All maintenance ended on 2024-03-31'><div data-icon='ei-lock' data-size='s'></div></div> <div class='icon-label calendar' title='Released on 2023-03-30'><div data-icon='ei-calendar' data-size='s'></div></div>

- <span class='badge badge-pill badge-dark'>Internals</span>
MJIT improvements
Expand Down Expand Up @@ -346,4 +346,4 @@ This will be reversed again in Ruby 3.0.0</code>

----

(Last updated on 2023-09-19 23:11:27 +0200)
(Last updated on 2023-09-20 20:13:59 +0200)
2 changes: 2 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,7 @@ nav:
- Versions:
- Latest Versions: versions-latest.md
- All Versions: versions-all.md
- Timeline:
- Timeline: timeline.md
- Other:
- Ruby resources: links.md
8 changes: 7 additions & 1 deletion lib/ruby_changelog/actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module RubyChangelog
TEMPLATE_DOCS_VERSIONS_LATEST_MD = "#{TEMPLATE_BASE}/docs/versions/latest.md.erb".freeze
TEMPLATE_DOCS_VERSIONS_ALL_MD = "#{TEMPLATE_BASE}/docs/versions/all.md.erb".freeze
TEMPLATE_DOCS_TIMELINE_JS = "#{TEMPLATE_BASE}/docs/charts/timeline.js.erb".freeze
TEMPLATE_DOCS_CHARTS_TIMELINE_MD = "#{TEMPLATE_BASE}/docs/charts/timeline.md.erb".freeze

DOCS_BASE = 'docs'.freeze
DOCS_VERSIONS_LATEST_MD = "#{DOCS_BASE}/docs/versions-latest.md".freeze
Expand Down Expand Up @@ -40,7 +41,12 @@ def generate_docs

save_file(
DOCS_CHARTS_TIMELINE_JS,
generate_file(TEMPLATE_DOCS_TIMELINE_JS, ruby_versions: ruby_versions_data)
generate_file(TEMPLATE_DOCS_TIMELINE_JS, ruby_versions: ruby_versions_data, ruby_cve: ruby_cve_data)
)

save_file(
DOCS_CHARTS_TIMELINE_MD,
generate_file(TEMPLATE_DOCS_CHARTS_TIMELINE_MD, ruby_versions: ruby_versions_data)
)
end

Expand Down
84 changes: 84 additions & 0 deletions lib/templates/docs/charts/timeline.js.erb
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);
}
};
}
27 changes: 27 additions & 0 deletions lib/templates/docs/charts/timeline.md.erb
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 %>)

0 comments on commit 92c1004

Please sign in to comment.