forked from brianjlandau/unobtrusive_date_picker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.rb
14 lines (11 loc) · 841 Bytes
/
install.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
require 'fileutils'
# Install all the needed support files (CSS and JavaScript)
js_dir = File.dirname(__FILE__) + '/../../../public/javascripts/'
datepicker_js = js_dir + 'datepicker.js'
lang_dir = js_dir + 'lang'
datepicker_css = File.dirname(__FILE__) + '/../../../public/stylesheets/datepicker.css'
images_dir = File.dirname(__FILE__) + '/../../../public/images/datepicker'
FileUtils.cp File.dirname(__FILE__) + '/public/javascripts/datepicker.js', datepicker_js unless File.exists?(datepicker_js)
FileUtils.cp_r File.dirname(__FILE__) + '/public/javascripts/lang/', lang_dir unless File.exists?(lang_dir)
FileUtils.cp File.dirname(__FILE__) + '/public/stylesheets/datepicker.css', datepicker_css unless File.exists?(datepicker_css)
FileUtils.cp_r File.dirname(__FILE__) + '/public/images/', images_dir unless File.exists?(images_dir)