lib/storys/package.rb in storys-0.0.5 vs lib/storys/package.rb in storys-0.0.6
- old
+ new
@@ -20,18 +20,18 @@
root_url_path + path
end
def update
app_path.mkdir unless File.exists?(app_path)
- update_app
Storys::Update.new(self)
+ update_app
end
def update_app
dev = ENV["STORYS_ENV"] == "development"
- app_children_paths.each do |file|
+ (app_children_paths + [manifest_path]).each do |file|
storys_file = app_path + file.basename
FileUtils.rm_rf(storys_file, :verbose => dev)
end
if dev
@@ -39,13 +39,48 @@
storys_file = app_path + file.basename
FileUtils.ln_sf(file, storys_file, :verbose => dev)
end
else
FileUtils.cp_r(Storys::Package.gem_path + "app/.", app_path, :verbose => dev)
+ save_manifest
end
FileUtils.chmod_R(0755, app_path, :verbose => dev)
end
+
+ def save_manifest
+ File.open(manifest_path, "w") do |f|
+ f << <<-EOFSM
+CACHE MANIFEST
+# Timestamp #{Time.now.to_i}
+CACHE:
+css/lib/bootstrap.css
+css/app.css
+css/views.index.css
+css/views.show.css
+js/lib/jquery-2.0.3.js
+js/lib/bootstrap.js
+js/lib/underscore.js
+js/lib/handlebars-v1.3.0.js
+js/lib/jquery.browser.js
+js/jquery.twoup.js
+js/framework.js
+js/controllers.index.js
+js/controllers.show.js
+js/app.js
+fonts/lib/glyphicons-halflings-regular.eot
+fonts/lib/glyphicons-halflings-regular.svg
+fonts/lib/glyphicons-halflings-regular.ttf
+fonts/lib/glyphicons-halflings-regular.woff
+data.json
+EOFSM
+ end
+ end
+
+ def manifest_path
+ app_path + "manifest"
+ end
+
def self.gem_path
Pathname.new(__FILE__).dirname.parent.parent
end