Rakefile in highcharts-rails-6.0.0 vs Rakefile in highcharts-rails-6.0.1
- old
+ new
@@ -87,18 +87,26 @@
sunset
).map do |name|
["themes/#{name}.src.js", "highcharts/themes/#{name}.js"]
end.to_h
+ STYLE_MAPPING = %w(
+ highcharts.css
+ highcharts.scss
+ ).map do |name|
+ ["css/#{name}", "../stylesheets/highcharts/#{name}"]
+ 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)
.merge(LIB_MAPPING)
.merge(THEMES_MAPPING)
+ .merge(STYLE_MAPPING)
.map { |src, dst| ["code/#{src}", dst] }.to_h.freeze
version = args[:version]
url = "http://code.highcharts.com/zips/Highcharts-#{version}.zip"
@@ -106,10 +114,10 @@
open(url) do |stream|
Zip::File.open_buffer(stream) do |file|
file.each do |entry|
dest_rel_path = MAPPINGS[entry.name]
if !dest_rel_path
- puts "ignoring " + dest_rel_path
+ puts "ignoring #{entry.name}" if entry.name.include?("src.js")
next
end
dest_path = "app/assets/javascripts/#{dest_rel_path}"
FileUtils.remove(dest_path, force: true)
entry.extract(dest_path)
\ No newline at end of file