Rakefile in bootstrap-x-editable-rails-1.5.1 vs Rakefile in bootstrap-x-editable-rails-1.5.1.1
- old
+ new
@@ -1,28 +1,43 @@
desc "Update"
task :update do
src_path = "x-editable-src"
- dist_path = "#{src_path}/dist/bootstrap-editable"
+ dist_path = "#{src_path}/dist/"
system("rm -rf #{src_path}")
system("git clone https://github.com/vitalets/x-editable #{src_path}")
system("cd #{src_path} && npm install")
system("cd #{src_path} && grunt build")
- system("cp #{dist_path}/img/clear.png app/assets/images/")
- system("cp #{dist_path}/img/loading.gif app/assets/images/")
- system("cp #{dist_path}/css/bootstrap-editable.css app/assets/stylesheets/bootstrap-editable.scss")
- system("cp #{dist_path}/js/bootstrap-editable.js app/assets/javascripts/")
+ system("cp #{dist_path}/bootstrap-editable/img/clear.png app/assets/images/")
+ system("cp #{dist_path}/bootstrap-editable/img/loading.gif app/assets/images/")
+ # Bootstrap 2
+ system("mkdir -p app/assets/stylesheets/bootstrap-editable")
+ system("mkdir -p app/assets/javascripts/bootstrap-editable")
+ system("cp #{dist_path}/bootstrap-editable/css/bootstrap-editable.css app/assets/stylesheets/bootstrap-editable/bootstrap-editable.scss")
+ system("cp #{dist_path}/bootstrap-editable/js/bootstrap-editable.js app/assets/javascripts/bootstrap-editable/")
+
+ # Bootstrap 3
+ system("mkdir -p app/assets/stylesheets/bootstrap3-editable")
+ system("mkdir -p app/assets/javascripts/bootstrap3-editable")
+ system("cp #{dist_path}/bootstrap3-editable/css/bootstrap-editable.css app/assets/stylesheets/bootstrap3-editable/bootstrap-editable.scss")
+ system("cp #{dist_path}/bootstrap3-editable/js/bootstrap-editable.js app/assets/javascripts/bootstrap3-editable/")
+
fixes
system("rm -rf x-editable-src")
end
def fixes
- replace_string_in_file("app/assets/stylesheets/bootstrap-editable.scss", "url('../img/loading.gif')", "image-url('loading.gif')")
- replace_string_in_file("app/assets/stylesheets/bootstrap-editable.scss", "url('../img/clear.png')", "image-url('clear.png')")
+ # Bootstrap 2
+ replace_string_in_file("app/assets/stylesheets/bootstrap-editable/bootstrap-editable.scss", "url('../img/loading.gif')", "image-url('loading.gif')")
+ replace_string_in_file("app/assets/stylesheets/bootstrap-editable/bootstrap-editable.scss", "url('../img/clear.png')", "image-url('clear.png')")
+
+ # Bootstrap 3
+ replace_string_in_file("app/assets/stylesheets/bootstrap3-editable/bootstrap-editable.scss", "url('../img/loading.gif')", "image-url('loading.gif')")
+ replace_string_in_file("app/assets/stylesheets/bootstrap3-editable/bootstrap-editable.scss", "url('../img/clear.png')", "image-url('clear.png')")
end
def replace_string_in_file(file, find, replace)
file_content = File.read(file)