don't error when the given directories don't exist
This commit is contained in:
parent
189cd910a3
commit
eca3b06461
|
@ -26,8 +26,8 @@ module CouchRest
|
||||||
attachdir = File.join(appdir,"_attachments")
|
attachdir = File.join(appdir,"_attachments")
|
||||||
|
|
||||||
@doc = dir_to_fields(appdir)
|
@doc = dir_to_fields(appdir)
|
||||||
package_forms(@doc["forms"])
|
package_forms(@doc["forms"]) if @doc['forms']
|
||||||
package_views(@doc["views"])
|
package_views(@doc["views"]) if @doc['views']
|
||||||
|
|
||||||
docid = "_design/#{appname}"
|
docid = "_design/#{appname}"
|
||||||
design = @db.get(docid) rescue {}
|
design = @db.get(docid) rescue {}
|
||||||
|
|
|
@ -108,6 +108,11 @@ describe CouchRest::FileManager, "pushing an app" do
|
||||||
doc = @db.get("_design/couchapp")
|
doc = @db.get("_design/couchapp")
|
||||||
doc['magical'].should == "so magic"
|
doc['magical'].should == "so magic"
|
||||||
end
|
end
|
||||||
|
it "handles not having a forms directory" do
|
||||||
|
`rm -rf #{@appdir}/forms`
|
||||||
|
lambda { @fm.push_app(@appdir, "couchapp") }.should_not raise_error
|
||||||
|
`mkdir -p #{@appdir}/forms`
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue