-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathRakefile
24 lines (23 loc) · 812 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'bundler'
Bundler::GemHelper.install_tasks
namespace :d3 do
desc 'Update d3 version'
task :update_version do
`curl -o app/assets/javascripts/d3.js https://d3js.org/d3.v7.js`
`curl -o app/assets/javascripts/d3.min.js https://d3js.org/d3.v7.min.js`
`cp app/assets/javascripts/d3.js app/assets/javascripts/d3.v7.js`
`cp app/assets/javascripts/d3.min.js app/assets/javascripts/d3.v7.min.js`
version = File.open("app/assets/javascripts/d3.js") { |f|
f.each_line.lazy.select { |line|
line.match(/((\d+\.)(\d+\.)(\*|\d+))/)
}.first; $1
}
message = <<-MSG
Please update the version to #{version} manually in the following files:
* CHANGELOG.md
* README.md
* lib/d3/rails/version.rb
MSG
puts message.strip.squeeze ' '
end
end