Rakefile in highcharts-rails-5.0.14 vs Rakefile in highcharts-rails-6.0.0
- old
+ new
@@ -23,46 +23,95 @@
# styled mode, where presentational code is removed. Prior to 5.0.0 this code
# was contained in the js/ folder
MODULE_MAPPING = %w(
accessibility
annotations
+ boost-canvas
boost
broken-axis
- canvas-tools
+ bullet
data
+ drag-panes
drilldown
+ export-data
exporting
funnel
- gant
+ gantt
grid-axis
heatmap
+ histogram-bellcurve
+ item-series
no-data-to-display
offline-exporting
+ oldie
overlapping-datalabels
+ parallel-coordinates
+ pareto
+ sankey
series-label
solid-gauge
+ static-scale
stock
+ streamgraph
+ sunburst
+ tilemap
treemap
- xrange-series
+ variable-pie
+ variwide
+ vector
+ windbarb
+ wordcloud
+ xrange
).map do |name|
["modules/#{name}.src.js", "highcharts/modules/#{name}.js"]
end.to_h
+ LIB_MAPPING = %w(
+ canvg
+ jspdf
+ rgbcolor
+ svg2pdf
+ ).map do |name|
+ ["lib/#{name}.src.js", "highcharts/lib/#{name}.js"]
+ end.to_h
+
+ THEMES_MAPPING = %w(
+ avocado
+ dark-blue
+ dark-green
+ dark-unica
+ gray
+ grid-light
+ grid
+ sand-signika
+ skies
+ sunset
+ ).map do |name|
+ ["themes/#{name}.src.js", "highcharts/themes/#{name}.js"]
+ end.to_h
+
MAPPINGS = {
'highcharts.src.js' => 'highcharts.js',
'highcharts-more.src.js' => 'highcharts/highcharts-more.js',
'highcharts-3d.src.js' => 'highcharts/highcharts-3d.js'
- }.merge(MODULE_MAPPING).map { |src, dst| ["code/#{src}", dst] }.to_h.freeze
+ }
+ .merge(MODULE_MAPPING)
+ .merge(LIB_MAPPING)
+ .merge(THEMES_MAPPING)
+ .map { |src, dst| ["code/#{src}", dst] }.to_h.freeze
version = args[:version]
url = "http://code.highcharts.com/zips/Highcharts-#{version}.zip"
puts "Fetching #{url}"
open(url) do |stream|
Zip::File.open_buffer(stream) do |file|
file.each do |entry|
dest_rel_path = MAPPINGS[entry.name]
- next unless dest_rel_path
+ if !dest_rel_path
+ puts "ignoring " + dest_rel_path
+ next
+ end
dest_path = "app/assets/javascripts/#{dest_rel_path}"
FileUtils.remove(dest_path, force: true)
entry.extract(dest_path)
puts dest_rel_path + ' extracted'
end
\ No newline at end of file