From 717e50a25e5173b3740946d8a597530d26f6b2b4 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 27 Mar 2012 18:28:09 +0800 Subject: [PATCH] Add rake task for layout with nokogiri --- lib/noko/layout.html | 184 +++++++++++++++++++++++++++++++++++++++++++ lib/tasks/noko.rake | 13 +++ 2 files changed, 197 insertions(+) create mode 100755 lib/noko/layout.html create mode 100644 lib/tasks/noko.rake diff --git a/lib/noko/layout.html b/lib/noko/layout.html new file mode 100755 index 00000000..8723d6a7 --- /dev/null +++ b/lib/noko/layout.html @@ -0,0 +1,184 @@ + + + + + + RulingSite + + + + + + + + + + +
+ + +
+
+
+
+
+
+
+
+ +
+
+
+ +
+
+
+
+
+
+
+
+ +
+ + +
+
+ + +
+ + diff --git a/lib/tasks/noko.rake b/lib/tasks/noko.rake new file mode 100644 index 00000000..b411fa30 --- /dev/null +++ b/lib/tasks/noko.rake @@ -0,0 +1,13 @@ +# encoding: utf-8 + +namespace :nokogiri do + task :layout => :environment do + l = Design.first(:conditions => {:title => 'CCU'}).layout + l.layout_parts.destroy rescue nil + l.menu.destroy rescue nil + l.design.save + l = Design.first(:conditions => {:title => 'CCU'}).layout + l.file = File.open("#{Rails.root}/lib/noko/layout.html") + l.design.save + end +end \ No newline at end of file