forked from ichord/jquery-atwho-rails
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
35 lines (30 loc) · 928 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
25
26
27
28
29
30
31
32
33
34
35
require 'rubygems'
require 'bundler/setup'
require "bundler/gem_tasks"
at_dir = "tmp/At.js"
bower_dir = "#{at_dir}/bower_components/"
desc "sync from At.js"
task :sync do
puts " * syncing..."
FileUtils.mkdir_p("tmp") unless Dir.exist? "tmp"
unless Dir.exist? at_dir
system "git clone git://github.com/ichord/At.js.git #{at_dir}"
else
Dir.chdir(at_dir) { puts %x{git pull -X theirs} }
end
Dir.chdir(at_dir) {
puts "* bower install..."
puts %x{bower install}
}
end
desc "copy assets"
task fresh: :sync do
puts " * Copying..."
source_dir = "tmp/At.js/dist"
dist_dir = "lib/assets"
js_dist_dir = "#{dist_dir}/javascripts/jquery.atwho/"
FileUtils.copy "#{bower_dir}/Caret.js/dist/jquery.caret.js", js_dist_dir
FileUtils.copy "#{source_dir}/js/jquery.atwho.js", js_dist_dir
FileUtils.copy "#{source_dir}/css/jquery.atwho.css", "#{dist_dir}/stylesheets/"
puts `ls -R #{dist_dir}`
end