Skip to content

Commit

Permalink
Merge pull request #32 from kdelchev/create_task
Browse files Browse the repository at this point in the history
Create task
  • Loading branch information
iblue committed Jul 30, 2015
2 parents 30289b9 + 4b9eedc commit 1450cbb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ Please note that D3 is provided via the asset pipeline and you do *not* need to
Then add it to your manifest file, most probably at `app/assets/javascripts/application.js`:

//= require d3

## Development

To update the D3 version contained in the gem, you can run the following rake task
```bash
bundle exec rake d3:update_version
```
18 changes: 18 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
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://raw.githubusercontent.com/mbostock/d3/master/d3.js`
`curl -o app/assets/javascripts/d3.min.js https://raw.githubusercontent.com/mbostock/d3/master/d3.min.js`
`cp app/assets/javascripts/d3.js app/assets/javascripts/d3.v3.js`
`cp app/assets/javascripts/d3.min.js app/assets/javascripts/d3.v3.min.js`
version = `grep 'version: ".*"' app/assets/javascripts/d3.js | cut -d '"' -f 2`.strip
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

0 comments on commit 1450cbb

Please sign in to comment.