lib/cfoundry/app.rb in cfoundry-0.1.1 vs lib/cfoundry/app.rb in cfoundry-0.1.2

- old
+ new

@@ -128,10 +128,21 @@ @manifest ||= {} @manifest[attr] = v end end + def uri + uris[0] + end + + def uri=(x) + self.uris = [x] + end + + alias :url :uri + alias :url= :uri= + def framework manifest["staging"]["framework"] || manifest["staging"]["model"] end @@ -225,21 +236,21 @@ prepare_package(path, tmpdir) resources = determine_resources(tmpdir) if check_resources - CFoundry::Zip.pack(tmpdir, zipfile) + packed = CFoundry::Zip.pack(tmpdir, zipfile) - @client.rest.upload_app(@name, zipfile, resources || []) + @client.rest.upload_app(@name, packed && zipfile, resources || []) ensure FileUtils.rm_f(zipfile) if zipfile FileUtils.rm_rf(tmpdir) if tmpdir end private def prepare_package(path, to) - if path =~ /\.(war|zip)$/ + if path =~ /\.(jar|war|zip)$/ CFoundry::Zip.unpack(path, to) elsif war_file = Dir.glob("#{path}/*.war").first CFoundry::Zip.unpack(war_file, to) else check_unreachable_links(path)