forked from ywjno/bootstrap-timepicker-rails-addon
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
25 lines (19 loc) · 1.06 KB
/
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
25
require "bundler/gem_tasks"
require "json"
require File.expand_path('../lib/bootstrap-timepicker-rails-addon/version', __FILE__)
desc "Update assets"
task 'update' do
if Dir.exist?('bootstrap-timepicker-src')
system("cd bootstrap-timepicker-src && git checkout gh-pages && git pull")
else
system("git clone git://github.com/jdewit/bootstrap-timepicker.git bootstrap-timepicker-src")
end
system("rm vendor/assets/javascripts/bootstrap-timepicker.js")
system("rm vendor/assets/stylesheets/bootstrap-timepicker.css")
system("cd bootstrap-timepicker-src && npm install && grunt less")
system("cp bootstrap-timepicker-src/js/bootstrap-timepicker.js vendor/assets/javascripts/bootstrap-timepicker.js")
system("cp bootstrap-timepicker-src/css/bootstrap-timepicker.css vendor/assets/stylesheets/bootstrap-timepicker.css")
puts "\n"
puts "bootstrap-timepicker version: #{JSON.parse(File.read('./bootstrap-timepicker-src/bower.json'))['version']}"
puts "bootstrap-timepicker-rails-addon version: #{Bootstrap::Timepicker::Rails::Addon::VERSION}"
end