-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
30 lines (23 loc) · 841 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
desc "Update"
task :update do
system("rm -rf multiselect-src")
system("git clone https://github.com/artyomkalm/multiselect.git multiselect-src")
system("cp multiselect-src/img/switch.png app/assets/images/switch.png")
system("cp multiselect-src/css/multiselect.css app/assets/stylesheets/multiselect.scss")
system("cp multiselect-src/js/jquery.multiselect.js app/assets/javascripts/multiselect.js")
fixes
system("rm -rf multiselect-src")
end
def fixes
replace_string_in_file("app/assets/stylesheets/multiselect.scss", "url('../img/switch.png')", "image-url('switch.png')")
end
def replace_string_in_file(file, find, replace)
file_content = File.read(file)
File.open(file, "w") do |f|
f.puts file_content.gsub!(find, replace)
end
end
desc "Build"
task "build" do
system("gem build multiselect.gemspec")
end